-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathMODULE.bazel
More file actions
235 lines (210 loc) · 8.27 KB
/
MODULE.bazel
File metadata and controls
235 lines (210 loc) · 8.27 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
"Mull's build system"
module(
name = "mull",
version = "0.34.0",
)
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "aspect_bazel_lib", version = "2.15.3")
bazel_dep(name = "rules_multirun", version = "0.11.0")
bazel_dep(name = "rules_foreign_cc", version = "0.14.0")
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
bazel_dep(name = "rules_cc", version = "0.2.16")
bazel_dep(name = "rules_rust", version = "0.68.1")
bazel_dep(name = "sqlite3", version = "3.49.1")
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
bazel_dep(name = "googletest", version = "1.16.0")
bazel_dep(name = "rules_python", version = "1.3.0")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
commit = "abb61a688167623088f8768cc9264798df6a9d10",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)
TOOLCHAIN_VERSION = "23441797865"
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True)
llvm.toolchain(
llvm_version = "19.1.7",
sha256 = {
"darwin-aarch64": "fd68fc5abbb107283452bdd5fe0bc8fe88d1c699abb0baa3feec96aad3c4453d",
"linux-aarch64": "1c124b19d0ddc19c85bbefc5b1069cd380935da413bc9ccee4c89eeeef0009ee",
"linux-x86_64": "84fcfa346beb8ce59b98ea375af645bca546ed397bf68de6f51dd6fe8074e8d8",
},
stdlib = {
"linux-x86_64": "stdc++",
"linux-aarch64": "stdc++",
},
strip_prefix = {
"darwin-aarch64": "Darwin-aarch64.toolchain",
"linux-aarch64": "Linux-aarch64.toolchain",
"linux-x86_64": "Linux-x86_64.toolchain",
},
urls = {
"darwin-aarch64": [
"https://github.com/mull-project/toolchains/releases/download/%s/Darwin-aarch64.toolchain.tar.xz" % TOOLCHAIN_VERSION,
],
"linux-aarch64": [
"https://github.com/mull-project/toolchains/releases/download/%s/Linux-aarch64.toolchain.tar.xz" % TOOLCHAIN_VERSION,
],
"linux-x86_64": [
"https://github.com/mull-project/toolchains/releases/download/%s/Linux-x86_64.toolchain.tar.xz" % TOOLCHAIN_VERSION,
],
},
)
use_repo(llvm, "llvm_toolchain")
register_toolchains("@llvm_toolchain//:all")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
use_repo(python, "python_3_13")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_darwin = "requirements_lock_macos.txt",
requirements_linux = "requirements_lock_linux.txt",
)
use_repo(pip, "pypi")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
sha256s = {
"rustc-1.94.0-aarch64-apple-darwin.tar.xz": "6ba00a4f486af11826335cd7fe405592d959f50afb9489176fc1463cbe75dbf2",
"clippy-1.94.0-aarch64-apple-darwin.tar.xz": "42a683cbac0b81b96ad3b887cdade36a57ef3a131c203583ca7e3ce0be98f415",
"cargo-1.94.0-aarch64-apple-darwin.tar.xz": "7497ab873993cf38b806548c85bf818ffd71d1c3cf77b5bb4c3d3f1769588a08",
"llvm-tools-1.94.0-aarch64-apple-darwin.tar.xz": "3e1e4bf19fc4e6a84221e0fc04e69cccbd659dd49042d58f7e37dbd7d9410e90",
"rust-std-1.94.0-aarch64-apple-darwin.tar.xz": "d3293668128b0a7838ef2544ae341eadd4437460ca22098af723349885a10ba2",
"rustc-1.94.0-x86_64-unknown-linux-gnu.tar.xz": "31a0d3ac9383dfdeb4fce86eeed5ade3230131c635264c0eab7252dbf235f28e",
"clippy-1.94.0-x86_64-unknown-linux-gnu.tar.xz": "935529b0b9150084fa9cc1734c6598efe86b6e7d76f31ad3f8d4bb79ebf6031a",
"cargo-1.94.0-x86_64-unknown-linux-gnu.tar.xz": "8e17624f3de39e079845bfb25ed15a042f4b50ceca78e37c56c4b9b15949b9f7",
"llvm-tools-1.94.0-x86_64-unknown-linux-gnu.tar.xz": "cf6b8e1d3e48ffa4db37aa59f55382b991f0d347d9b62eebc9ef1d80dffabef4",
"rust-std-1.94.0-x86_64-unknown-linux-gnu.tar.xz": "dd33653107c36e040082050d9e547e64dac5b456ba74069430d838c00c189a05",
"rustc-1.94.0-aarch64-unknown-linux-gnu.tar.xz": "7261b2fcdb88aef8b21f4b9f915d9a75c959674193f5b38e13fab4569684fc5b",
"clippy-1.94.0-aarch64-unknown-linux-gnu.tar.xz": "f7450c414e394450b53be602d37c374e2a2c5a2f51be2b54faf3d1e3272160b1",
"cargo-1.94.0-aarch64-unknown-linux-gnu.tar.xz": "d57ab7b23b52cba46e58c78327904d0c7db19892988677b0d59495c8af4bb790",
"llvm-tools-1.94.0-aarch64-unknown-linux-gnu.tar.xz": "d9780dbef8b58bf544b255785a420aec64378bc496adb770a628670a0f18171c",
"rust-std-1.94.0-aarch64-unknown-linux-gnu.tar.xz": "c781b3ef4fefa5508fbe05820eddc95e46351d905a30921cc020febd9c596a2e",
},
versions = ["1.94.0"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
name = "crates",
cargo_lockfile = "//rust:Cargo.lock",
manifests = ["//rust:Cargo.toml"],
)
crate.annotation(
additive_build_file_content = """
cc_library(
name = "cxx_cc",
srcs = ["src/cxx.cc"],
hdrs = ["include/cxx.h"],
strip_include_prefix = "include",
include_prefix = "rust",
copts = ["-fPIC"],
visibility = ["//visibility:public"],
)
""",
crate = "cxx",
)
use_repo(crate, "crates")
mull_supported_llvm_versions = use_extension("//:mull_supported_llvm_versions.bzl", "mull_supported_llvm_versions")
mull_supported_llvm_versions.configure(
os_version_mapping = {
"macos": [
"16",
"17",
"18",
"19",
"20",
# TODO: fmtlib fails to build with Clang 21 on macOS
# "21",
],
"ubuntu:22.04": [
"13",
"14",
"15",
],
"ubuntu:24.04": [
"14",
"15",
"16",
"17",
"18",
"19",
"20",
],
"ubuntu:26.04": [
"17",
"18",
"19",
"20",
"21",
"22",
],
"debian:13": [
"17",
"18",
"19",
],
"rhel:9.6": ["20"],
"rhel:10.0": ["20"],
},
)
use_repo(mull_supported_llvm_versions, "supported_llvm_versions")
mull_package_info = use_extension("//:mull_package_info.bzl", "mull_package_info")
use_repo(mull_package_info, "mull_package_info")
SUPPORTED_LLVM_VERSIONS = [
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
]
available_llvm_versions = use_extension("//:mull_available_llvm_versions.bzl", "available_llvm_versions")
available_llvm_versions.detect_available()
use_repo(available_llvm_versions, "available_llvm_versions")
mull_deps = use_extension(":mull_deps.bzl", "mull_deps")
mull_deps.configure(versions = SUPPORTED_LLVM_VERSIONS)
[use_repo(mull_deps, "mull_irm_%s" % v) for v in SUPPORTED_LLVM_VERSIONS]
[use_repo(mull_deps, "llvm_%s" % v) for v in SUPPORTED_LLVM_VERSIONS]
http_archive(
name = "bazel_itertools",
integrity = "sha256-br2KkRgBtrgmOjrl7Y3nK4cR/tkomEw++udDyw9FbOE=",
strip_prefix = "bazel-itertools-0.2.1",
url = "https://github.com/tillahoffmann/bazel-itertools/archive/refs/tags/0.2.1.tar.gz",
)
_ALL_CONTENT = """
filegroup(
name = "all_srcs",
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)
"""
http_archive(
name = "e2e_test_fmt",
build_file_content = _ALL_CONTENT,
integrity = "sha256-Ogg56lnV/aNDhZxLt3lAdx17XVQe47zhnIcQRArU/1M=",
patches = [
":third_party/fmt/install_test_targets.patch",
],
strip_prefix = "fmt-123913715afeb8a437e6388b4473fcc4753e1c9a",
url = "https://github.com/fmtlib/fmt/archive/123913715afeb8a437e6388b4473fcc4753e1c9a.zip",
)
find_rpmbuild = use_extension("@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild_bzlmod")
use_repo(find_rpmbuild, "rules_pkg_rpmbuild")
register_toolchains("@rules_pkg_rpmbuild//:all")
toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
toolchains.jq()
use_repo(toolchains, "jq")