diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2023-06-05 21:54:52 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2023-06-05 21:54:52 +0200 |
| commit | c91a3a4d0cd178cbc30b87ba08ac9ee29083fa57 (patch) | |
| tree | 302ad39cceb2232de5b237f436d759693a5227d8 /src/bootstrap | |
| parent | 774a3d1523bde3a16f8a92dbaac01d211ba911c3 (diff) | |
| download | rust-c91a3a4d0cd178cbc30b87ba08ac9ee29083fa57.tar.gz rust-c91a3a4d0cd178cbc30b87ba08ac9ee29083fa57.zip | |
Test the PGO/BOLT/LTO optimized x64 Linux compiler on CI
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/lib.rs | 9 | ||||
| -rw-r--r-- | src/bootstrap/test.rs | 10 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index a1aaee68c62..eb121b110d6 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -222,6 +222,7 @@ pub struct Build { initial_cargo: PathBuf, initial_lld: PathBuf, initial_libdir: PathBuf, + initial_sysroot: PathBuf, // Runtime state filled in later on // C/C++ compilers and archiver for all targets @@ -389,13 +390,16 @@ impl Build { "/dummy".to_string() } else { output(Command::new(&config.initial_rustc).arg("--print").arg("sysroot")) - }; + } + .trim() + .to_string(); + let initial_libdir = initial_target_dir .parent() .unwrap() .parent() .unwrap() - .strip_prefix(initial_sysroot.trim()) + .strip_prefix(&initial_sysroot) .unwrap() .to_path_buf(); @@ -425,6 +429,7 @@ impl Build { initial_cargo: config.initial_cargo.clone(), initial_lld, initial_libdir, + initial_sysroot: initial_sysroot.into(), local_rebuild: config.local_rebuild, fail_fast: config.cmd.fail_fast(), doc_tests: config.cmd.doc_tests(), diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index eec8c4ad69f..35ba3dab764 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1424,7 +1424,15 @@ note: if you're sure you want to do this, please open an issue as to why. In the cmd.arg("--src-base").arg(builder.src.join("tests").join(suite)); cmd.arg("--build-base").arg(testdir(builder, compiler.host).join(suite)); - cmd.arg("--sysroot-base").arg(builder.sysroot(compiler)); + + // When top stage is 0, that means that we're testing an externally provided compiler. + // In that case we need to use its specific sysroot for tests to pass. + let sysroot = if builder.top_stage == 0 { + builder.initial_sysroot.clone() + } else { + builder.sysroot(compiler).to_path_buf() + }; + cmd.arg("--sysroot-base").arg(sysroot); cmd.arg("--stage-id").arg(stage_id); cmd.arg("--suite").arg(suite); cmd.arg("--mode").arg(mode); |
