Skip to content

Conversation

joboet
Copy link
Member

@joboet joboet commented Sep 19, 2025

Currently, there are two distinct types called AnonPipe in std:

  • The one used to implement io::pipe (in sys::anonymous_pipe)
  • The one used to implement Stdin/Stdout/Stderr (in sys::pal::pipe)

On Windows, these actually have different semantics, as one of the handles returned by the sys::pal::pipe version is opened for asynchronous operation in order to support read2, whereas the sys::anonymous_pipe version does not do so. Thus the naming is extremely confusing.

To fix this, this PR renames the sys::anonymous_pipe version of AnonPipe to simply Pipe, whereas the sys::pal::pipe version is now called ChildPipe. Additionally,

  • sys::anonymous_pipe is now also just called sys::pipe.
  • On Windows, sys::pal::pipe has been moved to sys::process and is now called sys::process::child_pipe.
  • On non-Windows platforms, pipe creation is now exclusively handled by sys::pipe and ChildPipe is defined as a type alias to Pipe within sys::process.

And lastly, the read2 function (originally in sys::pal::pipe) is now called read_output and defined by sys::process, as (at least on Windows) it is only usable with ChildPipe.

Includes #146639 for convenience.

All platforms define this structure the same way, so we can just put it in the `process` module directly.
@rustbot
Copy link
Collaborator

rustbot commented Sep 19, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
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

@rustbot rustbot added O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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 Sep 19, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@thaliaarchi
Copy link
Contributor

I opened these two PRs before I noticed your PR here, which is a superset, modulo some tiny fixes for tier 3 builds in mine. Sorry. My PRs probably create more work for you, so feel free to close them. But if they'd help to split yours for review, they might be useful.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/pass/shims/x86/rounding-error.rs ... ok
tests/pass/shims/x86/intrinsics-x86-gfni.rs ... ok

FAILED TEST: tests/pass/0weak_memory/weak.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-lMbmSI" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass/0weak_memory" "tests/pass/0weak_memory/weak.rs" "-Zmiri-ignore-leaks" "-Zmiri-fixed-schedule" "-Zmiri-provenance-gc=10000" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: test got exit status: 101, but expected 0
 = note: the compiler panicked

error: no output was expected
Execute `./miri test --bless` to update `tests/pass/0weak_memory/weak.stderr` to the actual output
+++ <stderr output>

thread 'main' (1) panicked at tests/pass/0weak_memory/weak.rs:170:5:
did not get value that should be possible: Some(0)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect


full stderr:

thread 'main' (1) panicked at tests/pass/0weak_memory/weak.rs:170:5:
did not get value that should be possible: Some(0)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

full stdout:


FAILURES:
---
Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.2/src/lib.rs:365

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: <color_eyre[d9a5de18b9875966]::config::EyreHook>::into_eyre_hook::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   2: <eyre[5690e5b1ab47a7c1]::Report>::from_adhoc::<&str><unknown>
      at <unknown source file>:<unknown line>
   3: ui_test[406cbfafb7d6e7db]::run_tests_generic::<ui_test[406cbfafb7d6e7db]::default_file_filter, ui[f1dbce1187494f9f]::run_tests::{closure#1}, alloc[a291038b1bca4411]::boxed::Box<dyn ui_test[406cbfafb7d6e7db]::status_emitter::StatusEmitter>><unknown>
      at <unknown source file>:<unknown line>
   4: ui[f1dbce1187494f9f]::ui<unknown>
      at <unknown source file>:<unknown line>
   5: ui[f1dbce1187494f9f]::main<unknown>
      at <unknown source file>:<unknown line>
   6: std[2cfad5a51e47d0d8]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[8f5e04253d03790a]::result::Result<(), eyre[5690e5b1ab47a7c1]::Report>, core[8f5e04253d03790a]::result::Result<(), eyre[5690e5b1ab47a7c1]::Report>><unknown>
      at <unknown source file>:<unknown line>
   7: std[2cfad5a51e47d0d8]::rt::lang_start::<core[8f5e04253d03790a]::result::Result<(), eyre[5690e5b1ab47a7c1]::Report>>::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   8: std[2cfad5a51e47d0d8]::rt::lang_start_internal<unknown>
      at <unknown source file>:<unknown line>
   9: main<unknown>
      at <unknown source file>:<unknown line>
  10: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  11: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/ui-a401ebf6fda09990` (exit status: 1)
Bootstrap failed while executing `test --stage 2 src/tools/miri src/tools/miri/cargo-miri --target i686-pc-windows-msvc`
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color always --release --manifest-path /checkout/src/tools/miri/Cargo.toml -- [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:191:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:677:19

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:01:53
  local time: Sat Sep 20 10:39:50 UTC 2025
  network time: Sat, 20 Sep 2025 10:39:50 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants