Skip to content

Commit 944a48d

Browse files
committed
Remove less of the sysroot build dir on recompilation
1 parent 88b5f57 commit 944a48d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

build_system/build_sysroot.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,10 @@ fn build_clif_sysroot_for_triple(
168168
let build_dir = Path::new("build_sysroot").join("target").join(triple).join(channel);
169169

170170
if !super::config::get_bool("keep_sysroot") {
171-
// Cleanup the target dir with the exception of build scripts and the incremental cache
172-
for dir in ["build", "deps", "examples", "native"] {
173-
if build_dir.join(dir).exists() {
174-
fs::remove_dir_all(build_dir.join(dir)).unwrap();
175-
}
171+
// Cleanup the deps dir, but keep build scripts and the incremental cache for faster
172+
// recompilation as they are not affected by changes in cg_clif.
173+
if build_dir.join("deps").exists() {
174+
fs::remove_dir_all(build_dir.join("deps")).unwrap();
176175
}
177176
}
178177

0 commit comments

Comments
 (0)