Move cleanup of sysroot build into its own function
This commit is contained in:
parent
17abfa7041
commit
51d27a63b8
1 changed files with 6 additions and 2 deletions
|
|
@ -55,8 +55,7 @@ impl BuildArg {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Result<(), String> {
|
||||
let start_dir = Path::new("build_sysroot");
|
||||
fn cleanup_sysroot_previous_build(start_dir: &Path) {
|
||||
// Cleanup for previous run
|
||||
// Clean target dir except for build scripts and incremental cache
|
||||
let _ = walk_dir(
|
||||
|
|
@ -100,6 +99,11 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
|
|||
let _ = fs::remove_file(start_dir.join("Cargo.lock"));
|
||||
let _ = fs::remove_file(start_dir.join("test_target/Cargo.lock"));
|
||||
let _ = fs::remove_dir_all(start_dir.join("sysroot"));
|
||||
}
|
||||
|
||||
pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Result<(), String> {
|
||||
let start_dir = Path::new("build_sysroot");
|
||||
cleanup_sysroot_previous_build(&start_dir);
|
||||
|
||||
// Builds libs
|
||||
let mut rustflags = env.get("RUSTFLAGS").cloned().unwrap_or_default();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue