-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(layout): Put examples in their unit dir in new layout #16335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Before, pre-uplifted examples were being written to
`{build-dir}/{profile}/examples/{name}-{hash}`.
Now they are being written to
`{build-dir}/{profile}/build/{pkgname}/{hash}/{name}-{hash}`.
This does not affect uplifted examples (they lack the `-{hash}`).
Pre-build-dir, these were placed in a "public" location but I don't see
a reason for that to be the case (otherwise, we'd need to switch them to
`{target-dir}/{profile}/examples/{name}-{hash}`).
In that case, I don't see a reason to treat examples as any different
than any other artifact and going in their unique build init directory.
Fixes rust-lang#16302
|
CC @ranger-ross |
| } else if unit.artifact.is_true() { | ||
| self.artifact_dir(unit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming we should eventually revisit this design as well so that artifact-deps doesn't affect the atomic nature of build units to allow for #5931.
e99f374 to
298db39
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. |
|
Thanks! This makes sense to me. |
Update cargo submodule 9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac 2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000 - fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915) - Remove legacy tmpdir support (rust-lang/cargo#16342) - Run clippy CI on more targets (rust-lang/cargo#16340) - feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309) - fix(timings): unlocked -> unblocked (rust-lang/cargo#16337) - fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335) - fix(frontmatter): Restrict code fence length (rust-lang/cargo#16334) - Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333) - fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331) This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
Update cargo submodule 9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac 2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000 - fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915) - Remove legacy tmpdir support (rust-lang/cargo#16342) - Run clippy CI on more targets (rust-lang/cargo#16340) - feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309) - fix(timings): unlocked -> unblocked (rust-lang/cargo#16337) - fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335) - fix(frontmatter): Restrict code fence length (rust-lang/cargo#16334) - Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333) - fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331) This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
What does this PR try to resolve?
Before, pre-uplifted examples were being written to
{build-dir}/{profile}/examples/{name}-{hash}.Now they are being written to
{build-dir}/{profile}/build/{pkgname}/{hash}/{name}-{hash}.This does not affect uplifted examples (they lack the
-{hash}).Pre-build-dir, these were placed in a "public" location but I don't see a reason for that to be the case (otherwise, we'd need to switch them to
{target-dir}/{profile}/examples/{name}-{hash}).In that case, I don't see a reason to treat examples as any different than any other artifact and going in their unique build init directory.
Fixes #16302
How to test and review this PR?