rust-lang / rust-lang/rust

[Windows] Build script crash on 1.95.0: `Os { code: 0, kind: Uncategorized, message: "The operation completed successfully." }`

Open
#156,639 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-prioritize O-windows regression-from-stable-to-stable S-needs-info
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

I tried this code:

  1. Install Rust 1.95.0 on Windows:

    rustup install 1.95.0-x86_64-pc-windows-msvc
    rustup default 1.95.0-x86_64-pc-windows-msvc
    
  2. Create a minimal reproduction project:

    cargo new repro
    cd repro
    
  3. Cargo.toml:

    [package]
    name = "repro"
    version = "0.1.0"
    edition = "2021"
    
    [dependencies]
    serde = "1.0"
    
  4. src/main.rs:

    fn main() {
        println!("Hello");
    }
    
  5. Run:

    cargo check
    

I expected to see this happen: Compilation succeeds, as it does on Rust 1.88.0 and earlier versions.

Instead, this happened: Build script crashes with the following panic:

called `Result::unwrap()` on an `Err` value: Os {
    code: 0,
    kind: Uncategorized,
    message: "The operation completed successfully."
}

This affects build scripts for multiple popular crates including zerocopy, proc-macro2, quote, and serde_core.

Meta

rustc --version --verbose:

rustc 1.95.0 (59807616e 2026-04-14)
binary: rustc
commit-hash: 59807616e
commit-date: 2026-04-14
host: x86_64-pc-windows-msvc
release: 1.95.0
LLVM version: 20.0
Backtrace

thread 'main' panicked at /rustc/59807616e.../library/std/src/sys/process/mod.rs:65:XX:
called `Result::unwrap()` on an `Err` value: Os {
    code: 0,
    kind: Uncategorized,
    message: "The operation completed successfully."
}
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Additional Context
  • OS: Windows 11 (Build 26200)
  • Regression: Yes — the same code compiles fine on Rust 1.88.0
  • Platform-specific: This appears to be Windows-only. The same Rust 1.95.0 version in WSL (Linux target) does not exhibit this particular error.
  • Root cause hypothesis: std::process::Command on Windows is misinterpreting a successful Windows API call (code 0) as a failure.
  • Workaround: Downgrade to 1.88.0-x86_64-pc-windows-msvc
Related Issues (Different Scenarios, Same Error Pattern)

The Os { code: 0, kind: Uncategorized } error pattern has appeared in other contexts, but those were all different root causes:

  • oxidecomputer/omicron#8933 — tokio I/O driver on Helios
  • l4l/yofi#152 — Wayland compositor on Linux
  • tauri-apps/tao#753 — Windows system tray icon handle exhaustion

None of these are related to the build script process crash on Windows with Rust 1.95.0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction steps using Rust 1.95.0 on Windows and inspect the panic location named in library/std/src/sys/process/mod.rs:65. Compare the behavior with Rust 1.88.0 and the Linux target described in the report. Done means the minimal serde project builds successfully with cargo check on Windows 1.95.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.