about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbit-aloo <sshourya17@gmail.com>2025-06-25 17:00:03 +0530
committerbit-aloo <sshourya17@gmail.com>2025-06-27 10:49:43 +0530
commit591df6c1b087c0a12eade854d0e9497c3f8f6d8b (patch)
tree47882d397e6d4ccdb8fb971524510f263815bd90 /src
parent0eab328414447f000d718bbca0c234bd49e28a6b (diff)
downloadrust-591df6c1b087c0a12eade854d0e9497c3f8f6d8b.tar.gz
rust-591df6c1b087c0a12eade854d0e9497c3f8f6d8b.zip
disable caching for cargo commands
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/builder/cargo.rs5
-rw-r--r--src/bootstrap/src/utils/exec.rs4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index a878291a33c..deb7106f185 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -131,7 +131,10 @@ impl Cargo {
     }
 
     pub fn into_cmd(self) -> BootstrapCommand {
-        self.into()
+        let mut cmd: BootstrapCommand = self.into();
+        // Disable caching for commands originating from Cargo-related operations.
+        cmd.do_not_cache();
+        cmd
     }
 
     /// Same as [`Cargo::new`] except this one doesn't configure the linker with
diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs
index 4c38f3a7cc8..d092765ef76 100644
--- a/src/bootstrap/src/utils/exec.rs
+++ b/src/bootstrap/src/utils/exec.rs
@@ -544,7 +544,7 @@ impl ExecutionContext {
         let created_at = command.get_created_location();
         let executed_at = std::panic::Location::caller();
 
-        if self.dry_run() && !command.run_always {
+        if self.dry_run() && !command.run_in_dry_run {
             return DeferredCommand {
                 state: CommandState::Deferred {
                     process: None,
@@ -635,7 +635,7 @@ impl<'a> DeferredCommand<'a> {
                 let output =
                     Self::finish_process(process, command, stdout, stderr, executed_at, exec_ctx);
 
-                if (!exec_ctx.dry_run() || command.run_always)
+                if (!exec_ctx.dry_run() || command.run_in_dry_run)
                     && let (Some(cache_key), Some(_)) = (&cache_key, output.status())
                 {
                     exec_ctx.command_cache.insert(cache_key.clone(), output.clone());