Skip to content

Commit 071b4bb

Browse files
Clean installed toolchains prior to task execution
Make sure to avoid cleaning out toolchains that we plan to use.
1 parent ba03080 commit 071b4bb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/runner/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ pub fn run_ex<DB: WriteResults + Sync>(
6464
let graph = Mutex::new(build_graph(ex, crates, config));
6565
let parked_threads = Condvar::new();
6666

67+
info!("uninstalling toolchains...");
68+
// Clean out all the toolchains currently installed. This minimizes the
69+
// amount of disk space used by the base system, letting the task execution
70+
// proceed slightly faster than it would otherwise.
71+
for tc in workspace.installed_toolchains()? {
72+
// But don't uninstall it if we're going to reinstall in a couple lines.
73+
if !ex.toolchains.iter().any(|t| tc == t.source) {
74+
tc.uninstall(workspace)?;
75+
}
76+
}
77+
6778
info!("preparing the execution...");
6879
for tc in &ex.toolchains {
6980
tc.install(workspace)?;

0 commit comments

Comments
 (0)