diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 7ce72d2172799..2dda4cd169410 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -1452,8 +1452,8 @@ fn start_executing_work( 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; } } } diff --git a/tests/run-make/jobserver-error/Makefile b/tests/run-make/jobserver-error/Makefile new file mode 100644 index 0000000000000..3b9104fc35484 --- /dev/null +++ b/tests/run-make/jobserver-error/Makefile @@ -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&1 | diff jobserver.stderr - diff --git a/tests/run-make/jobserver-error/jobserver.stderr b/tests/run-make/jobserver-error/jobserver.stderr new file mode 100644 index 0000000000000..d18e15a262889 --- /dev/null +++ b/tests/run-make/jobserver-error/jobserver.stderr @@ -0,0 +1,4 @@ +error: failed to acquire jobserver token: early EOF on jobserver pipe + +error: aborting due to previous error +