Do not copy .rmeta files into the sysroot of the build compiler during check #144252
+189
−65
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.
Before, when bootstrap did a check build of rustc stage N (with a build compiler that was stage N-1), it automatically copied the resulting
.rmeta
artifacts into the sysroot of the stage N-1 build compiler, so that stage Nrustc_private
tools such asmiri
could be compiled using the stage N-1 build compiler. This has a number of issues:rustc_private
tools were actually built.check::Std
actually doesn't copy the artifacts anymore (which forces us to build std instead of just checking it in a bunch ofCheck
steps).Based on suggestions by @cuviper and @bjorn3, I tried to change how this behaves. Instead of copying the rmeta artifacts into the sysroot of the build compiler (from where they would be loaded implicitly), they are now stored in a separate transient bootstrap build directory, and they are then explicitly passed only when checking
rustc_private
tools using the-L
flag. The flags are passed out-of-band through our rustc wrapper, to avoid invalidating the build cache.Based on my local tests, this seemed to be working fine. If it works on CI, and we don't run into other issues after merging it, I'd like to do the same also for rlib artifacts generated during
x build
.Based on #143816 (only the last commit is new).
r? @jieyouxu