Skip to content

Commit 1fa5c42

Browse files
authored
fix jobserver ICE "jobserver check should have been called earlier"
1 parent 85a4bd8 commit 1fa5c42

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_interface/src/interface.rs

+6
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
382382
// Set parallel mode before thread pool creation, which will create `Lock`s.
383383
rustc_data_structures::sync::set_dyn_thread_safe_mode(config.opts.unstable_opts.threads > 1);
384384

385+
let handler = EarlyErrorHandler::new(config.opts.error_format);
386+
// Check jobserver before run_in_thread_pool_with_globals, which call jobserver::acquire_thread
387+
jobserver::check(|err| {
388+
handler.early_warn_with_note(err, "the build environment is likely misconfigured")
389+
});
390+
385391
util::run_in_thread_pool_with_globals(
386392
config.opts.edition,
387393
config.opts.unstable_opts.threads,

0 commit comments

Comments
 (0)