Skip to content

Commit fec2e3a

Browse files
committed
compiletest: include stage0-sysroot libstd dylib in recipe dylib search path
To fix some of the failures in `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0`.
1 parent 12445e0 commit fec2e3a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/tools/compiletest/src/runtest/run_make.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ impl TestCx<'_> {
353353
// to work correctly.
354354
//
355355
// See <https://github.com/rust-lang/rust/pull/122248> for more background.
356+
let stage0_sysroot = build_root.join("stage0-sysroot");
356357
if std::env::var_os("COMPILETEST_FORCE_STAGE0").is_some() {
357-
let stage0_sysroot = build_root.join("stage0-sysroot");
358358
rustc.arg("--sysroot").arg(&stage0_sysroot);
359359
}
360360

@@ -373,6 +373,15 @@ impl TestCx<'_> {
373373
// Compute dynamic library search paths for recipes.
374374
let recipe_dylib_search_paths = {
375375
let mut paths = base_dylib_search_paths.clone();
376+
377+
// For stage 0, we need to explicitly include the stage0-sysroot libstd dylib.
378+
// See <https://github.com/rust-lang/rust/issues/135373>.
379+
if std::env::var_os("COMPILETEST_FORCE_STAGE0").is_some() {
380+
paths.push(
381+
stage0_sysroot.join("lib").join("rustlib").join(&self.config.host).join("lib"),
382+
);
383+
}
384+
376385
paths.push(support_lib_path.parent().unwrap().to_path_buf());
377386
paths.push(stage_std_path.join("rustlib").join(&self.config.host).join("lib"));
378387
paths

0 commit comments

Comments
 (0)