@@ -7,92 +7,11 @@ module(
77)
88
99bazel_dep (name = "platforms" , version = "1.1.0" )
10- bazel_dep (name = "rules_rust" , version = "0.71.3" )
11- bazel_dep (name = "hermetic_cc_toolchain" , version = "4.1.0" )
10+ bazel_dep (name = "rules_cc" , version = "0.2.17" )
1211
13- rust = use_extension ("@rules_rust//rust:extensions.bzl" , "rust" )
12+ # The rest of the build config lives in bazel/, split by concern.
13+ include ("//bazel:rust.MODULE.bazel" )
1414
15- rust .toolchain (
16- edition = "2024" ,
17- versions = ["1.95.0" ],
18- )
19-
20- # Musl toolchains for static release builds. Their @zig_sdk//libc:musl
21- # constraint keeps them dormant on the (constraint-less) host platform, so
22- # dev builds are unaffected.
23- rust .repository_set (
24- name = "rust_linux_amd64_musl" ,
25- exec_triple = "x86_64-unknown-linux-gnu" ,
26- target_triple = "x86_64-unknown-linux-musl" ,
27- versions = ["1.95.0" ],
28- extra_rustc_flags = ["-Clink-self-contained=no" ],
29- target_compatible_with = [
30- "@platforms//os:linux" ,
31- "@platforms//cpu:x86_64" ,
32- "@zig_sdk//libc:musl" ,
33- ],
34- )
35-
36- rust .repository_set (
37- name = "rust_linux_arm64_musl" ,
38- exec_triple = "x86_64-unknown-linux-gnu" ,
39- target_triple = "aarch64-unknown-linux-musl" ,
40- versions = ["1.95.0" ],
41- extra_rustc_flags = ["-Clink-self-contained=no" ],
42- target_compatible_with = [
43- "@platforms//os:linux" ,
44- "@platforms//cpu:aarch64" ,
45- "@zig_sdk//libc:musl" ,
46- ],
47- )
48-
49- # Experimental macOS cross-compilation (library crates only; linking needs
50- # Apple framework stubs that zig does not ship).
51- rust .repository_set (
52- name = "rust_darwin_arm64" ,
53- exec_triple = "x86_64-unknown-linux-gnu" ,
54- target_triple = "aarch64-apple-darwin" ,
55- versions = ["1.95.0" ],
56- target_compatible_with = [
57- "@platforms//os:macos" ,
58- "@platforms//cpu:aarch64" ,
59- ],
60- )
61-
62- use_repo (rust , "rust_toolchains" )
63-
64- # The musl hub entries must be registered before //:all — the gnu entries in
65- # the hub also match musl platforms (they declare no libc constraint), and
66- # Bazel picks the first compatible registration.
67- register_toolchains (
68- "@rust_toolchains//:rust_linux_amd64_musl__x86_64-unknown-linux-musl__stable" ,
69- "@rust_toolchains//:rust_linux_arm64_musl__aarch64-unknown-linux-musl__stable" ,
70- )
71-
72- register_toolchains ("@rust_toolchains//:all" )
73-
74- crate = use_extension ("@rules_rust//crate_universe:extensions.bzl" , "crate" )
75- crate .from_cargo (
76- name = "crates" ,
77- cargo_lockfile = "//:Cargo.lock" ,
78- manifests = [
79- "//:Cargo.toml" ,
80- ],
81- )
82- use_repo (crate , "crates" )
83-
84- hermetic_toolchain = use_extension ("@hermetic_cc_toolchain//toolchain:ext.bzl" , "toolchains" )
85- use_repo (hermetic_toolchain , "zig_sdk" )
86-
87- # Only match platforms carrying @zig_sdk//libc:musl — dormant for dev builds,
88- # which keep the autodetected host toolchain.
89- register_toolchains (
90- "@zig_sdk//libc_aware/toolchain:linux_amd64_musl" ,
91- "@zig_sdk//libc_aware/toolchain:linux_arm64_musl" ,
92- "@zig_sdk//toolchain:darwin_arm64" ,
93- )
15+ include ("//bazel:cc_toolchains.MODULE.bazel" )
9416
95- # Hermetic protoc for openshell-core's build script, injected via $PROTOC
96- # instead of the autotools build that protobuf-src does under cargo. Built
97- # from source in the exec configuration (one-time cost, then cached).
98- bazel_dep (name = "protobuf" , version = "33.4" )
17+ include ("//bazel:z3.MODULE.bazel" )
0 commit comments