about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-03 16:28:22 +0000
committerbors <bors@rust-lang.org>2023-12-03 16:28:22 +0000
commitdb07cccb1e6b448eb1fec576096b587680e4ff69 (patch)
tree9e8ce5f2d1a586120a74c56d5e211c987bac4502 /tests
parent21d88b32cb5ff05b7a43c99e7c508bbbc65e036d (diff)
parent45e634234690a7d061e133b8cf9d31af34b29a0b (diff)
downloadrust-db07cccb1e6b448eb1fec576096b587680e4ff69.tar.gz
rust-db07cccb1e6b448eb1fec576096b587680e4ff69.zip
Auto merge of #113730 - belovdv:jobserver-init-check, r=petrochenkov
Report errors in jobserver inherited through environment variables

This pr attempts to catch situations, when jobserver exists, but is not being inherited.

r? `@petrochenkov`
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/jobserver-error/Makefile12
-rw-r--r--tests/run-make/jobserver-error/cannot_open_fd.stderr6
-rw-r--r--tests/run-make/jobserver-error/not_a_pipe.stderr4
-rw-r--r--tests/run-make/jobserver-error/poisoned_pipe.stderr (renamed from tests/run-make/jobserver-error/jobserver.stderr)0
4 files changed, 19 insertions, 3 deletions
diff --git a/tests/run-make/jobserver-error/Makefile b/tests/run-make/jobserver-error/Makefile
index 4a1699cc740..a7601b86715 100644
--- a/tests/run-make/jobserver-error/Makefile
+++ b/tests/run-make/jobserver-error/Makefile
@@ -1,9 +1,15 @@
 include ../tools.mk
 
 # only-linux
-# ignore-test: This test randomly fails, see https://github.com/rust-lang/rust/issues/110321
+# ignore-cross-compile
 
-# Test compiler behavior in case: `jobserver-auth` points to correct pipe which is not jobserver.
+# Test compiler behavior in case environment specifies wrong jobserver.
 
 all:
-	bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" $(RUSTC) - 3</dev/null' 2>&1 | diff jobserver.stderr -
+	bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" $(RUSTC)' 2>&1 | diff cannot_open_fd.stderr -
+	bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" $(RUSTC) - 3</dev/null' 2>&1 | diff not_a_pipe.stderr -
+
+# This test randomly fails, see https://github.com/rust-lang/rust/issues/110321
+disabled:
+	bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" $(RUSTC) - 3< <(cat /dev/null)' 2>&1 | diff poisoned_pipe.stderr -
+
diff --git a/tests/run-make/jobserver-error/cannot_open_fd.stderr b/tests/run-make/jobserver-error/cannot_open_fd.stderr
new file mode 100644
index 00000000000..343de5cd52c
--- /dev/null
+++ b/tests/run-make/jobserver-error/cannot_open_fd.stderr
@@ -0,0 +1,6 @@
+warning: failed to connect to jobserver from environment variable `MAKEFLAGS="--jobserver-auth=3,3"`: cannot open file descriptor 3 from the jobserver environment variable value: Bad file descriptor (os error 9)
+  |
+  = note: the build environment is likely misconfigured
+
+error: no input filename given
+
diff --git a/tests/run-make/jobserver-error/not_a_pipe.stderr b/tests/run-make/jobserver-error/not_a_pipe.stderr
new file mode 100644
index 00000000000..536c04576b9
--- /dev/null
+++ b/tests/run-make/jobserver-error/not_a_pipe.stderr
@@ -0,0 +1,4 @@
+warning: failed to connect to jobserver from environment variable `MAKEFLAGS="--jobserver-auth=3,3"`: file descriptor 3 from the jobserver environment variable value is not a pipe
+  |
+  = note: the build environment is likely misconfigured
+
diff --git a/tests/run-make/jobserver-error/jobserver.stderr b/tests/run-make/jobserver-error/poisoned_pipe.stderr
index d129db9bc67..d129db9bc67 100644
--- a/tests/run-make/jobserver-error/jobserver.stderr
+++ b/tests/run-make/jobserver-error/poisoned_pipe.stderr