File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ impl<'a> BootstrapCommand {
101
101
self . should_cache
102
102
}
103
103
104
+ pub fn cache_never ( & mut self ) -> & mut Self {
105
+ self . should_cache = false ;
106
+ self
107
+ }
108
+
104
109
pub fn args < I , S > ( & mut self , args : I ) -> & mut Self
105
110
where
106
111
I : IntoIterator < Item = S > ,
@@ -203,10 +208,11 @@ impl<'a> BootstrapCommand {
203
208
/// Provides access to the stdlib Command inside.
204
209
/// FIXME: This function should be eventually removed from bootstrap.
205
210
pub fn as_command_mut ( & mut self ) -> & mut Command {
206
- // We don't know what will happen with the returned command, so we need to mark this
207
- // command as executed proactively.
211
+ // We proactively mark this command as executed since we can't be certain how the returned
212
+ // command will be handled. Caching must also be avoided here, as the inner command could be
213
+ // modified externally without us being aware.
208
214
self . mark_as_executed ( ) ;
209
- self . should_cache = false ;
215
+ self . cache_never ( ) ;
210
216
& mut self . command
211
217
}
212
218
You can’t perform that action at this time.
0 commit comments