-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathMODULE.bazel
112 lines (92 loc) · 3.76 KB
/
MODULE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
module(name = "heir")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
# Apple compilation support.
# Note this requires full xcode, not just commandline tools
#
# Tested with:
#
# $ /usr/bin/xcodebuild -version
# Xcode 16.2
# Build version 16C5032a
bazel_dep(name = "apple_support", version = "1.20.0", repo_name = "build_bazel_apple_support")
# Gazelle puglin for BUILD file autogeneration
bazel_dep(name = "gazelle", version = "0.42.0")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True)
# provides the `license` rule, which is required because llvm's gentbl_rule
# implicitly depends upon the target '//:license'. How bizarre.
bazel_dep(name = "rules_license", version = "1.0.0")
# rules_foreign_cc provides access to a `make` bazel rule, which is needed
# to build yosys
bazel_dep(name = "rules_foreign_cc", version = "0.14.0")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_go", version = "0.53.0")
bazel_dep(name = "rules_python", version = "1.2.0")
bazel_dep(name = "googletest", version = "1.16.0")
bazel_dep(name = "google_benchmark", version = "1.9.1")
bazel_dep(name = "abseil-cpp", version = "20250127.0", repo_name = "com_google_absl")
bazel_dep(name = "eigen", version = "4.0.0-20241125.bcr.1")
bazel_dep(name = "or-tools", version = "9.12", repo_name = "com_google_ortools")
# needed as transitive deps of yosys
bazel_dep(name = "rules_flex", version = "0.3")
bazel_dep(name = "rules_bison", version = "0.3")
# Hermetic python setup
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
python.toolchain(python_version = "3.11")
python.toolchain(python_version = "3.12")
# or-tools requires python3.13
python.toolchain(python_version = "3.13")
pip.parse(
hub_name = "heir_pip_deps",
python_version = "3.11",
requirements_lock = "//:requirements.txt",
)
pip.parse(
hub_name = "frontend_pip_deps",
python_version = "3.11",
requirements_lock = "//frontend:requirements.txt",
)
use_repo(python, python_3_11 = "python_3_11")
use_repo(pip, "heir_pip_deps")
use_repo(pip, "frontend_pip_deps")
# Go setup
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
# Bazel ignores go.mod for the purpose of selecting a go version. To see which
# go version will be used, run:
#
# bazel run @rules_go//go -- version
#
go_sdk.download(version = "1.24.2")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
# All *direct* Go dependencies of the module have to be listed explicitly.
use_repo(
go_deps,
"com_github_tuneinsight_lattigo_v6",
)
# compile_commands extracts the relevant compile data from bazel into
# `compile_commands.json` so that clangd, clang-tidy, etc., can use it.
# Whenever a build file changes, you must re-run
#
# bazel run @hedron_compile_commands//:refresh_all
#
# to ingest new data into these tools.
#
# See the project repo for more details and configuration options
# https://github.com/hedronvision/bazel-compile-commands-extractor
#
# For the override pointing to a different repo, see
# https://github.com/hedronvision/bazel-compile-commands-extractor/pull/219
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
commit = "f5fbd4cee671d8d908f37c83abaf70fba5928fc7",
remote = "https://github.com/mikael-s-persson/bazel-compile-commands-extractor",
)
# Workaround 2025-03-18: re2 has not created a new version yet. This solves an
# issue with `bazel mod deps`. Cf. https://github.com/google/re2/issues/525
git_override(
module_name = "re2",
commit = "c84a140c93352cdabbfb547c531be34515b12228",
remote = "https://github.com/google/re2",
)