Skip to content

bootstrap: Replace the exit! macro with a function helpers::exit_process - #161023

Open
Zalathar wants to merge 1 commit into
rust-lang:mainfrom
Zalathar:exit-process
Open

bootstrap: Replace the exit! macro with a function helpers::exit_process#161023
Zalathar wants to merge 1 commit into
rust-lang:mainfrom
Zalathar:exit-process

Conversation

@Zalathar

Copy link
Copy Markdown
Member

The function can check cfg!(test) internally, without needing any macro magic. This lets us remove a crate-root definition and a #[macro_export].

The function can check `cfg!(test)` internally, without needing any macro
magic. This lets us remove a crate-root definition and a `#[macro_export]`.
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 13, 2026
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

r? @clubby789

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, r=me once PR CI is green enough
r? me

View changes since this review

@rustbot rustbot assigned jieyouxu and unassigned clubby789 Aug 13, 2026
@clubby789

clubby789 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

I personally prefer exit as a function name, but up to you. Otherwise r=me also

@jieyouxu

Copy link
Copy Markdown
Member

Yeah no strong feelings about exit_process or exit, shorter is fine too.

@Zalathar

Copy link
Copy Markdown
Member Author

The main reason I went with exit_process is that ending the process is a pretty drastic act, and I wanted that to be obvious from the call sites in a way that exit(1) or helpers::exit(1) didn’t seem to be capturing.

@bors r=jieyouxu,clubby789

@rust-bors

rust-bors Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit bc44db7 has been approved by jieyouxu,clubby789

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 13, 2026
…clubby789

bootstrap: Replace the `exit!` macro with a function `helpers::exit_process`

The function can check `cfg!(test)` internally, without needing any macro magic. This lets us remove a crate-root definition and a `#[macro_export]`.
@Kobzol

Kobzol commented Aug 13, 2026

Copy link
Copy Markdown
Member

I think that there might have been a reason for the macro in the past, so that cfg!(test) is expanded in the right crate 🤔 But I think that after recent refactorings this is not the case anymore, as it is in bootstrap now, and not in build_helper.

@jieyouxu

Copy link
Copy Markdown
Member

I think that there might have been a reason for the macro in the past, so that cfg!(test) is expanded in the right crate 🤔 But I think that after recent refactorings this is not the case anymore, as it is in bootstrap now, and not in build_helper.

Oh yeah, that could definitely be the case

rust-bors Bot pushed a commit that referenced this pull request Aug 13, 2026
Rollup of 8 pull requests

Successful merges:

 - #159593 (merge ambiguity errors that blame the same inference variable)
 - #160687 (Experiment: Add `core::cmp::smallest` and `core::cmp::largest`)
 - #160856 (Replace infers and non-rigid aliases with `Ty/Const::Error` if param env normalization fails)
 - #160961 (bootstrap: Overhaul matching of command-line selectors to steps)
 - #160975 (Remove target argument from get_proc_macros)
 - #161023 (bootstrap: Replace the `exit!` macro with a function `helpers::exit_process`)
 - #160932 (Make tidy::Version public)
 - #161029 (mailmap: Update my default email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants