Skip to content

feat(unstable): Added -Zbuild-dir-new-layout unstable feature #15848

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

Merged
merged 2 commits into from
Aug 18, 2025

Conversation

ranger-ross
Copy link
Contributor

What does this PR try to resolve?

Added -Zbuild-dir-new-layout unstable feature as part of #15010

I will open a follow up PR with an initial implementation as mentioned here

r? @weihanglo

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-build-execution Area: anything dealing with executing the compiler A-layout Area: target output directory layout, naming, and organization Command-clean labels Aug 17, 2025
@ranger-ross ranger-ross force-pushed the build-dir-layout-feature branch from 07836ed to c519405 Compare August 17, 2025 10:19
@ranger-ross
Copy link
Contributor Author

ranger-ross commented Aug 17, 2025

oops, disregard the last push. I mistakenly pushed the wip layout implementation to the wrong branch.

Reverted that commit


* Tracking Issue: [#15010](https://github.com/rust-lang/cargo/issues/15010)

Enables the new build-dir filesystem layout.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new layout won't be that useful enough to stabilize on its own, right? Anyway the layout changing itself could lead to unexpected breakages to workflow making assumption of the layout, so agree it is better having its own unstable flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new layout won't be that useful enough to stabilize on its own, right? Anyway the layout changing itself could lead to unexpected breakages to workflow making assumption of the layout, so agree it is better having its own unstable flag.

Yeah it seems unlikely that this alone would give users a tangible benefit, but I think there is value in allowing tool authors to test their cargo integration with the new layout.


Part of me is wondering if it would be a good idea to bundle the layout changes with moving the default build-dir location to inside of CARGO_HOME (or perhaps using XDG config #1734 ?)
My thought is that it might be easier to bundle both of these changes together to avoid churn in the default build-dir behavior.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not? I feel like they are different kinds of churn. And XDG is always a hot topic that I am afraid of touching 😆.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that these are independent changes.

My hope was to have fine grained locking be the feature to push this to being stabilized.

@weihanglo weihanglo added this pull request to the merge queue Aug 18, 2025
Merged via the queue into rust-lang:master with commit 33cb1c2 Aug 18, 2025
46 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2025
@ranger-ross ranger-ross deleted the build-dir-layout-feature branch August 18, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-execution Area: anything dealing with executing the compiler A-documenting-cargo-itself Area: Cargo's documentation A-layout Area: target output directory layout, naming, and organization A-unstable Area: nightly unstable support Command-clean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants