Skip to content

std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims - #165117

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:skip_missing_miri_shims
Nov 11, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:skip_missing_miri_shims

Conversation

@RalfJung

@RalfJung RalfJung commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

View all comments

We currently run some subset of std tests in Miri, skipping some because Miri doesn't support the operations they need. That is based on filters in the makefile. People don't know what is actually being tested and add random cfg(miri) in places to disable tests that were never run. This makes it quite hard to track which tests are being skipped and which operations we should add in Miri to get 100% std coverage. So let's replace that string-based filter with a cfg flag, skip_unsupported_miri_tests, that can be annotated at the tests.

Unfortunately I can't figure out how to disable all doctests in a module based on a cfg flag, so this entirely disables std doctests being run in Miri in our CI. (We still run them in https://github.com/rust-lang/miri-test-libstd.)

See prior discussion on Zulip.
Docs PR: rust-lang/std-dev-guide#86

r? @tgross35
try-job: test-x86_64-gnu-aux

@rustbot

rustbot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Any special-casing of Miri in the standard library requires review.

cc @rust-lang/miri

@rustbot rustbot added O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) O-unix Operating system: Unix-like 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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 29, 2026
@rustbot

rustbot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

tgross35 is currently at their maximum review capacity.
They may take a while to respond.

@RalfJung

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
std: use skip_missing_miri_shims to control when tests should be skipped in Miri due to missing shims

try-job: test-x86_64-gnu-aux
@RalfJung
RalfJung force-pushed the skip_missing_miri_shims branch from 43cd0c6 to ce7f68a Compare October 29, 2026 10:07
@tgross35

Copy link
Copy Markdown
Member

I'm pretty okay with this, @rust-lang/libs-ping any thoughts? See the Zulip discussion linked in the top post for context

@rust-bors

rust-bors Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: ea60bf0 (ea60bf0be95c912404a2821f1c21a97850d94d6e)
Base parent: ce37c4f (ce37c4ff837c5c5dc45cddf9e1e3704e42ca67ea)

@RalfJung
RalfJung force-pushed the skip_missing_miri_shims branch from ce7f68a to 4d659d1 Compare October 31, 2026 10:22
@rustbot

This comment has been minimized.

@RalfJung
RalfJung force-pushed the skip_missing_miri_shims branch from 4d659d1 to f08ee20 Compare October 31, 2026 10:27
/// Converts a `BorrowedFd` into a reference to a file-like type.
///
#[cfg_attr(all(unix, not(miri)), doc = "```")]
#[cfg_attr(unix, doc = "```")]

@RalfJung RalfJung Oct 31, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I screwed this up in #164963...

View changes since the review

@rust-log-analyzer

This comment has been minimized.

@RalfJung
RalfJung force-pushed the skip_missing_miri_shims branch from f08ee20 to 5439f19 Compare October 31, 2026 12:14
@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 31, 2026
@RalfJung
RalfJung force-pushed the skip_missing_miri_shims branch from 5439f19 to 3aee2ea Compare October 31, 2026 12:14
@rust-bors

This comment has been minimized.

@RalfJung
RalfJung force-pushed the skip_missing_miri_shims branch from 3aee2ea to 573f710 Compare November 2, 2026 21:41
@rustbot

This comment has been minimized.

@RalfJung

RalfJung commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

I'm pretty okay with this, @rust-lang/libs-ping any thoughts? See the Zulip discussion linked in the top post for context

It's been a week -- seems like nobody has major concerns?

rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #165575 (Upgrade bundled musl to 1.2.6)
 - #163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims)
 - #165458 (fix incorrect byte count suffix on MSVC)
 - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - #165586 (Remove `backend_optimization_level`.)
 - #165646 (fix NumScalableVectors::from_field_count)
 - #165655 (Unignore passing GCC backend tests)
 - #165740 (miri subtree update)
 - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - #165682 (interpret: ensure newly created unions have uninit in their padding)
 - #165693 (Move `check_attr` to attribute parsing)
 - #165715 (windows: check for null before wide encoding)
 - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - #165733 (docs(num): remove needless whitespaces)

Failed merges:

 - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - #164218 (Tweak private re-export errors to point at correct span and have more context)
 - #165709 (remove 'x miri' smoke test from PR CI)
programskillforverification pushed a commit to programskillforverification/miri that referenced this pull request Nov 10, 2026
miri subtree update

Fixes an issue in `socketpair` to unblock rust-lang/rust#165117.

Subtree update of `miri` to rust-lang@57677a1.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 10, 2026
…r=maxdexh

std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims

We currently run some subset of std tests in Miri, skipping some because Miri doesn't support the operations they need. That is based on filters in the makefile. People don't know what is actually being tested and add random `cfg(miri)` in places to disable tests that were never run. This makes it quite hard to track which tests are being skipped and which operations we should add in Miri to get 100% std coverage. So let's replace that string-based filter with a cfg flag, `skip_unsupported_miri_tests`, that can be annotated at the tests.

Unfortunately I can't figure out how to disable all doctests in a module based on a cfg flag, so this entirely disables std doctests being run in Miri in our CI. (We still run them in https://github.com/rust-lang/miri-test-libstd.)

See prior discussion [on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Miri.20vs.20tests.20in.20std/with/635913743).
Docs PR: rust-lang/std-dev-guide#86

r? @tgross35
try-job: test-x86_64-gnu-aux
@RalfJung

Copy link
Copy Markdown
Member Author

@JonathanBrouwer I suspect this is actually the one that made the rollup fail.

@bors try jobs=test-x86_64-msvc-ext2

rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims


try-job: test-x86_64-msvc-ext2
@rust-bors

This comment has been minimized.

@RalfJung

Copy link
Copy Markdown
Member Author

Yeah I forgot to update this.

@bors r-

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 10, 2026
@rust-bors

rust-bors Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#165756), which was unapproved.

View changes since this unapproval

@RalfJung RalfJung mentioned this pull request Nov 10, 2026
@RalfJung

Copy link
Copy Markdown
Member Author

Let's just wait for #165709 to go in first.

@rust-bors

rust-bors Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 6527c4d failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

…ts should be skipped in Miri due to missing shims
@RalfJung
RalfJung force-pushed the skip_missing_miri_shims branch from 3cf3c87 to e982cc3 Compare November 10, 2026 20:34
@rustbot

rustbot commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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.

@RalfJung

Copy link
Copy Markdown
Member Author

@bors r=maxdexh

@rust-bors

rust-bors Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e982cc3 has been tentatively approved by maxdexh

It will be put into the queue for this repository once PR CI succeeds.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 10, 2026
@maxdexh

maxdexh commented Nov 10, 2026

Copy link
Copy Markdown
Member

Fastest rebase in the west

@rust-bors

rust-bors Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit e982cc3 with merge 9a513ad...

Workflow: https://github.com/rust-lang/rust/actions/runs/42955422759

rust-bors Bot pushed a commit that referenced this pull request Nov 11, 2026
std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims



We currently run some subset of std tests in Miri, skipping some because Miri doesn't support the operations they need. That is based on filters in the makefile. People don't know what is actually being tested and add random `cfg(miri)` in places to disable tests that were never run. This makes it quite hard to track which tests are being skipped and which operations we should add in Miri to get 100% std coverage. So let's replace that string-based filter with a cfg flag, `skip_unsupported_miri_tests`, that can be annotated at the tests.

Unfortunately I can't figure out how to disable all doctests in a module based on a cfg flag, so this entirely disables std doctests being run in Miri in our CI. (We still run them in https://github.com/rust-lang/miri-test-libstd.)

See prior discussion [on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Miri.20vs.20tests.20in.20std/with/635913743).
Docs PR: rust-lang/std-dev-guide#86

r? @tgross35 
try-job: test-x86_64-gnu-aux
@Zalathar

Copy link
Copy Markdown
Member

@bors yield (enclosing rollup)

@rust-bors

rust-bors Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #165793.

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

Labels

A-CI Area: Our Github Actions CI A-filesystem Area: `std::fs` A-io Area: `std::io` (note: `std::fs`, `std::net`, `std::path` are A-filesystem, A-net, A-path) A-networking Area: `std::net` A-process Area: `std::process` (note: `std::env` is A-env) A-testsuite Area: The testsuite used to check the correctness of rustc O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) O-unix Operating system: Unix-like O-windows Operating system: Windows 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. 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.

9 participants