Fix issues causing the Rustc
process wrapper to be built non-determ…
#2216
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.
This change aims to ensure the process wrapper is built determinisitically, thus reducing churn in cases where multiple developers share a bazel remote cache. The shared cache is notable as the binaries can be deterministically produced for a single user for a single checkout as some host information is embedded in the compiled binaries. The host information is stored in the
debug-info
section of the executable. This can be resolved by stripping it. The other issue of determinism isrust_binary_without_process_wrapper
does not resolve${pwd}
like the process wrapper does, thus stripping sandbox paths from rustc outputs. To solve for this a small bash and batch script was added to account for this behavior. The intent of these scripts is to use no host executables and instead rely on pure bash and batch to accomplish this and keep any actions which use this as hermetic as possible.The following tables were produced on macOS. Note that
rules_rust_2
is simply another checkout ofrules_rust
on the same commitBefore the changes in this PR:
After the changes:
closes #2092