diff options
| author | Urgau <urgau@numericable.fr> | 2024-09-28 21:44:44 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-09-28 21:44:44 +0200 |
| commit | 37ea27c741f3d04c23033b0c7ec343584b3e7502 (patch) | |
| tree | 36342ba423b80558b4de4854163085f73994f774 /src/tools/compiletest | |
| parent | 61ef9838dfb5045d00aa5563065a31210dab9460 (diff) | |
| download | rust-37ea27c741f3d04c23033b0c7ec343584b3e7502.tar.gz rust-37ea27c741f3d04c23033b0c7ec343584b3e7502.zip | |
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)
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 922492e451f..456528da21a 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2301,6 +2301,12 @@ impl<'test> TestCx<'test> { // eg. /home/user/rust/compiler normalize_path(&base_dir.join("compiler"), "$COMPILER_DIR"); + // Real paths into the libstd/libcore + let rust_src_dir = &self.config.sysroot_base.join("lib/rustlib/src/rust"); + rust_src_dir.try_exists().expect(&*format!("{} should exists", rust_src_dir.display())); + let rust_src_dir = rust_src_dir.read_link().unwrap_or(rust_src_dir.to_path_buf()); + normalize_path(&rust_src_dir.join("library"), "$SRC_DIR_REAL"); + // Paths into the build directory let test_build_dir = &self.config.build_base; let parent_build_dir = test_build_dir.parent().unwrap().parent().unwrap().parent().unwrap(); @@ -2310,12 +2316,6 @@ impl<'test> TestCx<'test> { // eg. /home/user/rust/build normalize_path(parent_build_dir, "$BUILD_DIR"); - // Real paths into the libstd/libcore - let rust_src_dir = &self.config.sysroot_base.join("lib/rustlib/src/rust"); - rust_src_dir.try_exists().expect(&*format!("{} should exists", rust_src_dir.display())); - let rust_src_dir = rust_src_dir.read_link().unwrap_or(rust_src_dir.to_path_buf()); - normalize_path(&rust_src_dir.join("library"), "$SRC_DIR_REAL"); - if json { // escaped newlines in json strings should be readable // in the stderr files. There's no point int being correct, |
