Skip to content
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

Bootstrap panics when running x fmt --check #100258

Closed
camelid opened this issue Aug 8, 2022 · 5 comments · Fixed by #100339
Closed

Bootstrap panics when running x fmt --check #100258

camelid opened this issue Aug 8, 2022 · 5 comments · Fixed by #100339
Assignees
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. 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.

Comments

@camelid
Copy link
Member

camelid commented Aug 8, 2022

I ran x fmt --check and got this panic, although the rustfmt output had already been printed:

If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
thread 'thread '<unnamed><unnamed>' panicked at '' panicked at 'tx.send(entry.into_path()) failed with sending on a closed channeltx.send(entry.into_path()) failed with sending on a closed channel', ', format.rsformat.rs::166166::1717

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', /Users/noahlev/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/ignore-0.4.18/src/walk.rs:1302:31
Build completed unsuccessfully in 0:00:07

Notably after running x fmt, the panic stops (and x fmt doesn't panic either). But reintroducing something where rustfmt will suggest changes brings the panic in --check back.

See previous discussion at this Zulip thread.

cc @jyn514

@camelid camelid added 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. C-bug Category: This is a bug. labels Aug 8, 2022
@jyn514
Copy link
Member

jyn514 commented Aug 8, 2022

This is a regression from #98994. resume_unwind only exits the process when run from the main thread.

@jyn514
Copy link
Member

jyn514 commented Aug 9, 2022

The fix is to use process::exit instead.

@jyn514 jyn514 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Aug 9, 2022
@shourya5
Copy link
Contributor

shourya5 commented Aug 9, 2022

@rustbot claim

@shourya5
Copy link
Contributor

shourya5 commented Aug 9, 2022

So, to be clear, the fix is to replace the detail::exit with process::exit right?

@jyn514
Copy link
Member

jyn514 commented Aug 9, 2022

@shourya5 no - within detail_exit, change resume_unwind to process::exit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants