-
Notifications
You must be signed in to change notification settings - Fork 13.4k
bootstrap: using a toolchain that includes 'rust-src', ./x check
leaves a dirty working tree, fails to build
#141991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Added some tracing and I see this:
"Creating Symlink" is a
and "StdLink::run stage0 case" is a
So we first symlink the git repo root into My guess is we probably don't want to create that symlink if patchdiff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 40247288e75..3729af3a2e5 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -1870,26 +1870,28 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
// so that any tools relying on `rust-src` also work for local builds,
// and also for translating the virtual `/rustc/$hash` back to the real
// directory (for running tests with `rust.remap-debuginfo = true`).
- let sysroot_lib_rustlib_src = sysroot.join("lib/rustlib/src");
- t!(fs::create_dir_all(&sysroot_lib_rustlib_src));
- let sysroot_lib_rustlib_src_rust = sysroot_lib_rustlib_src.join("rust");
- if let Err(e) = symlink_dir(&builder.config, &builder.src, &sysroot_lib_rustlib_src_rust) {
- eprintln!(
- "ERROR: creating symbolic link `{}` to `{}` failed with {}",
- sysroot_lib_rustlib_src_rust.display(),
- builder.src.display(),
- e,
- );
- if builder.config.rust_remap_debuginfo {
+ if compiler.stage != 0 {
+ let sysroot_lib_rustlib_src = sysroot.join("lib/rustlib/src");
+ t!(fs::create_dir_all(&sysroot_lib_rustlib_src));
+ let sysroot_lib_rustlib_src_rust = sysroot_lib_rustlib_src.join("rust");
+ if let Err(e) = symlink_dir(&builder.config, &builder.src, &sysroot_lib_rustlib_src_rust) {
eprintln!(
- "ERROR: some `tests/ui` tests will fail when lacking `{}`",
+ "ERROR: creating symbolic link `{}` to `{}` failed with {}",
sysroot_lib_rustlib_src_rust.display(),
+ builder.src.display(),
+ e,
);
+ if builder.config.rust_remap_debuginfo {
+ eprintln!(
+ "ERROR: some `tests/ui` tests will fail when lacking `{}`",
+ sysroot_lib_rustlib_src_rust.display(),
+ );
+ }
+ build_helper::exit!(1);
}
- build_helper::exit!(1);
} |
That seems to make sense. Would you mind sending a PR? |
In StdLink::run we subsequently recursively copy the initial sysroot lib directory into the stage0-sysroot lib directory. If the initial sysroot is a toolchain that includes the `rust-src` component (in lib/rustlib/src/rust), if we add this symlink, that recursive copy we will overwrite the repo sources with the toolchain's sources. Fixes rust-lang#141991
Rollup merge of #142000 - lambdageek:no-symlink-stage0, r=onur-ozkan bootstrap: don't symlink source dir into stage0 sysroot In StdLink::run we subsequently recursively copy the initial sysroot lib directory into the stage0-sysroot lib directory. If the initial sysroot is a toolchain that includes the `rust-src` component (in lib/rustlib/src/rust), if we add this symlink, that recursive copy will overwrite the repo sources with the toolchain's sources. Fixes #141991
bootstrap: don't symlink source dir into stage0 sysroot In StdLink::run we subsequently recursively copy the initial sysroot lib directory into the stage0-sysroot lib directory. If the initial sysroot is a toolchain that includes the `rust-src` component (in lib/rustlib/src/rust), if we add this symlink, that recursive copy will overwrite the repo sources with the toolchain's sources. Fixes rust-lang/rust#141991
Uh oh!
There was an error while loading. Please reload this page.
Summary
When building a recent nightly (after #119899) using a beta toolchain that includes the
rust-src
component,./x check
leaves a dirty tree (git status
shows lots of modified files) and the check build fails.Command used
Expected behaviour
./x check
succeeds andgit status
shows a clean working treeActual behaviour
./x check
fails. The exact failure differs based on platform and configure options, but this is one example:And
git status
shows many modified filesBootstrap configuration (bootstrap.toml)
Operating system
Observed on: Debian trixie (amd64), also macOS 15.5 (arm64)
HEAD
5d707b0
Additional context
At work we try to build nightlies using our in-house custom beta toolchain which includes a number of components (including 'rust-src') by default.
Build Log
log.txt
The text was updated successfully, but these errors were encountered: