Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
211 lines (194 loc) · 8.49 KB
/
Copy pathMODULE.bazel
File metadata and controls
211 lines (194 loc) · 8.49 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
module(name = "tracedecay", version = "0.0.0")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "bazel_skylib", version = "1.9.2")
bazel_dep(name = "bazel_lib", version = "3.7.2")
bazel_dep(name = "rules_python", version = "2.4.6")
bazel_dep(name = "rules_rust", version = "0.75.0")
# Rustc adds every dependency search directory to PATH on Windows; large
# graphs exceed its environment limit (rust-lang/rust#110889). Native
# shared symlinks preserve artifact identities with one search directory.
# Build-script flags use response files to keep the compiler wrapper's own
# command line within Windows' separate CreateProcessW limit.
single_version_override(
module_name = "rules_rust",
patches = [
"//scripts:bazel/patches/rules-rust-windows-dependency-search.patch",
"//scripts:bazel/patches/rules-rust-windows-build-flags.patch",
"//scripts:bazel/patches/rules-rust-windows-file-url-path-deps.patch",
# Genrule tools must include Rustfmt's compiler runtime libraries.
"//scripts:bazel/patches/rules-rust-rustfmt-runtime-inputs.patch",
# No-link lint actions can use Rust metadata for executable targets.
"//scripts:bazel/patches/rules-rust-clippy-metadata-inputs.patch",
# Forward strip maps and execution flags to their target toolchains.
"//scripts:bazel/patches/rules-rust-toolchain-settings.patch",
# Keep Windows link and metadata outputs isolated between actions.
"//scripts:bazel/patches/rules-rust-windows-action-outputs.patch",
# Windows Clippy must not overwrite the compiler's sealed metadata.
"//scripts:bazel/patches/rules-rust-windows-clippy-metadata.patch",
],
patch_strip = 1,
)
bazel_dep(name = "aspect_rules_js", version = "3.5.2")
# Apply npm_import's directory traversal normalization to extraction actions
# too, before a remote worker uploads the package TreeArtifact.
single_version_override(
module_name = "aspect_rules_js",
patches = ["//scripts:bazel/patches/rules-js-extraction-directory-modes.patch"],
patch_strip = 1,
)
bazel_dep(name = "rules_nodejs", version = "6.7.7")
bazel_dep(name = "hermetic_cc_toolchain", version = "4.3.0")
# Selected only by rbe-linux: ship the compiler, headers, libc, and linker to
# Linux workers instead of depending on the client's /usr/bin toolchain.
zig = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains")
use_repo(zig, "zig_sdk")
RUST_VERSION = "1.99.1"
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
# Bazel's default fastbuild mirrors the assertion-enabled Cargo perf
# profile. Generated targets and the .bazelrc block refine its opt-level
# per crate; releases use opt-level 3.
opt_level = {
"dbg": "0",
"fastbuild": "1",
"opt": "3",
},
# fastbuild already emits no Rust debug information. Tell rules_rust not
# to declare a Windows PDB for each binary or copy it into the action cache.
# Explicit debug builds retain their symbols.
strip_level = {
"dbg": "none",
"fastbuild": "debuginfo",
"opt": "debuginfo",
},
versions = [RUST_VERSION],
rustfmt_version = RUST_VERSION,
rust_analyzer_version = RUST_VERSION,
)
use_repo(
rust,
"rust_toolchains",
rust_analyzer_tools = "rust_analyzer_" + RUST_VERSION + "_tools",
)
register_toolchains("@rust_toolchains//:all")
host = use_extension("@rules_rust//rust:extensions.bzl", "rust_host_tools")
host.host_tools(name = "cargo_host_tools", version = RUST_VERSION)
use_repo(host, "cargo_host_tools")
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
# One letter: Windows build-script paths repeat the hub's repository
# name, and MSVC cannot open headers past MAX_PATH (gen_builds.py).
name = "c",
cargo_config = "//:.cargo/acquisition.toml",
cargo_lockfile = "//:Cargo.lock",
host_tools = "@cargo_host_tools",
manifests = ["//:Cargo.toml"],
)
# rules_rust stages build scripts under a runfiles tree that spells the crate
# repository twice, and MSVC joins relative includes without normalizing them,
# so aws-lc's four-level `../` jitterentropy include overran MAX_PATH. The
# builder already puts the jitterentropy library on the include path.
crate.annotation(
crate = "aws-lc-sys",
patch_args = ["-p1"],
patches = ["//scripts:bazel/patches/aws-lc-sys-jitterentropy-include.patch"],
version = "0.46.0",
)
crate.annotation(
crate = "grafeo-core",
patch_args = ["-p1"],
patches = ["//scripts:bazel/patches/grafeo-core-read-allocation.patch"],
version = "0.5.43",
)
# arborium grammar build scripts read `env!("CARGO_MANIFEST_DIR")`, which bakes
# the compiling output base's absolute path into the build-script binary. The
# action key does not include that path, so the disk cache served one output
# base's binary to another and cc looked for parser.c under a dead output base.
# The patch reads the directory when the script runs instead.
crate.annotation(
crate = "arborium-kotlin",
patch_args = ["-p1"],
patches = ["//scripts:bazel/patches/arborium-grammar-runtime-manifest-dir.patch"],
version = "2.18.2",
)
crate.annotation(
crate = "arborium-lean",
patch_args = ["-p1"],
patches = ["//scripts:bazel/patches/arborium-grammar-runtime-manifest-dir.patch"],
version = "2.18.2",
)
# asupersync's blocking pool uses the runtime's thread_stack_size (16 MiB in
# the CLI) instead of the standard library's 2 MiB. The scheduler fixes this
# annotation used to carry (asupersync#83 and #84) are in the pinned revision.
# The default-HTTP-client patch type-erases the client slot in Cx so proving
# Send for a Cx-capturing future no longer walks rustls's types and overflows
# the trait solver (asupersync#86).
crate.annotation(
crate = "asupersync",
patch_args = ["-p1"],
patches = [
"//scripts:bazel/patches/asupersync-blocking-pool-stack.patch",
"//scripts:bazel/patches/asupersync-default-http-client-erasure.patch",
],
version = "0.6.0",
)
# .cargo/config.toml's [env] LIBSQLITE3_FLAGS, which Cargo hands every build
# script and Bazel does not: bundled SQLite's worker-thread cap and disabled
# memory status counters.
crate.annotation(
build_script_env = {
"LIBSQLITE3_FLAGS": "-DSQLITE_MAX_WORKER_THREADS=15 -DSQLITE_DEFAULT_MEMSTATUS=0",
},
crate = "libsqlite3-sys",
version = "0.38.2",
)
# BEGIN generated by scripts/bazel/gen_builds.py
# Cargo's target features for crates a build-dependency widens
# (TARGET_FEATURE_CRATES in scripts/bazel/gen_builds.py).
crate.annotation(
additive_build_file_content = """
load("@rules_rust//rust:defs.bzl", _target_rust_library = "rust_library")
_target_rust_library(
name = "serde_json_target",
srcs = glob(["**/*.rs"], allow_empty = True),
compile_data = glob(["**"], allow_empty = True, exclude = ["**/* *", ".tmp_git_root/**/*", "BUILD", "BUILD.bazel", "WORKSPACE", "WORKSPACE.bazel"]),
crate_features = ["alloc", "default", "float_roundtrip", "raw_value", "std"],
crate_name = "serde_json",
crate_root = "src/lib.rs",
edition = "2021",
rustc_flags = ["--cap-lints=allow"],
tags = ["cargo-bazel", "crate-name=serde_json", "manual", "noclippy", "norustfmt"],
version = "1.0.154",
deps = ["@c__itoa-1.0.18//:itoa", "@c__memchr-2.8.3//:memchr", "@c__serde_core-1.0.229//:serde_core", "@c__zmij-1.0.23//:zmij", "@c__serde_json-1.0.154//:build_script_build"],
)
""",
crate = "serde_json",
override_target_lib = "@c__serde_json-1.0.154//:serde_json_target",
version = "1.0.154",
)
use_repo(crate, "c__serde_json-1.0.154")
# END generated by scripts/bazel/gen_builds.py
use_repo(crate, "c")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "26.11.1")
use_repo(node, "nodejs")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(pnpm_version = "12.16.1")
use_repo(pnpm, "pnpm")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
data = [
"//:package.json",
"//:pnpm-workspace.yaml",
"//dashboard:package.json",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
# React Router imports React types from the shared npm store, outside
# dashboard/node_modules. Make that peer declaration resolvable there.
public_hoist_packages = {"@types/react": [""]},
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")