-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Enable -Zembed-metadata=no by default on nightly Cargo
#17267
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
Open
Kobzol
wants to merge
1
commit into
rust-lang:master
Choose a base branch
from
Kobzol:enable-embed-metadata-on-nightly
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
We should mirror the check done in #17258 (and maybe need to document this)
View changes since the review
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.
My PR currently allows using the new default on stable via
RUSTC_BOOTSTRAP. I can disable that, if you want.But I think that the new build dir layout and this flag differs in how the nightly detection should work. The new build dir layout is purely a Cargo thing; regardless of which layout is used, it will woth with both stable and nightly rustc, the compiler doesn't really care. While the
-Zembed-metadataflag requires the nightly compiler right now.So my check only sets it by default when both Cargo and rustc are nightly. It could also just take a look at rustc, and not at Cargo, in theory.
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.
Like with #17258, this should not change the default with the presence of
RUSTC_BOOTSTRAP. That is my main care about.The rest is more styling (being consistent, being less invasive, etc).
Are there situations where a nightly Cargo is used with stable Rust that we care about? I've not checked what local; builds of Cargo consider itself (which I do run regularly).
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 could use the exact same approach as in #17258, and just enable
-Zembed-metadata=noin nightly Cargo. But I cannot know the rustc version at the time the CLI options are created. So then I'd have to always check the rustc version even if theembed-metadataflag was set explicitly. So=nowould essentially have to act as=no-if-nightly-rustc. Which is also valid, but it seems weird if you pass-Zembed-metadata=noexplicitly and then the flag doesn't get used if the rustc isn't nightly.Or I could use a fourth variant,
EmbedMetadata::NoIfNightlyRustc, and use that on nightly be default. Though #17266 actually removes the enum and just turns it intoOption<bool>to make it easier to load from the config.I don't know about others, but when doing perf. benchmarks or various experiments with Cargo, I do often override
RUSTCand use different cargo/rustc channels, it usually works fine. Local builds of Cargo should bedev, so the same asnightly.