Skip to content

cargo fix with -Zthreads hangs #15175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nemo157 opened this issue Feb 12, 2025 · 1 comment
Closed

cargo fix with -Zthreads hangs #15175

Nemo157 opened this issue Feb 12, 2025 · 1 comment
Labels
C-bug Category: bug Command-fix S-triage Status: This issue is waiting on initial triage.

Comments

@Nemo157
Copy link
Member

Nemo157 commented Feb 12, 2025

Problem

Running cargo fix on a large project I noticed it reliably hang with a bunch of subprocesses not doing anything (23 cargo rustc, 4 rustc). CARGO_LOG=trace didn't really seem to output anything useful near where it hung.

Playing around I managed to reproduce it on a blank project, seems like it's some bad interaction of the job server with -Zthreads under cargo-fix.

I'm not certain if the issue lies in cargo-fix or is a bug in rustc with -Zthreads that cargo-fix just happens to trigger.

Steps

> cargo new foo && cd foo
> RUSTFLAGS=-Zthreads=2 cargo fix --allow-dirty -j1
    Building [                             ] 0/2: foo(bin test), foo(bin)
…hangs…

Note that a check works in this configuration:

> RUSTFLAGS=-Zthreads=2 cargo check -j1
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.86.0-nightly (088d49608 2025-01-10)
release: 1.86.0-nightly
commit-hash: 088d496082726091024f1689c124a0c3dccbd775
commit-date: 2025-01-10
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: NixOS 24.11.0 [64-bit]
@Nemo157 Nemo157 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Feb 12, 2025
@Nemo157 Nemo157 changed the title cargo fix hangs cargo fix with -Zthreads hangs Feb 12, 2025
@ehuss
Copy link
Contributor

ehuss commented Feb 12, 2025

Thanks for the report! I'm going to close as a duplicate of rust-lang/rust#133873.

@ehuss ehuss closed this as completed Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-fix S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants