Re-stabilize build-dir layout v2 - #17354
Conversation
be983b0 to
cb74501
Compare
There was a problem hiding this comment.
I think all tests should be passing now except profile_trim_paths::unremap_file_with_cargo_clean.
I believe the target/debug/foo.trim-paths.jsonl file was previously getting removed with cargo clean -p foo -Ztrim-paths, but is not getting removed when the new build-dir layout is enabled.
So its hitting this assert:
assert!(!unremap_file_path(&p.bin("foo")).exists());There was a problem hiding this comment.
What is the intended behavior here? Does cargo clean -p foo remove target/debug/foo on both old and new build layout?
There was a problem hiding this comment.
yeah, wasn't fully sure. So I left it failing for now.
If the trim paths artifacts is generated for crate foo and you clean the foo crate it seems reasonable to me to expect that file to be removed.
There was a problem hiding this comment.
Yeah I would expect that. The foo.trim-paths.jsonl is a companion file for the root binary unit, similar to pdb on Windows, dSYM on macOS, and dwp/dwo file on Linux.
There was a problem hiding this comment.
Blocked until at least August 14th to be after beta branch: https://forge.rust-lang.org/
|
Is there anything different in this stabilization PR compared to the previous one? |
It should be largely the same with the following differences:
|
This comment has been minimized.
This comment has been minimized.
…ut (rust-lang#17356) ### What does this PR try to resolve? See rust-lang#17354 (comment) for the motivating context. In rust-lang#17303 we started emitting unremap files to final artifacts. This included logic for cleaning the unremap file when running `cargo clean -p` but the logic was not added in the `.build_dir_new_layout` branch in the cargo clean logic. This PR adds the logic to both branches. ### How to test and review this PR? Primarily using the existing tests r? @weihanglo
59957dc to
ede4285
Compare
ede4285 to
efb0721
Compare
|
FYI, branch promotion is done. |
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
We have FCP already in #16807 (comment). I don't think we need a new one.
|
|
||
| Caused by: | ||
| process didn't exit successfully: `[ROOT]/foo/target/debug/build/foo-[HASH]/build-script-build1` ([EXIT_STATUS]: 101) | ||
| process didn't exit successfully: `[ROOT]/foo/target/debug/build/foo/[HASH]/out/build_script_build1` ([EXIT_STATUS]: 101) |
There was a problem hiding this comment.
I forgot why this executable name changed. Could you remind me?
There was a problem hiding this comment.
See #16812
The TL;DR is that the build_script_build.exe always existed, but we would "uplift" it to the same directory with the kebab cased name + -Cextra-filename. Since the hash is in the directory path, -Cextra-filename is not needed. So we were just renaming the script from snake to kebab case, which felt unnecessary so we removed that step to keep it simple.
Update cargo submodule 3 commits in 8a0d8afba810304bcf9a10bac430be80dd470233..36e1162a7989dd1d11b75bfa90283efcbf162cac 2026-08-15 01:32:53 +0000 to 2026-08-18 02:35:44 +0000 - Re-stabilize build-dir layout v2 (rust-lang/cargo#17354) - Enable `-Zembed-metadata=no` by default on nightly Cargo (rust-lang/cargo#17267) - fix(frontmatter): Don't panic on a short closing fence before a non-ASCII char (rust-lang/cargo#17274) r? ghost
Update cargo submodule 6 commits in 8a0d8afba810304bcf9a10bac430be80dd470233..514c56dd7321eecbfdcf9b6479519cf4edfab906 2026-08-15 01:32:53 +0000 to 2026-08-19 00:31:04 +0000 - fix(git): `git gc` with `safe.bareRepository=explicit` (rust-lang/cargo#17370) - test: make snapshots agnostic to `-Zembed-metadata=no` (rust-lang/cargo#17374) - fix(clean): Improving description for clean options (rust-lang/cargo#17365) - Re-stabilize build-dir layout v2 (rust-lang/cargo#17354) - Enable `-Zembed-metadata=no` by default on nightly Cargo (rust-lang/cargo#17267) - fix(frontmatter): Don't panic on a short closing fence before a non-ASCII char (rust-lang/cargo#17274)
Update cargo submodule 6 commits in 8a0d8afba810304bcf9a10bac430be80dd470233..514c56dd7321eecbfdcf9b6479519cf4edfab906 2026-08-15 01:32:53 +0000 to 2026-08-19 00:31:04 +0000 - fix(git): `git gc` with `safe.bareRepository=explicit` (rust-lang/cargo#17370) - test: make snapshots agnostic to `-Zembed-metadata=no` (rust-lang/cargo#17374) - fix(clean): Improving description for clean options (rust-lang/cargo#17365) - Re-stabilize build-dir layout v2 (rust-lang/cargo#17354) - Enable `-Zembed-metadata=no` by default on nightly Cargo (rust-lang/cargo#17267) - fix(frontmatter): Don't panic on a short closing fence before a non-ASCII char (rust-lang/cargo#17274)
Update cargo submodule 6 commits in 8a0d8afba810304bcf9a10bac430be80dd470233..514c56dd7321eecbfdcf9b6479519cf4edfab906 2026-08-15 01:32:53 +0000 to 2026-08-19 00:31:04 +0000 - fix(git): `git gc` with `safe.bareRepository=explicit` (rust-lang/cargo#17370) - test: make snapshots agnostic to `-Zembed-metadata=no` (rust-lang/cargo#17374) - fix(clean): Improving description for clean options (rust-lang/cargo#17365) - Re-stabilize build-dir layout v2 (rust-lang/cargo#17354) - Enable `-Zembed-metadata=no` by default on nightly Cargo (rust-lang/cargo#17267) - fix(frontmatter): Don't panic on a short closing fence before a non-ASCII char (rust-lang/cargo#17274)
What does this PR try to resolve?
This PR restabilizes the new build-dir layout tracked in #15010.
The previous stablization in #16807 was rolled back due to performance and scaling issues discovered on nightly.
These issues were mitigated in #17191, #17168, and #17236.
The new layout was re-enabled on nightly in #17258 and there has been no reported issues. Many tools have started migrating and the majority of well known tools have already added support for the new build-dir layout.
closes #15010
How to test and review this PR?
cargo testand the new layout has been enabled on nightly for ~2 weeks.