Skip to content

Commit 37ea27c

Browse files
committed
compiletest: normalize to $SRC_DIR_REAL before $TEST_BUILD_DIR
in case the real paths into the libstd/libcore are located inside the the build directory, maybe because it's coming from an extracted dist component in the build dir (cc opt-dist)
1 parent 61ef983 commit 37ea27c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/tools/compiletest/src/runtest.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,12 @@ impl<'test> TestCx<'test> {
23012301
// eg. /home/user/rust/compiler
23022302
normalize_path(&base_dir.join("compiler"), "$COMPILER_DIR");
23032303

2304+
// Real paths into the libstd/libcore
2305+
let rust_src_dir = &self.config.sysroot_base.join("lib/rustlib/src/rust");
2306+
rust_src_dir.try_exists().expect(&*format!("{} should exists", rust_src_dir.display()));
2307+
let rust_src_dir = rust_src_dir.read_link().unwrap_or(rust_src_dir.to_path_buf());
2308+
normalize_path(&rust_src_dir.join("library"), "$SRC_DIR_REAL");
2309+
23042310
// Paths into the build directory
23052311
let test_build_dir = &self.config.build_base;
23062312
let parent_build_dir = test_build_dir.parent().unwrap().parent().unwrap().parent().unwrap();
@@ -2310,12 +2316,6 @@ impl<'test> TestCx<'test> {
23102316
// eg. /home/user/rust/build
23112317
normalize_path(parent_build_dir, "$BUILD_DIR");
23122318

2313-
// Real paths into the libstd/libcore
2314-
let rust_src_dir = &self.config.sysroot_base.join("lib/rustlib/src/rust");
2315-
rust_src_dir.try_exists().expect(&*format!("{} should exists", rust_src_dir.display()));
2316-
let rust_src_dir = rust_src_dir.read_link().unwrap_or(rust_src_dir.to_path_buf());
2317-
normalize_path(&rust_src_dir.join("library"), "$SRC_DIR_REAL");
2318-
23192319
if json {
23202320
// escaped newlines in json strings should be readable
23212321
// in the stderr files. There's no point int being correct,

0 commit comments

Comments
 (0)