Skip to content

Commit

Permalink
fix jobserver ICE "jobserver check should have been called earlier"
Browse files Browse the repository at this point in the history
  • Loading branch information
oksbsb authored Dec 4, 2023
1 parent 85a4bd8 commit 1fa5c42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
// Set parallel mode before thread pool creation, which will create `Lock`s.
rustc_data_structures::sync::set_dyn_thread_safe_mode(config.opts.unstable_opts.threads > 1);

let handler = EarlyErrorHandler::new(config.opts.error_format);
// Check jobserver before run_in_thread_pool_with_globals, which call jobserver::acquire_thread
jobserver::check(|err| {
handler.early_warn_with_note(err, "the build environment is likely misconfigured")
});

util::run_in_thread_pool_with_globals(
config.opts.edition,
config.opts.unstable_opts.threads,
Expand Down

0 comments on commit 1fa5c42

Please sign in to comment.