-
Notifications
You must be signed in to change notification settings - Fork 231
Expand file tree
/
Copy pathMODULE.bazel
More file actions
189 lines (156 loc) · 7.16 KB
/
MODULE.bazel
File metadata and controls
189 lines (156 loc) · 7.16 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
module(
name = "xls",
repo_name = "com_google_xls",
)
# Compiler toolchain
bazel_dep(name = "toolchains_llvm", version = "1.4.0")
# Configure and register the toolchain.
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
cxx_standard = {"": "c++20"},
llvm_version = "19.1.7",
)
use_repo(llvm, "llvm_toolchain")
register_toolchains("@llvm_toolchain//:all")
# Python toolchain
bazel_dep(name = "rules_python", version = "1.9.0")
PYTHON_VERSION = "3.13"
PYTHON_VERSION_NAME = PYTHON_VERSION.replace(".", "_")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = PYTHON_VERSION,
)
# Use repo mapping to ensure that BUILD files don't need to be updated when the Python version
# changes to a different version.
use_repo(
python,
project_python = "python_{}".format(PYTHON_VERSION_NAME),
project_python_host = "python_{}_host".format(PYTHON_VERSION_NAME),
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
timeout = 600000,
hub_name = "xls_pip_deps",
python_version = PYTHON_VERSION,
requirements_lock = "//dependency_support:pip_requirements_lock.txt",
)
use_repo(pip, "xls_pip_deps")
# Root module dependencies.
# Note: some WORKSPACE dependencies still require repo_name aliases.
bazel_dep(name = "abseil-cpp", version = "20260107.0", repo_name = "com_google_absl")
bazel_dep(name = "abseil-py", version = "2.1.0")
bazel_dep(name = "bazel_features", version = "1.41.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "boringssl", version = "0.20250114.0")
bazel_dep(name = "cppitertools", version = "2.2")
# TODO: https://github.com/grpc/grpc/issues/41995 - Update to recent version once incompatibility
# with envoy_api (transitive bazel_dep through gRPC) is fixed.
# This is pinned to the previous version requested by gRPC (and also the latest version that works).
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a")
single_version_override(
module_name = "googleapis",
version = "0.0.0-20240819-fe8ba054a",
)
bazel_dep(name = "grpc", version = "1.80.0")
# TODO: https://github.com/grpc/grpc/issues/41998 - remove once this is fixed in the grpc repo.
single_version_override(
module_name = "grpc",
patch_strip = 1,
patches = ["//dependency_support/grpc:typing_extensions.patch"],
)
bazel_dep(name = "linenoise", version = "2.0.0")
bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1")
bazel_dep(name = "or-tools", version = "9.12", repo_name = "com_google_ortools")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "protobuf", version = "33.0", repo_name = "com_google_protobuf")
bazel_dep(name = "re2", version = "2024-07-02.bcr.1")
bazel_dep(name = "riegeli", version = "0.0.0-20250822-9f2744d")
bazel_dep(name = "rules_cc", version = "0.2.11")
# TODO: https://github.com/bazelbuild/bazel/issues/27582 - remove once XLS is on Bazel 8.5+.
single_version_override(
module_name = "rules_cc",
version = "0.2.11",
)
bazel_dep(name = "rules_closure", version = "0.15.0")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "verible", version = "0.0.3933")
# pprof is not in BCR.
pprof_ext = use_extension("//dependency_support/pprof:extension.bzl", "pprof_extension")
use_repo(pprof_ext, "pprof")
# Used by XLS[cc]
ac_types_ext = use_extension("//dependency_support/com_github_hlslibs_ac_types:extension.bzl", "ac_types_extension")
use_repo(ac_types_ext, "ac_datatypes")
z3_ext = use_extension("//dependency_support/z3:extension.bzl", "z3_extension")
use_repo(z3_ext, "z3")
# zstd is in BCR, but does not currently expose decodecorpus
zstd_ext = use_extension("//dependency_support/com_github_facebook_zstd:extension.bzl", "zstd_extension")
use_repo(zstd_ext, "zstd")
# TODO: bazelbuild/bazel-central-registry#1020 - revisit when perfetto is in BCR.
perfetto_ext = use_extension("//dependency_support/perfetto:extension.bzl", "perfetto_extension")
use_repo(perfetto_ext, "perfetto")
use_repo(perfetto_ext, "perfetto_cfg")
# Perfetto requires this to get through bazel analysis, but seems unused for our use.
bazel_dep(name = "rules_android", version = "0.6.0")
# Pin this as otherwise we encounter some bazel analysis failure.
bazel_dep(name = "rules_jvm_external", version = "6.8")
# Pinning some maven versions seems necessary to make things resolve correctly.
# As of 2025-11-07, this seems necessary. If unspecified, junit and mockito have
# some issue with being a testonly dep of a non-test target. I (rigge@) would
# have thought marking them both as an exclusion (like mockito below) would
# solve this, but somehow it didn't for junit. Specifying a specific version of
# junit seems to make things work.
# TODO: bazelbuild/bazel-central-registry#1020 - revisit when perfetto is in BCR.
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = ["junit:junit:4.13.2"],
known_contributing_modules = [
"bazel_worker_java",
"grpc-java",
"or-tools",
"rules_closure",
"rules_web_testing_java",
"xls",
],
)
maven.artifact(
artifact = "closure-stylesheets",
exclusions = ["org.mockito:mockito-core"],
group = "com.google.closure-stylesheets",
version = "1.5.0",
)
# Used both by XLS and rules_hdl.
bazel_dep(name = "eigen", version = "4.0.0-20241125.bcr.2")
bazel_dep(name = "rules_pkg", version = "1.2.0")
# Workaround suggested by a Bazel team member; only needed for WORKSPACE to work correctly.
# TODO: https://github.com/google/xls/issues/931 - Remove this workaround once the WORKSPACE file is migrated to MODULE.bazel.
proto_bazel_features = use_repo_rule("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")
proto_bazel_features(name = "proto_bazel_features")
# rules_hdl deps with bzlmod support.
bazel_dep(name = "rules_bison", version = "0.3")
bazel_dep(name = "rules_flex", version = "0.3")
bazel_dep(name = "rules_m4", version = "0.3")
bazel_dep(name = "swig", version = "4.3.0")
# TODO: rigge - Remove this override once the patch is in the main repo.
single_version_override(
module_name = "swig",
patch_strip = 1,
patches = ["//dependency_support/rules_hdl:swig_bzlmod.patch"],
)
# Dev dependencies
bazel_dep(name = "fuzztest", version = "20260219.0", dev_dependency = True, repo_name = "com_google_fuzztest")
bazel_dep(name = "google_benchmark", version = "1.9.5", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.17.0", dev_dependency = True)
# compilation DB; build_cleaner
bazel_dep(name = "bant", version = "0.2.4", dev_dependency = True)
# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
# Updated 2025/08/19.
commit = "abb61a688167623088f8768cc9264798df6a9d10",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)
register_toolchains("//xls/common/toolchains:all")