Skip to content

library/test: always enable unstable features for miri#153369

Open
cuviper wants to merge 1 commit intorust-lang:mainfrom
cuviper:unstable-libtest
Open

library/test: always enable unstable features for miri#153369
cuviper wants to merge 1 commit intorust-lang:mainfrom
cuviper:unstable-libtest

Conversation

@cuviper
Copy link
Member

@cuviper cuviper commented Mar 3, 2026

The unstable features of the test crate used to be default-enabled,
and manually disabled when building the beta and stable channels. Commit
dae8ea9 flipped that to default-disabled, only enabled for nightly
and dev channels.

However, this broke miri testing on the beta/stable channels, because it
also uses unstable features -- which should be fine to enable just for
its own sysroot build. Now the test build script makes that happen by
noticing the MIRI_CALLED_FROM_SETUP environment variable.

The unstable features of the `test` crate used to be default-enabled,
and manually disabled when building the beta and stable channels. Commit
dae8ea9 flipped that to default-disabled, only enabled for nightly
and dev channels.

However, this broke miri testing on the beta/stable channels, because it
also uses unstable features -- which should be fine to enable just for
its own sysroot build. Now the `test` build script makes that happen by
noticing the `MIRI_CALLED_FROM_SETUP` environment variable.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 3, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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: libs
  • libs expanded to 7 candidates
  • Random selection from Mark-Simulacrum, joboet, tgross35

@cuviper
Copy link
Member Author

cuviper commented Mar 3, 2026

1.95-beta is currently blocked on this problem: #153314 (comment)

@rustbot label +beta-nominated

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 3, 2026
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me (but am neither a libs reviewer nor miri reviewer).

View changes since this review

@Kobzol
Copy link
Member

Kobzol commented Mar 4, 2026

I looked at this again and I guess that this is a natural consequence of flipping the default, before we used to use unstable features in some places "by accident", such as in Miri, while they need an explicit opt-in. Would be nicer to set this for Miri tests from bootstrap, rather than in the build probe, but I guess that this would still break miri when executed outside of bootstrap?

I think that as a hotfix for beta this is good enough.

You can r=me if you tested that this unblocks the beta build (the miri test on stable/beta).

@cuviper
Copy link
Member Author

cuviper commented Mar 4, 2026

I had tested that locally, but I went ahead and added this to #153314 for beta to confirm, and it did pass miri's PR CI. Also, T-libs folks are showing approval for the backport on zulip.

@rustbot label +beta-accepted
@bors r=Kobzol

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 4, 2026

📌 Commit 30d7ed4 has been approved by Kobzol

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Mar 4, 2026
@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 Mar 4, 2026
@cuviper
Copy link
Member Author

cuviper commented Mar 4, 2026

Would be nicer to set this for Miri tests from bootstrap, rather than in the build probe, but I guess that this would still break miri when executed outside of bootstrap?

Yes, I think a bootstrap-only fix would break miri elsewhere -- except we don't ship miri on stable or beta anyway. So maybe that's fine, although I'm not sure how else bootstrap would help this, because it has to do with how miri builds test in its own target sysroot.
cc @rust-lang/miri

@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 5, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 5, 2026
[beta] prepare Rust 1.95.0-beta

Ref: https://forge.rust-lang.org/release/process.html#beta-pr

- Replace version placeholders with 1.95.0
- Bump to beta release
- library/test: always enable unstable features for miri #153369 

r? cuviper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants