Use -Zbuild-dir-new-layout

This will become the default soon.
This commit is contained in:
bjorn3
2026-03-26 17:57:02 +01:00
parent 035bf6e39c
commit ea7f582d4e
+11 -4
View File
@@ -206,9 +206,9 @@ fn build_clif_sysroot_for_triple(
apply_patches(dirs, "stdlib", &sysroot_src_orig, &STDLIB_SRC.to_path(dirs));
// 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.
ensure_empty_dir(&build_dir.join("deps"));
// Cleanup the build dir, but keep the incremental cache for faster
// recompilation as it is not affected by changes in cg_clif.
ensure_empty_dir(&build_dir.join("build"));
}
// Build sysroot
@@ -241,6 +241,7 @@ fn build_clif_sysroot_for_triple(
build_cmd.arg("--features").arg("backtrace panic-unwind");
build_cmd.arg(format!("-Zroot-dir={}", STDLIB_SRC.to_path(dirs).display()));
build_cmd.arg("-Zno-embed-metadata");
build_cmd.arg("-Zbuild-dir-new-layout");
build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
if compiler.triple.contains("apple") {
@@ -252,7 +253,13 @@ fn build_clif_sysroot_for_triple(
}
spawn_and_wait(build_cmd);
for entry in fs::read_dir(build_dir.join("deps")).unwrap() {
for entry in fs::read_dir(build_dir.join("build"))
.unwrap()
.flat_map(|entry| entry.unwrap().path().read_dir().unwrap())
.map(|entry| entry.unwrap().path().join("out"))
.filter(|entry| entry.exists())
.flat_map(|entry| entry.read_dir().unwrap())
{
let entry = entry.unwrap();
if let Some(ext) = entry.path().extension() {
if ext == "d" || ext == "dSYM" || ext == "clif" {