Skip to content

Commit 591df6c

Browse files
committed
disable caching for cargo commands
1 parent 0eab328 commit 591df6c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ impl Cargo {
131131
}
132132

133133
pub fn into_cmd(self) -> BootstrapCommand {
134-
self.into()
134+
let mut cmd: BootstrapCommand = self.into();
135+
// Disable caching for commands originating from Cargo-related operations.
136+
cmd.do_not_cache();
137+
cmd
135138
}
136139

137140
/// Same as [`Cargo::new`] except this one doesn't configure the linker with

src/bootstrap/src/utils/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ impl ExecutionContext {
544544
let created_at = command.get_created_location();
545545
let executed_at = std::panic::Location::caller();
546546

547-
if self.dry_run() && !command.run_always {
547+
if self.dry_run() && !command.run_in_dry_run {
548548
return DeferredCommand {
549549
state: CommandState::Deferred {
550550
process: None,
@@ -635,7 +635,7 @@ impl<'a> DeferredCommand<'a> {
635635
let output =
636636
Self::finish_process(process, command, stdout, stderr, executed_at, exec_ctx);
637637

638-
if (!exec_ctx.dry_run() || command.run_always)
638+
if (!exec_ctx.dry_run() || command.run_in_dry_run)
639639
&& let (Some(cache_key), Some(_)) = (&cache_key, output.status())
640640
{
641641
exec_ctx.command_cache.insert(cache_key.clone(), output.clone());

0 commit comments

Comments
 (0)