Skip to content

Migrate to rules_rs and llvm toolchains - #513

Draft
dzbarsky wants to merge 5 commits into
Tinder:masterfrom
dzbarsky:migrate-llvm-rules-rs
Draft

dzbarsky wants to merge 5 commits into
Tinder:masterfrom
dzbarsky:migrate-llvm-rules-rs

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Sep 29, 2026 •

Copy link
Copy Markdown

Replace direct rules_rust and toolchains_musl configuration with rules_rs and llvm. Resolve crates from Cargo.lock and use the built-in musl platforms for static Linux amd64 and arm64 releases. Remove the custom libc constraints, musl toolchain repositories, and cargo-bazel-lock.json; retain the Alpine stress workflows.

Keep all_crate_deps in src/BUILD and tests/BUILD with a five-line rules_rs patch distinguishing package_name = None from "". Document and test the same temporary override for consumers, because Bazel ignores dependency modules' overrides. A BCR release still requires a rules_rs release containing the fix.

Simplify .bazelrc, release checks, and workflow comments. Test Bazel 8.x and 9.x in the BCR matrices and document Bazel 8 or higher. LLVM 22.1.8 preserves Rust 1.90 coverage support. Windows MSVC/SDK license acceptance comes from repository variables; Windows builds remain unvalidated locally.

Validation: 13 native test targets, Rust coverage thresholds, Rust 1.85 build, cargo check --locked --tests, packed-archive consumer build with the temporary override, Bazel 9.2 analysis, and both Linux musl release cross-builds with static ELF checks.

-zbarskybot

Use rules_rs for Rust toolchains, Cargo.lock resolution, and Rust targets.
Use llvm for C/C++ toolchains and the built-in rules_rs musl platforms for
static Linux amd64 and arm64 releases. Remove custom musl repositories,
libc constraints, and cargo-bazel-lock.json.

Require Bazel 8.5 and pin LLVM 22.1.8 for Rust 1.90 coverage compatibility.
Preserve the Rust 1.85 check and Cargo's vendored-protoc default. Configure
Windows MSVC/SDK acceptance through repository variables.

Shorten build and workflow comments, simplify static ELF checks, and
remove the dedicated Alpine stress workflows.

Validation: 13 native test targets, Rust coverage thresholds, Rust 1.85
build, cargo check --locked --tests, Bazel 8.5 archive consumer build,
Bazel 9.2 analysis, and both Linux musl release cross-builds with static
ELF checks.
Distinguish None from the empty root package in the five generated rules_rs helpers. Restore Cargo dependency discovery for src and tests, retaining the build script dependency needed with Bazel-supplied protoc.

Document Bazel 8 or higher and the temporary root-module patch override required by consumers. Apply the same override in the consumer workflow.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant