Skip to content

Rename -Zno-embed-metadata to -Zembed-metadata=no#17149

Merged
weihanglo merged 1 commit into
rust-lang:masterfrom
Kobzol:no-embed-metadata
Jul 12, 2026
Merged

Rename -Zno-embed-metadata to -Zembed-metadata=no#17149
weihanglo merged 1 commit into
rust-lang:masterfrom
Kobzol:no-embed-metadata

Conversation

@Kobzol

@Kobzol Kobzol commented Jun 29, 2026

Copy link
Copy Markdown
Member

What does this PR try to resolve?

This PR renames the unstable -Zno-embed-metadata flag to -Zembed-metadata=no, as proposed in https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/Usage.20of.20-Zno-embed-metadata/with/607232149. So that in the future it can be controlled both via no and yes, to allow opt-in/opt-out.

To enable the flag by default, I want to detect whether we both have nightly Cargo and nightly rustc. I'm not sure what's the best way to do that, but I tried to access Rustc through the BuildContext and determine if it is nightly or dev based on the output of rustc -vV. We decided to postpone this to a follow-up PR.

How to test and review this PR?

cargo test --test testsuite -- build will run a few tests that leverage -Zembed-metadata.

@rustbot

rustbot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-cache-messages Area: caching of compiler messages A-cfg-expr Area: Platform cfg expressions A-configuration Area: cargo config files and env vars A-documenting-cargo-itself Area: Cargo's documentation A-rebuild-detection Area: rebuild detection and fingerprinting A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 29, 2026
@Kobzol
Kobzol force-pushed the no-embed-metadata branch from 022fb54 to da5944e Compare June 29, 2026 20:49
@rustbot rustbot added A-layout Area: target output directory layout, naming, and organization Command-clean labels Jun 29, 2026
@Kobzol
Kobzol force-pushed the no-embed-metadata branch 4 times, most recently from 3b494b2 to 1ea924f Compare June 29, 2026 22:09
epage
epage previously requested changes Jun 30, 2026

@epage epage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I wasn't in the team meeting for this and something seems to either be missing in the team meeting notes or in the discussion itself

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 30, 2026
@weihanglo

Copy link
Copy Markdown
Member

Do we want to land the first half first?

Rename -Zno-embed-metadata to -Zembed-metadata=no

@Kobzol

Kobzol commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

Happy to change the PR to that effect, if it can make it simpler to review and move this forward!

@weihanglo

Copy link
Copy Markdown
Member

Yeah I think that is less controversial while we are gathering more data points and sorting out the command line argument length issue (oof)

@Kobzol Kobzol changed the title Rename -Zno-embed-metadata to -Zembed-metadata=no and use it by default on nightly Rename -Zno-embed-metadata to -Zembed-metadata=no Jul 12, 2026
@Kobzol
Kobzol force-pushed the no-embed-metadata branch from 1ea924f to 8e3cdcf Compare July 12, 2026 12:39
@rustbot

rustbot commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

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.

@Kobzol
Kobzol force-pushed the no-embed-metadata branch from 8e3cdcf to bbafaed Compare July 12, 2026 12:41
@Kobzol

Kobzol commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

Ok, done.

FWIW, the CLI length increase with -Zembed-metadata=no isn't that bad, it only affects the leaf compiled crates (usually bins), and is at most a 2x increase. We can also leverage the rustc heuristic to get rid of the increase, if it gets too long.

@weihanglo weihanglo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@weihanglo
weihanglo requested review from epage and removed request for epage July 12, 2026 13:16
@weihanglo
weihanglo dismissed epage’s stale review July 12, 2026 13:17

Dropped the nightly switch

@weihanglo
weihanglo enabled auto-merge July 12, 2026 13:17
@weihanglo
weihanglo added this pull request to the merge queue Jul 12, 2026
Merged via the queue into rust-lang:master with commit 4e9700a Jul 12, 2026
29 checks passed
@Kobzol
Kobzol deleted the no-embed-metadata branch July 12, 2026 16:52
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 18, 2026
Update cargo submodule

29 commits in 59800466c5c41c444d264b1010b4d57e85a7117f..3efb1f477e99b42974b982d939fd100303cdf7db
2026-07-07 15:52:22 +0000 to 2026-07-17 23:53:19 +0000
- refactor(context): normalize in `homedir` instead (rust-lang/cargo#17222)
- chore(ci): reflect doc folder move in book deployment (rust-lang/cargo#17235)
- refactor(ops): Have cargo-metadata's ops match the command name (rust-lang/cargo#17233)
- chore: Flatten src (rust-lang/cargo#17231)
- chore: Flatten `src` (rust-lang/cargo#17230)
- chore(ci): remove stale libsecret packages (rust-lang/cargo#17229)
- perf: Lazily initialize git2 fetch transports  (rust-lang/cargo#17226)
- test(trim-paths): re-enable lldb debugger tests  (rust-lang/cargo#17223)
- Include SBOM outputs in fingerprints (rust-lang/cargo#17216)
- Update cfg_aliases to 0.2.2 (rust-lang/cargo#17225)
- test(trim-paths): exercise GDB on windows-gnu (rust-lang/cargo#17221)
- feat(profile): Disable incremental compilation under CI by default (rust-lang/cargo#17220)
- Remove myself from review rotation (rust-lang/cargo#17219)
- Fix typo in comment in sync (rust-lang/cargo#17217)
- docs(ref): Improve handing of built-in profiles (rust-lang/cargo#17213)
- fix: dont apply host-config gating to stable behavior (rust-lang/cargo#17198)
- chore(deps): update msrv (rust-lang/cargo#17192)
- test: fix race in cargo_compile_with_invalid_code_in_deps (rust-lang/cargo#17203)
- Rename `-Zno-embed-metadata` to `-Zembed-metadata=no` (rust-lang/cargo#17149)
- fix(source): incorrect duplicate package warning (rust-lang/cargo#17204)
- Fix manifest schema generation: `TomlDebugInfo` enum-variants doesn't renamed (rust-lang/cargo#17202)
- Reduce library search path length in new build dir layout (rust-lang/cargo#17191)
- fix(install): Move --debug to Compilation options (rust-lang/cargo#17199)
- chore(ci): dogfood `build.warnings` (rust-lang/cargo#17195)
- docs(lints): Better match clippy in lint section titles (rust-lang/cargo#17190)
- chore: bump to 0.100.0; update changelog (rust-lang/cargo#17189)
- docs(ref): Clarify MSRV for lints (rust-lang/cargo#17184)
- docs(report): add missing entry for `cargo report future-incompatibilities` (rust-lang/cargo#17188)
- Reduce rustc `-L` args used in the new `build-dir` layout (rust-lang/cargo#17168)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 18, 2026
Update cargo submodule

29 commits in 59800466c5c41c444d264b1010b4d57e85a7117f..3efb1f477e99b42974b982d939fd100303cdf7db
2026-07-07 15:52:22 +0000 to 2026-07-17 23:53:19 +0000
- refactor(context): normalize in `homedir` instead (rust-lang/cargo#17222)
- chore(ci): reflect doc folder move in book deployment (rust-lang/cargo#17235)
- refactor(ops): Have cargo-metadata's ops match the command name (rust-lang/cargo#17233)
- chore: Flatten src (rust-lang/cargo#17231)
- chore: Flatten `src` (rust-lang/cargo#17230)
- chore(ci): remove stale libsecret packages (rust-lang/cargo#17229)
- perf: Lazily initialize git2 fetch transports  (rust-lang/cargo#17226)
- test(trim-paths): re-enable lldb debugger tests  (rust-lang/cargo#17223)
- Include SBOM outputs in fingerprints (rust-lang/cargo#17216)
- Update cfg_aliases to 0.2.2 (rust-lang/cargo#17225)
- test(trim-paths): exercise GDB on windows-gnu (rust-lang/cargo#17221)
- feat(profile): Disable incremental compilation under CI by default (rust-lang/cargo#17220)
- Remove myself from review rotation (rust-lang/cargo#17219)
- Fix typo in comment in sync (rust-lang/cargo#17217)
- docs(ref): Improve handing of built-in profiles (rust-lang/cargo#17213)
- fix: dont apply host-config gating to stable behavior (rust-lang/cargo#17198)
- chore(deps): update msrv (rust-lang/cargo#17192)
- test: fix race in cargo_compile_with_invalid_code_in_deps (rust-lang/cargo#17203)
- Rename `-Zno-embed-metadata` to `-Zembed-metadata=no` (rust-lang/cargo#17149)
- fix(source): incorrect duplicate package warning (rust-lang/cargo#17204)
- Fix manifest schema generation: `TomlDebugInfo` enum-variants doesn't renamed (rust-lang/cargo#17202)
- Reduce library search path length in new build dir layout (rust-lang/cargo#17191)
- fix(install): Move --debug to Compilation options (rust-lang/cargo#17199)
- chore(ci): dogfood `build.warnings` (rust-lang/cargo#17195)
- docs(lints): Better match clippy in lint section titles (rust-lang/cargo#17190)
- chore: bump to 0.100.0; update changelog (rust-lang/cargo#17189)
- docs(ref): Clarify MSRV for lints (rust-lang/cargo#17184)
- docs(report): add missing entry for `cargo report future-incompatibilities` (rust-lang/cargo#17188)
- Reduce rustc `-L` args used in the new `build-dir` layout (rust-lang/cargo#17168)
@rustbot rustbot added this to the 1.99.0 milestone Jul 18, 2026
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-cache-messages Area: caching of compiler messages A-cfg-expr Area: Platform cfg expressions A-configuration Area: cargo config files and env vars A-documenting-cargo-itself Area: Cargo's documentation A-layout Area: target output directory layout, naming, and organization A-rebuild-detection Area: rebuild detection and fingerprinting A-unstable Area: nightly unstable support Command-clean S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants