-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Added CARGO_BUILD_DIR_LAYOUT_V2 env var to opt in/out of new layout
#16336
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1556,3 +1556,13 @@ pub fn cargo_docs_link(path: &str) -> String { | |
| }; | ||
| format!("https://doc.rust-lang.org/{url_channel}cargo/{path}") | ||
| } | ||
|
|
||
| /// Returns true of the new build dir layout is enabled. | ||
| #[allow(clippy::disallowed_methods)] | ||
| pub fn is_new_build_dir_layout_enabled(gctx: &GlobalContext) -> bool { | ||
| match std::env::var("CARGO_BUILD_DIR_LAYOUT_V2").as_deref() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cases like #16348 have me wondering what bugs are that we don't see due to our isolated testing. Maybe once the following are merged, do a test run of Cargo's tests with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #16351 was the follow up. All merged and ready to go on this
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once https://github.com/rust-lang/cargo/pull/16336/files#r2593979150 is done, we'll want to do a crater run just in case
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. opened rust-lang/rust#149852 for the crater run |
||
| Ok("true") => true, | ||
| Ok("false") => false, | ||
| Ok(_) | Err(_) => gctx.cli_unstable().build_dir_new_layout, | ||
| } | ||
| } | ||
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.
Could we describe the transition plan in the PR description? Or at least briefly summarize it and provide links to any other references.
It is not clear to me what the target audience
CARGO_BUILD_DIR_LAYOUT_V2is for , and if it breaks people what we should do.Unlike other envs like
__CARGO_GITOXIDE_DISABLE_LIST_FILESwhose code path block everything completely if bugs happened,CARGO_BUILD_DIR_LAYOUT_V2seems like an opt-in only environment variable. People can enable unstable Cargo flags on stable actually today with some trick already. Without knowing the plan it seems a bit weird to add a new one.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 plan to FCP (#16336 (comment)) and that will include the transition plan
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 wrote up my proposal for a plan at #15010 (comment)
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.
Thanks, for the write up. I added a small note mentioning the tracking issue for the transition plan.