If meson is already running under a jobserver (in MAKEFLAGS) when an external project is built, the make call will ignore it, as it always passes the equivalent of -j$(nproc) instead:
|
if self.supports_jobs_flag(): |
|
make_cmd.append(f'-j{determine_worker_count()}') |
We should check if MAKEFLAGS (and perhaps GNUMAKEFLAGS to not make the problem worse, though ninja and some others won't look at that) contains --jobserver-auth before adding -j ourselves.
You can see this with e.g (assuming the test fails to make it clear):
$ export MAKEFLAGS="--jobserver-auth=fifo:/dev/steve
$ ./run_single_test.py "./test cases/common/230 external project"
[...]
Build targets in project: 3
test external project undefined
User defined options
backend: ninja
libdir : lib
prefix : /usr
Found ninja-1.13.2 at /usr/bin/ninja
ninja: Jobserver mode detected: -j32 -l32 --jobserver-auth=fifo:/dev/steve
ninja explain: deps for 'libsomelib.so.p/func.c.o' are missing
[1/6] Compiling C object libsomelib.so.p/func.c.o
ninja explain: libsomelib.so.p/func.c.o is dirty
[2/6] Linking target libsomelib.so
ninja explain: deps for 'libfoo/libfoo.stamp' are missing
ninja explain: libsomelib.so is dirty
[2/6] Generating external project libfoo/libfoo
make: warning: -j32 forced in submake: resetting jobserver mode.
ninja explain: libsomelib.so is dirty
One can reproduce this with a make invocation that just runs meson too.
If meson is already running under a jobserver (in
MAKEFLAGS) when an external project is built, themakecall will ignore it, as it always passes the equivalent of-j$(nproc)instead:meson/mesonbuild/scripts/externalproject.py
Lines 50 to 51 in 14143be
We should check if
MAKEFLAGS(and perhapsGNUMAKEFLAGSto not make the problem worse, though ninja and some others won't look at that) contains--jobserver-authbefore adding-jourselves.You can see this with e.g (assuming the test fails to make it clear):
One can reproduce this with a make invocation that just runs meson too.