Skip to content

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Aug 22, 2025

Miri doesn't currently support mkfifo, so can't present named pipes for other processes (but spawning processes isn't possible from miri anyway) And it also isn't possible in miri to get fd's inherited from the parent process. But this is enough for what running rustc in miri needs.

Fixes #108

bjorn3 added 4 commits August 22, 2025 13:11
Pipe2 was introduced in Linux 2.6.27 while our minimum is 3.2. And Glibc 2.9 while we need 2.17.
Miri doesn't support the raw syscall variant.
Miri doesn't support signals and the cleanup is best-effort anyway.
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

This seems reasonable. Thanks.


A bit more history:

pipe2() was added in kernel 2.6.27 and glibc 2.9. 1

Since Rust 1.64.0 (2022-09-22) 2, we requires

  • glibc >= 2.17 (previously glibc >= 2.11)
  • kernel >= 3.2 (previously kernel >= 2.6.32)

The oldest version requiring glibc-2.11 / kernel-2.6.32 I can found from doc 3 is 1.47.0 (2020-10-08). However, our MSRV is already [1.63 one year ago 4. If people using toolchain older than 1.47, their build are already broken.

Anyway, it is reasonable. Thanks!

Footnotes

  1. https://linux.die.net/man/2/pipe2

  2. https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements/

  3. https://doc.rust-lang.org/1.47.0/rustc/platform-support.html#tier-1

  4. https://crates.io/crates/jobserver/0.1.28

@weihanglo weihanglo merged commit 8d04a3f into rust-lang:main Aug 22, 2025
15 checks passed
@bjorn3 bjorn3 deleted the miri_fixes branch August 22, 2025 19:59
@weihanglo weihanglo mentioned this pull request Aug 23, 2025
@weihanglo
Copy link
Member

@bjorn3
Copy link
Member Author

bjorn3 commented Aug 24, 2025

Thanks!

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.

Use libc pipe2 instead of raw pipe2 syscall on Linux

2 participants