Skip to content

Commit 97091f2

Browse files
committed
rewrite jobserver-error to rmake
1 parent 9bad7ba commit 97091f2

File tree

3 files changed

+40
-18
lines changed

3 files changed

+40
-18
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ run-make/emit-to-stdout/Makefile
77
run-make/extern-fn-reachable/Makefile
88
run-make/incr-add-rust-src-component/Makefile
99
run-make/issue-84395-lto-embed-bitcode/Makefile
10-
run-make/jobserver-error/Makefile
1110
run-make/libs-through-symlinks/Makefile
1211
run-make/libtest-json/Makefile
1312
run-make/libtest-junit/Makefile

tests/run-make/jobserver-error/Makefile

-17
This file was deleted.
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// If the environment variables contain an invalid `jobserver-auth`, this used
2+
// to cause an ICE (internal compiler error) until this was fixed in #109694.
3+
// Proper handling has been added, and this test checks that helpful warnings
4+
// and errors are printed instead in case of a wrong jobserver.
5+
// See https://github.com/rust-lang/rust/issues/46981
6+
7+
// FIXME(Oneirical): The original test included this memo:
8+
// # Note that by default, the compiler uses file descriptors 0 (stdin), 1 (stdout), 2 (stderr),
9+
// # but also 3 and 4 for either end of the ctrl-c signal handler self-pipe.
10+
11+
// FIXME(Oneirical): only-linux ignore-cross-compile
12+
13+
use run_make_support::{diff, rfs, rustc};
14+
15+
fn main() {
16+
let out = rustc()
17+
.stdin("fn main() {}")
18+
.env("MAKEFLAGS", "--jobserver-auth=5,5")
19+
.run_fail()
20+
.stderr_utf8();
21+
diff().expected_file("cannot_open_fd.stderr").actual_text("actual", out).run();
22+
// FIXME(Oneirical): Find how to use file descriptor "3" with run-make-support
23+
// and pipe /dev/null into it.
24+
// Original lines:
25+
//
26+
// bash -c 'echo "fn main() {}" | makeflags="--jobserver-auth=3,3" $(rustc) - 3</dev/null' \
27+
// 2>&1 | diff not_a_pipe.stderr -
28+
// # this test randomly fails, see https://github.com/rust-lang/rust/issues/110321
29+
// disabled:
30+
// bash -c 'echo "fn main() {}" | makeflags="--jobserver-auth=3,3" $(rustc) - \
31+
// 3< <(cat /dev/null)' 2>&1 | diff poisoned_pipe.stderr -
32+
//
33+
// let out = rustc()
34+
// .stdin("fn main() {}")
35+
// .input("-")
36+
// .env("MAKEFLAGS", "--jobserver-auth=0,0")
37+
// .run()
38+
// .stderr_utf8();
39+
// diff().expected_file("not_a_pipe.stderr").actual_text("actual", out).run();
40+
}

0 commit comments

Comments
 (0)