Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
168 lines (154 loc) · 6.8 KB
/
Copy pathMODULE.bazel
File metadata and controls
168 lines (154 loc) · 6.8 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
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 = "rules_python", version = "2.4.2")
bazel_dep(name = "rules_rust", version = "0.74.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",
],
patch_strip = 1,
)
bazel_dep(name = "aspect_rules_js", version = "3.5.1")
bazel_dep(name = "rules_nodejs", version = "6.7.6")
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 = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
# Cargo's dev profile compiles every crate at opt-level 1 and release at
# 3; generated targets and the .bazelrc block refine per crate from the
# perf profile.
opt_level = {
"dbg": "0",
"fastbuild": "1",
"opt": "3",
},
versions = ["nightly/2026-10-18"],
rustfmt_version = "nightly/2026-10-18",
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
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_lockfile = "//:Cargo.lock",
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",
)
# 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",
)
# One long poll must not delay the rest of the runtime. Two upstream fixes:
# Dicklesworthstone/asupersync#83, a reactor leader that leaves epoll to run a
# task promotes no parked follower, so the poll delays every socket wake and
# shared timer; Dicklesworthstone/asupersync#84, a task woken by the executing
# task waits in that worker's unstealable LIFO slot for the whole poll while
# other workers idle. One patch file holds both because crate_universe applies
# an annotation's patches in sorted label order. Delete this annotation and the
# patch once the pinned or published asupersync contains both fixes.
# The blocking-pool stack patch touches other files, so its order does not
# matter: it gives pool threads the runtime's thread_stack_size (16 MiB in the
# CLI) instead of the standard library's 2 MiB.
crate.annotation(
crate = "asupersync",
patch_args = ["-p1"],
patches = [
"//scripts:bazel/patches/asupersync-blocking-pool-stack.patch",
"//scripts:bazel/patches/asupersync-scheduler.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.14.0")
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",
],
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")