Enable Cargo's new build-dir layout in boostrap#155439
Enable Cargo's new build-dir layout in boostrap#155439ranger-ross wants to merge 1 commit intorust-lang:mainfrom
Conversation
| let target_root_dir = stamp.path().parent().unwrap(); | ||
| // `target_deps_dir` looks like $dir/$target/release/deps | ||
| let target_deps_dir = target_root_dir.join("deps"); | ||
| // `target_deps_dir` looks like $dir/$target/release/build |
There was a problem hiding this comment.
| // `target_deps_dir` looks like $dir/$target/release/build | |
| // `target_build_dir` looks like $dir/$target/release/build |
| // got a list of prefix/extensions and we basically just need to find the | ||
| // most recent file in the `deps` folder corresponding to each one. | ||
| let contents = target_deps_dir | ||
| // most recent file in the `build` folder corresponding to each one. |
There was a problem hiding this comment.
Not yet read the code by myself. Just wonder why bootstrap are doing this? And if bootstrap needs to do it, it should be a feature in Cargo, at least a (perma-)unstable feature.
There was a problem hiding this comment.
See the commit block around line 2374. Basically we need the non-uplifted name that contains the unique hash. The artifact notifications provide the uplifted name where possible.
This comment has been minimized.
This comment has been minimized.
bf07fb8 to
eae2cbf
Compare
| // | ||
| // Cargo's build folder is structured as `build/<pkg>/<hash>/out/<artifacts>` so | ||
| // we need to traverse multiple directory layers to get to actual files. | ||
| let read_dir = |path: &Path| path.read_dir().ok().into_iter().flatten().filter_map(Result::ok); |
There was a problem hiding this comment.
checks failed because if there are any lingering files/dirs in <build-dir>/<target>/build that are not using the new layout it panics.
Update the original code to not panic if we call .read_dir() on a non-directory. Lets see if CI is happy with this
This PR enables the new Cargo
build-dirlayout in boostrap builds with-Zbuild-dir-new-layout.See: #t-infra/bootstrap > Has anyone tested `./x` with the new build-dir layout?
Tracked in: rust-lang/cargo#15010
r? @bjorn3
cc: @epage