You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also include anyone is following this issue and missed it, we put out a call of testing of the new v2 build-dir layout in a blog post here
See the blog post for details and testing instructions
cargo clean -p only cleans up files for the current layout rather than supporting both
Unresolved issues
Open questions
Transition plan: while build-dir isn't stable, enough tools rely on the layout that we'd want to setup a transition plan so they can have time to test against the new layout and work to support both
What do we call the directory? I said build/ as its all encompassing
Is the current handling of build scripts sufficient or should we explicitly split them into separate entries. We separated build script build and execution
In addition to reducing path length pressure on Windows, could allow sharing when build units have the same settings across profiles
<hash> is the -C extra-filename hash and doesn't encompass all of fingerprinting, so we'd need to audit if there are cases that don't change the hash that we'd still need per-profile
Changing of local source is one example, so at least local packages still need to be scoped by profile
Can we simplify how fingerprints are stored, reducing pressure on path lengths
If Windows filesystem perf issues crop up with <pkgname>/<hash>, we can go with prefixes to reduce the number of items within a directory. See bjorn3's comment.
if deps/ hasn't been a problem, this is unlikely to be a problem
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Original
note: I specify build-dir to clarify which half of #14125 I'm referring to. The files and layout of build-dir does not have compatibility guarantees (source).
Currently, build-dir is laid out like
target/
<target-platform>/?
<profile>/
incremental/
build/
<package>-<hash>/
build*script-*
deps/
<package>-<hash>*
Currently,
cargo clean -p <package> will operate on everything for <package>
View all comments
Call of Testing
Also include anyone is following this issue and missed it, we put out a call of testing of the new v2
build-dirlayout in a blog post hereSee the blog post for details and testing instructions
Implementation:
-Zbuild-dir-new-layoutunstable feature #15848Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-dir-new-layout
Resolves
panic = "abort"#16673)-Cextra-filename(Consider changing hashing behavior for executables. #8332)Past efforts
Overview
.fingerprint,deps/,build-script, andbuild-script-execution/move underbuild/<pkgname>/<unit-id>-Lparams torustcwere updatedcargo clean -pwas updatedincremental/is untouched-Cextra-filenameis removed from all bins (fix(layout): Remove hashes from bins in new layout #16351)Known issues
cargo -vvmore annoying, similar to Reduce--verboseoutput of--check-cfgargs #13941build-dirinternalsbuild-dirinternals--emitflags #13672cargo metadata)cargo clean -ponly cleans up files for the current layout rather than supporting bothUnresolved issues
Open questions
build-dirisn't stable, enough tools rely on the layout that we'd want to setup a transition plan so they can have time to test against the new layout and work to support bothbuild/as its all encompassingbuild/anddeps/content live in the same place?incremental/?cargo clean -palso cleans old layout paths? See feat(build-dir): Reorganize build-dir layout #15947 (comment)Future extensions
Deferred layout changes
-Cextra-filenamecompletely as it is redundant with the build-unit's<name>/<hash>-Cextra-filenamefor rlibs. rustc relies on it. See feat(build-dir): Reorganize build-dir layout #15947 (comment)<tuple>from the parent path?<profile>from the parent path?<hash>is the-C extra-filenamehash and doesn't encompass all of fingerprinting, so we'd need to audit if there are cases that don't change the hash that we'd still need per-profile<pkgname>/<hash>, we can go with prefixes to reduce the number of items within a directory. See bjorn3's comment.deps/hasn't been a problem, this is unlikely to be a problemAbout tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Original
note: I specify
build-dirto clarify which half of #14125 I'm referring to. The files and layout ofbuild-dirdoes not have compatibility guarantees (source).Currently,
build-diris laid out liketarget/<target-platform>/?<profile>/incremental/build/<package>-<hash>/build*script-*deps/<package>-<hash>*Currently,
cargo clean -p <package>will operate on everything for<package>In the future, we could have
<package>-<hash>(cargo ./target fills with outdated artifacts as toolchains are updated/changed #5026)<package>-<hash>that are being built block (More granular locking in cargo_rustc #4282)<package>-<hash>artifacts across all projects (Per-user compiled artifact cache #5931)These could be aided by re-arranging the
build-dirto be organized around<package>-<hash>, liketarget/<target-platform>/?<profile>/incremental/build/<package>-<hash>/build*script-**.dSide effects
deps/and rustc finds the files it needs. We'll instead need to point to each individual artifact rustc may need.