Skip to content

Commit ea7f582

Browse files
committed
Use -Zbuild-dir-new-layout
This will become the default soon.
1 parent 035bf6e commit ea7f582

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

build_system/build_sysroot.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ fn build_clif_sysroot_for_triple(
206206

207207
apply_patches(dirs, "stdlib", &sysroot_src_orig, &STDLIB_SRC.to_path(dirs));
208208

209-
// Cleanup the deps dir, but keep build scripts and the incremental cache for faster
210-
// recompilation as they are not affected by changes in cg_clif.
211-
ensure_empty_dir(&build_dir.join("deps"));
209+
// Cleanup the build dir, but keep the incremental cache for faster
210+
// recompilation as it is not affected by changes in cg_clif.
211+
ensure_empty_dir(&build_dir.join("build"));
212212
}
213213

214214
// Build sysroot
@@ -241,6 +241,7 @@ fn build_clif_sysroot_for_triple(
241241
build_cmd.arg("--features").arg("backtrace panic-unwind");
242242
build_cmd.arg(format!("-Zroot-dir={}", STDLIB_SRC.to_path(dirs).display()));
243243
build_cmd.arg("-Zno-embed-metadata");
244+
build_cmd.arg("-Zbuild-dir-new-layout");
244245
build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
245246
build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
246247
if compiler.triple.contains("apple") {
@@ -252,7 +253,13 @@ fn build_clif_sysroot_for_triple(
252253
}
253254
spawn_and_wait(build_cmd);
254255

255-
for entry in fs::read_dir(build_dir.join("deps")).unwrap() {
256+
for entry in fs::read_dir(build_dir.join("build"))
257+
.unwrap()
258+
.flat_map(|entry| entry.unwrap().path().read_dir().unwrap())
259+
.map(|entry| entry.unwrap().path().join("out"))
260+
.filter(|entry| entry.exists())
261+
.flat_map(|entry| entry.read_dir().unwrap())
262+
{
256263
let entry = entry.unwrap();
257264
if let Some(ext) = entry.path().extension() {
258265
if ext == "d" || ext == "dSYM" || ext == "clif" {

0 commit comments

Comments
 (0)