Skip to content

Commit 8b51b1f

Browse files
committedDec 8, 2014
avoid 'jobserver unavailable:' warnings
Under GNU make, an interaction between the top-level 'make -j N harness' and a make invoked by cpan/ExtUtils-Constant/t/Constant.t causes warnings like: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. Fix this by stopping MAKEFLAGS being inherited by the children. The other option, of prefixing all the '$(RUN_TESTS) choose' lines in Makefile.SH with '+' is, I suspect, not portable.
1 parent c28567d commit 8b51b1f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎runtests.SH

+15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ $spitshell >>runtests <<'!NO!SUBS!'
2828
2929
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
3030
31+
# Avoid "warning: jobserver unavailable: using -j1." warnings under GNU make.
32+
# When gmake -j N spawns a child, it passes
33+
# MAKEFLAGS=" --jobserver-fds=3,4 -j".
34+
# in the environment. Also, if make recognises that the child is another
35+
# make (e.g. it's invoked as $(MAKE) or +command), it keeps open fd's 3
36+
# and 4 to allow the child process to access the job server. Otherwise,
37+
# those fd's aren't kept open.
38+
# In the case where one does 'make -j 16 test_harness', this script is
39+
# called with MAKEFLAGS set, but fd's 3 and 4 closed. Later when
40+
# descendents of this script run cpan/ExtUtils-Constant/t/Constant.t
41+
# which itelf invokes make, the warnings ensue.
42+
43+
unset MAKEFLAGS
44+
45+
3146
case $# in
3247
0)
3348
echo "runtests tty_flag ..."

0 commit comments

Comments
 (0)