chore(bazel): bump rules_rust to bazelbuild/rules_rust@5f04c8c1 - #10900
Merged
Conversation
Move the rules_rust archive_override from the 0.71.3 release tarball to a codeload snapshot of the latest commit on the default branch (bazelbuild/rules_rust@5f04c8c), matching the codeload archive_override pattern already used for other bazel modules in this repo (e.g. rules_motoko, rules_foreign_cc). Drop bazel/rules_rust_dep_env.patch: the DEP_* env var redaction bug it worked around was fixed upstream by bazelbuild/rules_rust#4124, which is included as of the new pinned commit. Keep bazel/rules_rust_strip_level.patch: it still applies cleanly and the underlying limitation (bazelbuild/rules_rust#3730 - the `rust.toolchain` tag's flat strip_level string_dict cannot express per-compilation-mode strip levels) is still present upstream. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WYQSaxC3QcWKWQi7rDHe27
This reverts commit ba6cb00.
…ust bump The rules_rust bump changes CARGO_MANIFEST_DIR to point at the output tree for crates with generated inputs. pocket_ic_server previously supplied templates/dashboard.html only via the cargo_build_script's data attribute, which is not staged into the output tree, so askama's derive macro could no longer find the template. Add it to the library's compile_data so transform_sources stages it into bin/rs/pocket_ic_server/templates/dashboard.html where the new CARGO_MANIFEST_DIR points, matching the canonical pattern used by every other askama crate in the repo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WYQSaxC3QcWKWQi7rDHe27
nmattia
marked this pull request as ready for review
July 27, 2026 09:31
nmattia
approved these changes
Jul 27, 2026
nmattia
enabled auto-merge
July 27, 2026 09:31
mraszyk
approved these changes
Jul 27, 2026
pietrodimarco-dfinity
added a commit
to dfinity/dre
that referenced
this pull request
Jul 27, 2026
The commit annotator runs `bazel query` against the IC repo. IC commit
3622b58e ("chore(bazel): bump rules_rust to bazelbuild/rules_rust@5f04c8c1",
dfinity/ic#10900) switched the rules_rust archive_override from the
official 0.71.3 release tarball to a raw source archive of an upstream
git commit. Release tarballs let crate_universe use a prebuilt
cargo-bazel binary; a git source archive has none, so rules_rust falls
back to the cargo_bazel_bootstrap repo rule and compiles cargo-bazel
from source with cargo. Cargo defaults to `cc` as its linker driver, so
the query started failing with:
error: linker `cc` not found
error: could not compile `serde` (build script)
leaving the annotator in a permanent retry loop and blocking release
notes generation.
`build-essential` and gcc are installed in the image, but /usr/bin/cc
and /usr/bin/c++ are update-alternatives symlinks created by the gcc
and g++ postinst scripts. rules_distroless only unpacks each .deb's
data archive and never runs maintainer scripts, so neither symlink has
ever existed -- it just was not exercised until `bazel query` had to
compile something. Add them explicitly, mirroring the existing
clang-symlinks workaround for the same root cause.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Nicolas Mattia · Slack thread
What
Upgrades the
rules_rustBazel module pin inbazel/rust.MODULE.bazelfrom the0.71.3release tarball to acodeload.github.comsnapshot of the latest commit onbazelbuild/rules_rust's default branch, matching thearchive_override+ codeload pattern already used for other Bazel modules in this repo (e.g.rules_motoko,rules_foreign_ccin the rootMODULE.bazel).https://github.com/bazelbuild/rules_rust/releases/download/0.71.3/rules_rust-0.71.3.tar.gz(release 0.71.3)https://codeload.github.com/bazelbuild/rules_rust/tar.gz/5f04c8c14c2ffacfe10ad14e55298be21454be04(commit5f04c8c1, latest onmainas of 2026-07-24: "Addcargo_build_script.use_cc_toolchain(refactor(nns): Make Governance environment parameters compatible with timer usages #4161)")strip_prefixupdated torules_rust-5f04c8c14c2ffacfe10ad14e55298be21454be04and theintegrityhash recomputed for the new tarball (sha256 of the codeload archive fetched from an unrestricted network, converted to thesha256-<base64>SRI form to match the field format already used by this override).Patches
bazel/rules_rust_dep_env.patch: this worked aroundDEP_*cross-crate env vars being redacted to an unresolved${out_dir}token in build-script dep-env files (e.g.libssh2-sysfailing to findzlib.hvialibz-sys'sDEP_Z_INCLUDE). This is now fixed upstream by Fix unresolved${out_dir}token in dep env files bazelbuild/rules_rust#4124 ("Fix unresolved${out_dir}token in dep env files"), which is included as of the new pinned commit — confirmed by diffingcargo/private/cargo_build_script_runner/lib.rsat the new commit against the patch: the upstream code now usesredact_exec_rootinstead of fullredact_pathsinoutputs_to_dep_env, matching the patch's intent, and even includes the same libssh2-sys/libz-sys regression test. The patch no longer applies (git apply --checkfails cleanly against the new file content) and its reference was removed fromrust.MODULE.bazel.bazel/rules_rust_strip_level.patchunchanged: it configures per-compilation-mode strip levels, which the nativerust.toolchaintag's flatstrip_levelstring_dictstill cannot express (Cannot specify per-target strip_level in MODULE.bazel bazelbuild/rules_rust#3730 is still open upstream — traced the full call chain throughrust/extensions.bzl→rust/private/repositories.bzl→rust/private/toolchain.bzl's_rust_toolchain_impl, which still requires a per-compilation-mode dict at the rule level that the bzlmod extension tag cannot produce). Verified the patch still applies cleanly (git apply --check, 3-line offset, no fuzz) againstrust/extensions.bzlfetched at the new target commit.rules_rustin this repo.MODULE.bazel.lockfile exists in this repo, so there is nothing to regenerate there.Validation
What I was able to run in my sandbox:
buildifier -mode=check bazel/rust.MODULE.bazel— clean, no reformatting needed (exit 0).buildifier -lint=warn bazel/rust.MODULE.bazel— only pre-existing warnings unrelated to this change (canonical-repository@@warnings elsewhere in the file, far from the diff).rust/extensions.bzl,cargo/private/cargo_build_script_runner/lib.rs) and rangit apply --checkagainst them locally, as described above.sha256/integrityvalue was computed from a real fetch of the codeload tarball for the target commit, done outside my sandbox (my sandbox's network egress blockscodeload.github.comfor any repo other thandfinity/ic), then converted to SRI format and round-tripped back to hex to confirm the conversion was correct.What I could not run in my sandbox, and why:
bazel build/bazel test/bazel fetchfor this change specifically: my sandbox's network egress blocks (a)codeload.github.comtarball fetches for non-dfinityrepos, (b) theghcr.io/pkg-containers.githubusercontent.comblob storage needed to pull the pinnedic-devdev-container image, and (c)releases.bazel.buildbinary downloads needed to get a matching Bazel 9.2.0 outside the container. All three are independent, hard network-egress restrictions in that environment, not fixable from within it.Given that, this PR's actual build/test signal will need to come from CI once it runs here. Please treat a green CI run (in particular anything that exercises
@rules_rusttoolchains/cargo_build_script) as the real confirmation that the new pin, hash, and patch set are correct before merging this out of draft.Testing
bazel/rules_rust_dep_env.patchGenerated by Claude Code