Rollup merge of #109694 - BelovDV:fix-panic-jobserver-token, r=bjorn3

do not panic on failure to acquire jobserver token

Purpose: remove `panic`.

Rust fails to acquire token if an error in build system occurs - environment variable contains incorrect `jobserver-auth`. It isn't ice so compiler shouldn't panic on such error.

Related issue: #46981
This commit is contained in:
Matthias Krüger 2023-03-29 06:02:42 +02:00 committed by GitHub
commit 09c139846b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -1452,8 +1452,8 @@ fn start_executing_work<B: ExtraBackendMethods>(
Err(e) => {
let msg = &format!("failed to acquire jobserver token: {}", e);
shared_emitter.fatal(msg);
// Exit the coordinator thread
panic!("{}", msg)
codegen_done = true;
codegen_aborted = true;
}
}
}

View File

@ -0,0 +1,8 @@
include ../../run-make-fulldeps/tools.mk
# only-linux
# Test compiler behavior in case: `jobserver-auth` points to correct pipe which is not jobserver.
all:
bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" $(RUSTC) - 3</dev/null' 2>&1 | diff jobserver.stderr -

View File

@ -0,0 +1,4 @@
error: failed to acquire jobserver token: early EOF on jobserver pipe
error: aborting due to previous error