Skip to content

Commit 9a68c9f

Browse files
committed
add should_cmd conditions to execution context
1 parent bf8c101 commit 9a68c9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bootstrap/src/utils/execution_context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ impl ExecutionContext {
148148
) -> CommandOutput {
149149
let cache_key = command.cache_key();
150150

151-
if let Some(cached_output) = self.command_cache.get(&cache_key) {
151+
if command.should_cache()
152+
&& let Some(cached_output) = self.command_cache.get(&cache_key) {
152153
command.mark_as_executed();
153154
if self.dry_run() && !command.run_always {
154155
return CommandOutput::default();
@@ -159,7 +160,7 @@ impl ExecutionContext {
159160

160161
let output = self.start(command, stdout, stderr).wait_for_output(self);
161162

162-
if !self.dry_run() || command.run_always {
163+
if !self.dry_run() || command.run_always && command.should_cache() {
163164
self.command_cache.insert(cache_key, output.clone());
164165
}
165166

0 commit comments

Comments
 (0)