about summary refs log tree commit diff
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2024-10-27 08:38:20 +0300
committeronur-ozkan <work@onurozkan.dev>2024-10-27 08:38:20 +0300
commita8261333e12bb64a4f2071a0c320d583b9f083da (patch)
treeb9cf2c9772ead8bf1b6db9409164f13ec5875be7
parentf7cf41c97350f972d7281c20ed2d0c3744329023 (diff)
downloadrust-a8261333e12bb64a4f2071a0c320d583b9f083da.tar.gz
rust-a8261333e12bb64a4f2071a0c320d583b9f083da.zip
don't use absolute paths on `git(Some(self.src))`
It will run at the project root, so resolving absolute/top-level paths
is unnecessary.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs2
-rw-r--r--src/bootstrap/src/core/config/config.rs9
-rw-r--r--src/bootstrap/src/lib.rs2
3 files changed, 3 insertions, 10 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 27bbc8bd8ff..893fa9f79cb 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -135,7 +135,7 @@ impl Step for Std {
                 !t!(helpers::git(Some(&builder.src))
                     .args(["diff-index", "--quiet", &closest_merge_commit])
                     .arg("--")
-                    .arg(builder.src.join("library"))
+                    .arg("library")
                     .as_command_mut()
                     .status())
                 .success()
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 087dde0d9c6..139ca7eb52e 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -2871,14 +2871,7 @@ impl Config {
 
         // Warn if there were changes to the compiler or standard library since the ancestor commit.
         let mut git = helpers::git(Some(&self.src));
-        git.args(["diff-index", "--quiet", &commit, "--"]);
-
-        // Handle running from a directory other than the top level
-        let top_level = &self.src;
-
-        for path in modified_paths {
-            git.arg(top_level.join(path));
-        }
+        git.args(["diff-index", "--quiet", &commit, "--"]).args(modified_paths);
 
         let has_changes = !t!(git.as_command_mut().status()).success();
         if has_changes {
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index a9db0377a50..ba74cabcd30 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -541,7 +541,7 @@ impl Build {
         }
         let output = helpers::git(Some(&self.src))
             .args(["config", "--file"])
-            .arg(self.config.src.join(".gitmodules"))
+            .arg(".gitmodules")
             .args(["--get-regexp", "path"])
             .run_capture(self)
             .stdout();