Skip to content

Commit cf6a2c5

Browse files
committed
add should_cmd conditions to execution context
1 parent 555a125 commit cf6a2c5

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
@@ -156,7 +156,8 @@ impl ExecutionContext {
156156
) -> CommandOutput {
157157
let cache_key = command.compute_cache_hash();
158158

159-
if self.cache_cmd()
159+
if command.should_cache()
160+
&& self.cache_cmd()
160161
&& let Some(cached_output) = self.command_cache.get(cache_key)
161162
{
162163
command.mark_as_executed();
@@ -169,7 +170,7 @@ impl ExecutionContext {
169170

170171
let output = self.start(command, stdout, stderr).wait_for_output(self);
171172

172-
if (!self.dry_run() || command.run_always) && self.cache_cmd() {
173+
if (!self.dry_run() || command.run_always) && self.cache_cmd() && command.should_cache() {
173174
self.command_cache.insert(cache_key, output.clone());
174175
}
175176

0 commit comments

Comments
 (0)