Skip to content

Update bootstrap to use -Zembed-metadata=no instead of -Zno-embed-metadata#159781

Open
dpaoliello wants to merge 1 commit into
rust-lang:mainfrom
dpaoliello:noembed
Open

Update bootstrap to use -Zembed-metadata=no instead of -Zno-embed-metadata#159781
dpaoliello wants to merge 1 commit into
rust-lang:mainfrom
dpaoliello:noembed

Conversation

@dpaoliello

Copy link
Copy Markdown
Contributor

The recent Cargo submodule update picked up rust-lang/cargo#17149

However, bootstrap was still using the old name, resulting in:

Building stage1 library artifacts (stage1 -> stage1, arm64ec-pc-windows-msvc)
error: unknown `-Z` flag specified: no-embed-metadata

Fix is to switch to the rename.

I also removed the diff in the Cranelift setup script, since they must have already hit this issue and no longer need the workaround.

@rustbot

rustbot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 23, 2026
@rustbot

rustbot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

r? @mejrs

rustbot has assigned @mejrs.
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: compiler
  • compiler expanded to 74 candidates
  • Random selection from 20 candidates

@rust-log-analyzer

This comment has been minimized.

@Kobzol

Kobzol commented Jul 23, 2026

Copy link
Copy Markdown
Member

Ah, this is annoying. On stage0/beta Cargo, the old flag is still used, while if we use the in-tree stage1+ Cargo, we have to use the new flag.

@Kobzol

Kobzol commented Jul 23, 2026

Copy link
Copy Markdown
Member

Maybe we can just temporarily stop using this flag, although I'm not sure whether bootstrap can deal with both the flag being on and off.

@bjorn3

bjorn3 commented Jul 23, 2026

Copy link
Copy Markdown
Member

We can check for the local-rebuild config, right? If that is set, the new cli flag should be used, otherwise the old cli flag.

@rust-log-analyzer

This comment has been minimized.

Comment thread src/bootstrap/src/core/builder/cargo.rs Outdated
if matches!(mode, Mode::Std) {
cargo.arg("-Zembed-metadata=no");
// The `-Zembed-metadata` flag was renamed from `-Zno-embed-metadata`.
if build_compiler_stage == 0 {

@bjorn3 bjorn3 Jul 23, 2026

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.

The same cargo is used for all stages, so checking build_compiler_stage is not correct. local-rebuild should work though. That is what is used to indicate that the bootstrap toolchain (and thus cargo) matches the in-tree one (or is at most a patch release away)

View changes since the review

…adata

The recent Cargo submodule update picked up <rust-lang/cargo#17149>

However, bootstrap was still using the old name, resulting in:

```
Building stage1 library artifacts (stage1 -> stage1, arm64ec-pc-windows-msvc)
error: unknown `-Z` flag specified: no-embed-metadata
```

Fix is to switch to the rename.

I also removed the diff in the Cranelift setup script, since they must have already hit this issue and no longer need the workaround.
@Kobzol

Kobzol commented Jul 23, 2026

Copy link
Copy Markdown
Member

Thank you! Let's try.

@bors r+ rollup=iffy

@rust-bors

rust-bors Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit fe37a8a has been approved by Kobzol

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants