fix: remap bootstrap source paths in rustc - #53
Merged
Merged
Conversation
Bootstrap actions pass rustc flags through @params, but the C++ bootstrap process wrapper substitutes only direct arguments. The literal remap placeholders leave execution directories in tinyjson crate metadata. Use -Zremap-cwd-prefix for bootstrap compilation so rustc resolves its own working directory. Default RUSTC_BOOTSTRAP to the bootstrap crate's name, preserving explicit environment settings. Keep the existing response files and SDKROOT expansion without changing the C++ wrapper. Add a regression test that reads the actual bootstrap tinyjson archive. The test fails before the fix. Sandboxed and local builds in different output bases now produce identical archives without execution directories. Validation: Bazel 9.1.0, Rust 1.98.0, macOS arm64; bazel test //... passed 621 tests and skipped 37 platform-incompatible tests. Refs hermeticbuild/rules_rs#233 and #46. Co-authored-by: Codex <noreply@openai.com>
dzbarsky
force-pushed
the
codex/bootstrap-direct-remap-args
branch
from
September 5, 2026 18:57
77ca3ca to
241e184
Compare
This was referenced Sep 5, 2026
dzbarsky
added a commit
to hermeticbuild/rules_rs
that referenced
this pull request
Sep 5, 2026
Update the rules_rust pin to source release e9dd49f22cfa43c75ba30cd9d9bb7d8bdc459dde, including the bootstrap reproducibility fix in hermeticbuild/rules_rust#53. Update bundled Ubuntu Noble zlib1g to 1.3.dfsg-3.1ubuntu2.2 for amd64 and arm64, retaining immutable snapshot URLs at 20260901T000000Z. Select empty_allocator_libraries for target_triple_constraints_test. This test analyzes every target triple with an empty standard library and builds only a marker file; the new default allocator dependency otherwise requires a linker for these synthetic configurations. Validation: all 48 root tests and target_triple_constraints_test passed on macOS with Bazel 9.1.0. Verified the source archive SHA-256 and bootstrap fix. Downloaded both zlib packages, matched their hashes against Ubuntu's snapshot package index, and checked the expected shared-library files. Buildifier and git diff --check pass. Refs #243 and #233. All ten CI checks passed on Linux and Windows with Bazel 8 and 9. Co-authored-by: Codex <noreply@openai.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.
Bootstrap actions put rustc flags in
@params, butbootstrap_process_wrappersubstitutes only direct arguments. The literal remap placeholders leave execution directories in bootstraptinyjsonmetadata, even with debug information stripped. Use-Zremap-cwd-prefix=.for bootstrap compilation so rustc resolves its own working directory, defaultingRUSTC_BOOTSTRAPto the bootstrap crate's name and preserving explicit environment settings.Keep the existing bootstrap response files:
_spawnvpdoes not preserve embedded quotes in direct Windows arguments. The C++ wrapper and its macOSSDKROOTexpansion remain unchanged. This is an alternative to #46.Validation on macOS arm64 with Bazel 9.1.0 and Rust 1.98.0: the new test reads the actual bootstrap
tinyjsonarchive and fails before the fix. Sandboxed and local builds in different output bases now produce identical archives without execution-directory strings.bazel test //...: 621 passed, 37 skipped.Refs hermeticbuild/rules_rs#233.
-zbarskybot