about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-16 13:45:28 +0200
committerGitHub <noreply@github.com>2025-04-16 13:45:28 +0200
commitf7b6f15298fb5d1dcff3574f21ba085300b8e418 (patch)
treea39bd03177ec3e4d333b2f98078b62be2192f3cf /src/tools
parent723ef24e278480495d9f9f786714feaa199c07b6 (diff)
parent89b4eba49cc15e0a4e53f7816473201d12be5f4f (diff)
Rollup merge of #139823 - WaffleLapkin:bootpaper, r=jieyouxu
Fix some bootstrap papercuts

... related to jj and my `./build` symlink setup[^1].

I'm not sure if these are good solutions, but they seem to work. See commits for a bit more info.

r? ``@jieyouxu``

[^1]: see #139804
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/compiletest/src/runtest.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 24fc2ddb741..eb298060b2e 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2378,12 +2378,19 @@ impl<'test> TestCx<'test> {
         // eg.
         // /home/user/rust/build/x86_64-unknown-linux-gnu/test/ui/<test_dir>/$name.$revision.$mode/
         normalize_path(&self.output_base_dir(), "$TEST_BUILD_DIR");
+        // Same as above, but with a canonicalized path.
+        // This is required because some tests print canonical paths inside test build directory,
+        // so if the build directory is a symlink, normalization doesn't help.
+        //
+        // NOTE: There are also tests which print the non-canonical name, so we need both this and
+        // the above normalizations.
+        normalize_path(&self.output_base_dir().canonicalize_utf8().unwrap(), "$TEST_BUILD_DIR");
         // eg. /home/user/rust/build
         normalize_path(&self.config.build_root, "$BUILD_DIR");
 
         if json {
             // escaped newlines in json strings should be readable
-            // in the stderr files. There's no point int being correct,
+            // in the stderr files. There's no point in being correct,
             // since only humans process the stderr files.
             // Thus we just turn escaped newlines back into newlines.
             normalized = normalized.replace("\\n", "\n");