Repository navigation
Address review feedback on the bzlmod migration - #25
Merged
Merged
Conversation
Four follow-ups from the review of #24: Make the hermetic-sandbox guard actually execute something. The spawn strategy is not part of an action's key, so the hermetic build that followed a default-sandbox build of the same targets was a pure cache hit -- 0 spawns -- and could not have caught an under-declared toolchain input. Fork the configuration with --platform_suffix=hermetic so the actions have distinct keys. In a fresh output base, in CI order, the hermetic step goes from 0 spawns to 4. Add a root .bazelignore for tests. Deleting tests/WORKSPACE removed the pruning that kept package loading out of the tests/ subtree, so bazel query/build/test '//...' at the repo root followed the bazel-tests convenience symlink into the output base and failed to load packages. Fix the archive_override instructions. archive_override has no sha256 attribute, and integrity will not accept a hex sha256sum -- it needs the SRI spelling. Document how to produce it. Make strip and objcopy work under the hermetic sandbox and remote execution. Unlike the ar/as wrappers, these never exported LD_LIBRARY_PATH, and Ubuntu's binutils need a libbfd that only exists inside the archives; the native toolchains additionally omitted host_libraries from strip_files/objcopy_files, so the library was not declared either. This was invisible because //:all never created a CcStrip action, so add a filegroup over the implicit .stripped outputs -- that pulls strip into every existing build step, plain and hermetic, in all three jobs. Verified on Bazel 7.7.1 and 9.2.0 across all four configs (native, aarch64, jetpack_512, jetpack_62), plain and hermetic. objcopy is fixed by symmetry with strip but stays unexercised: no cc action in the test package invokes it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
aredman-agtonomy
approved these changes
Sep 9, 2026
The verify step piped `bazel aquery --output=text` into `grep -qF` under `set -o pipefail`. The compiler path first appears ~1.8KB from the end of a ~290KB dump, because the huge `Inputs:` line precedes the command line, so grep matches and exits while bazel is still writing the tail. Bazel treats the short stdout write as fatal -- "Cannot write to standard output; exiting..." -- and exits 255, which pipefail then reports as a mis-selected toolchain even though grep matched. Whether bazel's final flush beats grep's exit is pure timing, so this failed only on a loaded runner and only for whichever check lost the race. Capture aquery to a file and grep that, which removes the pipe the race needs. The same snippet was triplicated across the three jobs -- both native jobs carried the identical bug and were only winning the race -- so it moves to tests/verify_toolchain.sh alongside verify_binary.sh, taking config/expected pairs. The captured output also serves the failure diagnostic, so a failing check no longer re-runs aquery to report what it found. Verified against the load that reproduced the failure 7/25 times: 0/25 with the fix, on both Bazel 7.7.1 and 9.2.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
aredman-agtonomy
approved these changes
Sep 9, 2026
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.
Four follow-ups from the review of #24:
Make the hermetic-sandbox guard actually execute something. The spawn strategy is not part of an action's key, so the hermetic build that followed a default-sandbox build of the same targets was a pure cache hit -- 0 spawns -- and could not have caught an under-declared toolchain input. Fork the configuration with --platform_suffix=hermetic so the actions have distinct keys. In a fresh output base, in CI order, the hermetic step goes from 0 spawns to 4.
Add a root .bazelignore for tests. Deleting tests/WORKSPACE removed the pruning that kept package loading out of the tests/ subtree, so bazel query/build/test '//...' at the repo root followed the bazel-tests convenience symlink into the output base and failed to load packages.
Fix the archive_override instructions. archive_override has no sha256 attribute, and integrity will not accept a hex sha256sum -- it needs the SRI spelling. Document how to produce it.
Make strip and objcopy work under the hermetic sandbox and remote execution. Unlike the ar/as wrappers, these never exported LD_LIBRARY_PATH, and Ubuntu's binutils need a libbfd that only exists inside the archives; the native toolchains additionally omitted host_libraries from strip_files/objcopy_files, so the library was not declared either. This was invisible because //:all never created a CcStrip action, so add a filegroup over the implicit .stripped outputs -- that pulls strip into every existing build step, plain and hermetic, in all three jobs.
Verified on Bazel 7.7.1 and 9.2.0 across all four configs (native, aarch64, jetpack_512, jetpack_62), plain and hermetic. objcopy is fixed by symmetry with strip but stays unexercised: no cc action in the test package invokes it.