diff options
author | Paul Smith <psmith@gnu.org> | 2022-11-07 15:55:21 -0500 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-11-13 10:39:48 -0500 |
commit | 4c9d87f4ae938a20fc21d2a0538c74dad0518f20 (patch) | |
tree | 0e55d21729c36dfc04d56fbfb0d53126a210ee25 /tests | |
parent | bb5df351330e677892818bb3c7f962b606082278 (diff) | |
download | make-git-4c9d87f4ae938a20fc21d2a0538c74dad0518f20.tar.gz |
Keep going if we can't connect to the jobserver
* src/posixos.c (jobserver_parse_auth): Don't invoke fatal() if we
can't connect to an existing jobserver: just keep going without it.
* src/w32/w32os.c (jobserver_parse_auth): Ditto.
* tests/scripts/features/jobserver: Add a test for invalid FIFO
auth files.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/features/jobserver | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver index 8ecbe345..e12facf0 100644 --- a/tests/scripts/features/jobserver +++ b/tests/scripts/features/jobserver @@ -14,6 +14,7 @@ if (!$parallel_jobs) { # Shorthand my $np = '--no-print-directory'; +my $j1err = "warning: jobserver unavailable: using -j1. Add '+' to parent make rule."; # Simple test of MAKEFLAGS settings run_make_test(q! @@ -90,7 +91,7 @@ if ($port_type ne 'W32') { default: ; @ #MAKEPATH# -f Makefile2 !, "--jobserver-style=pipe -j2 $np", -"#MAKE#[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. +"#MAKE#[1]: $j1err #MAKE#[1]: Nothing to be done for 'foo'."); rmfiles('Makefile2'); @@ -98,15 +99,15 @@ default: ; @ #MAKEPATH# -f Makefile2 # For Windows and named pipes, we don't need to worry about recursion if ($port_type eq 'W32' || exists $FEATURES{'jobserver-fifo'}) { - create_file('Makefile2', "vpath %.c ../\n", "foo:\n"); + create_file('Makefile2', "vpath %.c ../\n", "foo:\n"); - run_make_test(q! + run_make_test(q! default: ; @ #MAKEPATH# -f Makefile2 !, "-j2 $np", "#MAKE#[1]: Nothing to be done for 'foo'."); - rmfiles('Makefile2'); + rmfiles('Makefile2'); } # Ensure enter/leave directory messages appear before jobserver warnings @@ -129,17 +130,17 @@ all: a all a: ; @echo $@ !, '--jobserver-style=foo -j8', - "#MAKE#: *** Unknown jobserver auth style 'foo'. Stop.", 512); - -# sv 62908. -# Test that when mkfifo fails, make switches to pipe and succeeds. -# Force mkfifo to fail by attempting to create a fifo in a non existent -# directory. -# run_make_test does not allow matching a multiline pattern, therefore run the -# test twice. -# First time look for /$ERR_no_such_file/ to ensure mkfifo failed. -# Second time look for /Nothing to be done/ to ensure make succeeded. + "#MAKE#: *** unknown jobserver auth style 'foo'. Stop.", 512); + if (exists $FEATURES{'jobserver-fifo'}) { + # sv 62908. + # Test that when mkfifo fails, make switches to pipe and succeeds. + # Force mkfifo to fail by attempting to create a fifo in a non existent + # directory. + # run_make_test does not allow matching a multiline pattern, therefore run + # the test twice. + # First time look for /$ERR_no_such_file/ to ensure mkfifo failed. + # Second time look for /Nothing to be done/ to ensure make succeeded. $ENV{TMPDIR} = "nosuchdir"; run_make_test("all:\n", '-j2', "/$ERR_no_such_file/"); @@ -155,6 +156,10 @@ recurse: ; @$(MAKE) -f #MAKEFILE# all all:;@echo "$$MAKEFLAGS" !, "-j2 --no-print-directory", "/--jobserver-auth=fifo:\\./"); + + # Verify we fall back to -j1 but continue, of the auth is bad. + $ENV{MAKEFLAGS} = '-j2 --jobserver-auth=fifo:nosuchfile'; + run_make_test(q!all:;@echo hi!, "", "#MAKE#: cannot open jobserver nosuchfile: $ERR_no_such_file\n#MAKE#: $j1err\nhi\n"); } 1; |