From 944a48d3afb0fa27390ecbd2ceb0f1c666cf4c5b Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 13 Feb 2022 18:46:53 +0100 Subject: [PATCH] Remove less of the sysroot build dir on recompilation --- build_system/build_sysroot.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build_system/build_sysroot.rs b/build_system/build_sysroot.rs index c9c003d4610..b301777e1e8 100644 --- a/build_system/build_sysroot.rs +++ b/build_system/build_sysroot.rs @@ -168,11 +168,10 @@ fn build_clif_sysroot_for_triple( let build_dir = Path::new("build_sysroot").join("target").join(triple).join(channel); if !super::config::get_bool("keep_sysroot") { - // Cleanup the target dir with the exception of build scripts and the incremental cache - for dir in ["build", "deps", "examples", "native"] { - if build_dir.join(dir).exists() { - fs::remove_dir_all(build_dir.join(dir)).unwrap(); - } + // Cleanup the deps dir, but keep build scripts and the incremental cache for faster + // recompilation as they are not affected by changes in cg_clif. + if build_dir.join("deps").exists() { + fs::remove_dir_all(build_dir.join("deps")).unwrap(); } }