Skip to content

test: make snapshots agnostic to -Zembed-metadata=no - #17374

Merged
epage merged 1 commit into
rust-lang:masterfrom
weihanglo:embed
Aug 19, 2026
Merged

test: make snapshots agnostic to -Zembed-metadata=no#17374
epage merged 1 commit into
rust-lang:masterfrom
weihanglo:embed

Conversation

@weihanglo

@weihanglo weihanglo commented Aug 18, 2026

Copy link
Copy Markdown
Member

What does this PR try to resolve?

I've considered change

let cargo_nightly = matches!(
crate::version().release_channel.as_deref(),
Some("nightly" | "dev")
);

to

let cargo_nightly = matches!(
    crate::version().release_channel.as_deref(),
    Some("nightly" | "dev") | None
);

As non release channel means you are developing cargo.

Considering it may affect libcargo users, I gave up.
(I am biased as I am a libcargo consumer at work)
Let me know which you think the best.

How to test and review this PR?

To reproduce this rust-lang/rust failure:
https://triage.rust-lang.org/gha-logs/rust-lang/rust/95781922166,

you can run

CFG_RELEASE_CHANNEL=nightly cargo +nightly test

See rust-lang/rust#161273 (comment)

LLM disclosure: I told LLM to simulate Cargo CI and test against it, plus rust-lang/rust CI.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2026
@rustbot

rustbot commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

r? @epage

rustbot has assigned @epage.
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: @epage, @weihanglo
  • @epage, @weihanglo expanded to epage, weihanglo

@weihanglo weihanglo closed this Aug 18, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2026
@weihanglo weihanglo reopened this Aug 18, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2026
@weihanglo
weihanglo force-pushed the embed branch 2 times, most recently from f9b1231 to 2c8e0a9 Compare August 18, 2026 22:59
I've considered change

https://github.com/rust-lang/cargo/blob/19112f96270d68fc834ce94bccf789c463078312/src/compiler/build_context/target_info.rs#L353-L356

to 

```rust
let cargo_nightly = matches!(
    crate::version().release_channel.as_deref(),
    Some("nightly" | "dev") | None
);
```

As non release channel means you are developing cargo.

Considering it may affect libcargo users, I gave up.
(I am biased as I am a libcargo consumer at work)
Let me know which you think the best.

To reproduce this rust-lang/rust failure:
<https://triage.rust-lang.org/gha-logs/rust-lang/rust/95781922166>,

you can run

```
CFG_RELEASE_CHANNEL=nightly cargo +nightly test
```
@weihanglo

Copy link
Copy Markdown
Member Author

(Sigh)
I told LLM to only test and verify it work with nightly + rust-lang/rust like environment, and write down what it find. And it "wrote down" as code comment I didn't catch earlier. Sorry for the noise.

@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.

Really want to find another way to test than these verbose tests. They are a pain to update and rife with merge conflicts.

View changes since this review

@epage
epage enabled auto-merge August 18, 2026 23:06
@epage
epage added this pull request to the merge queue Aug 18, 2026
Merged via the queue into rust-lang:master with commit 0b47ab4 Aug 19, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2026
@weihanglo
weihanglo deleted the embed branch August 19, 2026 00:16
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Aug 19, 2026
Update cargo submodule



6 commits in 8a0d8afba810304bcf9a10bac430be80dd470233..514c56dd7321eecbfdcf9b6479519cf4edfab906
2026-08-15 01:32:53 +0000 to 2026-08-19 00:31:04 +0000
- fix(git): `git gc` with `safe.bareRepository=explicit` (rust-lang/cargo#17370)
- test: make snapshots agnostic to `-Zembed-metadata=no` (rust-lang/cargo#17374)
- fix(clean): Improving description for clean options (rust-lang/cargo#17365)
- Re-stabilize build-dir layout v2 (rust-lang/cargo#17354)
- Enable `-Zembed-metadata=no` by default on nightly Cargo (rust-lang/cargo#17267)
- fix(frontmatter): Don't panic on a short closing fence before a non-ASCII char (rust-lang/cargo#17274)
@rustbot rustbot added this to the 1.100.0 milestone Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants