about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-28 15:20:29 +0100
committerGitHub <noreply@github.com>2022-01-28 15:20:29 +0100
commit6baf25eeb10a4e6d3f94035f3d4d82b7a1d77fc0 (patch)
tree3a86ad4131720fccabfd413ff0954a2a42f8d8a4
parent2b4ce0c539f7ae64c71d5135cca924867aa28d5e (diff)
parent38f59a3188f44f066105ce58661fd98fbe88e3f3 (diff)
downloadrust-6baf25eeb10a4e6d3f94035f3d4d82b7a1d77fc0.tar.gz
rust-6baf25eeb10a4e6d3f94035f3d4d82b7a1d77fc0.zip
Rollup merge of #93399 - ehuss:fix-compiletest-path-relative, r=Mark-Simulacrum
rustbuild: Fix compiletest warning when building outside of root.

This fixes a warning that would happen when passing arguments to compiletest (like `x.py test src/test/ui`) when running `x.py` outside of the root source directory. For example, the CI builders do this, which causes a confusing warning message. This also fixes it so that passing a full path works (like `x.py test src/test/ui/hello.rs`) in the same scenario (previously it would just ignore the `hello.rs` part).
-rw-r--r--src/bootstrap/util.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs
index ee58bedcc87..2c78ceb1e5b 100644
--- a/src/bootstrap/util.rs
+++ b/src/bootstrap/util.rs
@@ -282,9 +282,10 @@ pub fn is_valid_test_suite_arg<'a, P: AsRef<Path>>(
     if !path.starts_with(suite_path) {
         return None;
     }
-    let exists = path.is_dir() || path.is_file();
+    let abs_path = builder.src.join(path);
+    let exists = abs_path.is_dir() || abs_path.is_file();
     if !exists {
-        if let Some(p) = path.to_str() {
+        if let Some(p) = abs_path.to_str() {
             builder.info(&format!("Warning: Skipping \"{}\": not a regular file or directory", p));
         }
         return None;