docs(layout): Updated layout module docs to document new layout#16502
docs(layout): Updated layout module docs to document new layout#16502epage merged 3 commits intorust-lang:masterfrom
Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use |
ca93c71 to
080e303
Compare
### What does this PR try to resolve? While documenting the `build-dir` layout changes in #16502 I noticed that we are still creating the `<build-dir>/<profile>/examples` directory when `-Zbuild-dir-new-layout` is passed even though its no longer used. This PR fixes it cc tracking issue: #15010 ### How to test and review this PR? Updating the existing examples test to catch this particular case r? @epage
### What does this PR try to resolve? In #16502 (comment) there was a discussion about merging the `build-script` and `deps` dirs in the `build-dir`. Currently: ``` build-dir/<profile>/build/<pkgname>/<hash>/ deps/ # rustc output build-script/ # build script binary build-script-execution/ # the output of running a build script ``` Note: For build-scripts `deps` is empty. This PR: 1. moves the build script binaries from `build-script` to `deps` to simplify the layout 2. renames `build-script-execution` to `build-script` to simplify the dir naming and shorten the path length for windows ``` build-dir/<profile>/build/<pkgname>/<hash>/ deps/ # rustc output including build-script bins build-script/ # the output of running a build script ``` cc tracking issue: #15010 ### How to test and review this PR? see the test changes r? @epage
### What does this PR try to resolve? This spawned out of #16502 (comment) when I noticed artifact dependencies are not using the new build-dir layout. This PR moves them from `<build-dir>/<profile>/deps/artifact/$pkgname-$META` (old layout) to `<build-dir>/<profile>/build/$pkgname/$META/deps/artifact/<kind>` when `-Zbuild-dir-new-layout` is enabled. cc tracking issue: #15010 ### How to test and review this PR? Added new test specifically for artifact deps r? @epage
### What does this PR try to resolve? This PR makes more changes to the new `build-dir` layout as discussed in #16502 (comment). The goal here is to have more general (and thus reusable) directories in the build unit structure. #### Layout changes 1. Rename `{build-unit-dir}/deps` to `{build-unit-dir}/out` 2. Moved build-script `OUT_DIR` from `{build-unit-dir}/build-script/out` to `{build-unit-dir}/out` 3. Renamed `{build-unit-dir}/build-script` to `{build-unit-dir}/run` * This makes the dir more general to any build unit that can execute an external process. (but currently only build-scripts use it) The resulting structure looks like ``` build-dir/debug/build/<pkgname>/<HASH> fingerprint/ out/ run/ .lock ``` Part of #15010 ### How to test and review this PR? See the test updates included in each commit
080e303 to
f0ea77f
Compare
This comment has been minimized.
This comment has been minimized.
f0ea77f to
0f0be3c
Compare
This comment has been minimized.
This comment has been minimized.
0f0be3c to
65d9ec3
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
65d9ec3 to
0e0fb09
Compare
20862b4 to
53e09a7
Compare
| //! # Root directory for all compiled examples. | ||
| //! examples/ |
There was a problem hiding this comment.
Shouldn't this be removed from build-dir?
There was a problem hiding this comment.
Actually its still present in the old layout.
It contains the pre-uplifted bins
cargo/src/cargo/core/compiler/build_runner/compilation_files.rs
Lines 229 to 230 in 2200079
In the new layout, the examples will use the <build-unit>/out dir just like regular compilation build units
| //! # Set of source filenames for this package. | ||
| //! dep-lib-$targetname | ||
| //! # Timestamp when this package was last built. | ||
| //! invoked.timestamp | ||
| //! # The fingerprint hash. | ||
| //! lib-$targetname | ||
| //! # Detailed information used for logging the reason why | ||
| //! # something is being recompiled. | ||
| //! lib-$targetname.json | ||
| //! # The console output from the compiler. This is cached | ||
| //! # so that warnings can be redisplayed for "fresh" units. | ||
| //! output-lib-$targetname | ||
| //! |
There was a problem hiding this comment.
Side note: I feel like we could design the entire fingerprint/ directory.
53e09a7 to
68c08ae
Compare
68c08ae to
6339e32
Compare
|
hmmm, seems github actions died? We can probably rerun. |
Update cargo submodule 10 commits in ce69df6f72a3b6a2b5c722ba68ddef255344b31c..8cc0cb136772b8f54eafe0d163fcb7226a06af0c 2026-02-12 12:39:45 +0000 to 2026-02-17 12:16:26 +0000 - docs(layout): Updated layout module docs to document new layout (rust-lang/cargo#16502) - fix(host-config): host.linker should not apply to non host unit (rust-lang/cargo#16641) - init: improve error message and add tests (rust-lang/cargo#16643) - Corrected doc comment for build script root_output path (rust-lang/cargo#16645) - Changed build script run `output` dir to `stdout` in new build-dir layout (rust-lang/cargo#16644) - test: add test case for verify-project with invalid TOML (rust-lang/cargo#16640) - test(script): Show remaining workspace behavors (rust-lang/cargo#16633) - fix(host-config): `host.runner` should not apply to `cargo run` (rust-lang/cargo#16638) - refactor(help): simplify code structure (rust-lang/cargo#16627) - test: Remove unused docker ip_address (rust-lang/cargo#16636)
Update cargo submodule 10 commits in ce69df6f72a3b6a2b5c722ba68ddef255344b31c..8cc0cb136772b8f54eafe0d163fcb7226a06af0c 2026-02-12 12:39:45 +0000 to 2026-02-17 12:16:26 +0000 - docs(layout): Updated layout module docs to document new layout (rust-lang/cargo#16502) - fix(host-config): host.linker should not apply to non host unit (rust-lang/cargo#16641) - init: improve error message and add tests (rust-lang/cargo#16643) - Corrected doc comment for build script root_output path (rust-lang/cargo#16645) - Changed build script run `output` dir to `stdout` in new build-dir layout (rust-lang/cargo#16644) - test: add test case for verify-project with invalid TOML (rust-lang/cargo#16640) - test(script): Show remaining workspace behavors (rust-lang/cargo#16633) - fix(host-config): `host.runner` should not apply to `cargo run` (rust-lang/cargo#16638) - refactor(help): simplify code structure (rust-lang/cargo#16627) - test: Remove unused docker ip_address (rust-lang/cargo#16636)
Update cargo submodule 10 commits in ce69df6f72a3b6a2b5c722ba68ddef255344b31c..8cc0cb136772b8f54eafe0d163fcb7226a06af0c 2026-02-12 12:39:45 +0000 to 2026-02-17 12:16:26 +0000 - docs(layout): Updated layout module docs to document new layout (rust-lang/cargo#16502) - fix(host-config): host.linker should not apply to non host unit (rust-lang/cargo#16641) - init: improve error message and add tests (rust-lang/cargo#16643) - Corrected doc comment for build script root_output path (rust-lang/cargo#16645) - Changed build script run `output` dir to `stdout` in new build-dir layout (rust-lang/cargo#16644) - test: add test case for verify-project with invalid TOML (rust-lang/cargo#16640) - test(script): Show remaining workspace behavors (rust-lang/cargo#16633) - fix(host-config): `host.runner` should not apply to `cargo run` (rust-lang/cargo#16638) - refactor(help): simplify code structure (rust-lang/cargo#16627) - test: Remove unused docker ip_address (rust-lang/cargo#16636)
What does this PR try to resolve?
This PR updates the layout module docs to reflect the update layout structure changes made as part of #15010
How to test and review this PR?
no response
Follow up needed