Skip to content

Commit

Permalink
Makefile: fix parallel compilation using inkscape
Browse files Browse the repository at this point in the history
Inkscape does DBus accesses at startup to look for other running
instances. The feature fails quite often for some obscure reason.
Disable it using (undocumented) SELF_CALL environment variable.

Code doing it in Inkscape:
https://gitlab.com/inkscape/inkscape/-/blob/a77b160f/src/inkscape-application.cpp#L557

They set it for their child extensions:
https://gitlab.com/inkscape/inkscape/-/blob/0b4d3151/src/extension/extension.cpp#L529-530

Found in a bug comment:
https://gitlab.com/inkscape/inkscape/-/issues/4716#note_1898150983

Computation of INKSCAPE_IS_NEW must be done using the same variable as
we do recursive make calls.

Before:

⟩ make clean
⟩ make -j20 full-linux-kernel-slides.pdf
make: *** [Makefile:271: <...PATH-TO-TRAINING-MATERIALS...>/out/./common/sd-card.pdf] Error 134
make: *** Waiting for unfinished jobs....
make: *** [Makefile:271: <...PATH-TO-TRAINING-MATERIALS...>/out/./common/qemu-logo.pdf] Error 134
make: *** [Makefile:269: <...PATH-TO-TRAINING-MATERIALS...>/out/./common/strace-c-output.pdf] Error 134
make: *** [Makefile:269: <...PATH-TO-TRAINING-MATERIALS...>/out/./agenda/qemu-logo.pdf] Error 134
make: *** [Makefile:269: <...PATH-TO-TRAINING-MATERIALS...>/out/./common/gdb-vs-gdbserver.pdf] Error 134
make: *** [Makefile:269: <...PATH-TO-TRAINING-MATERIALS...>/out/./common/logo-cc.pdf] Error 134
⟩ # note that failing targets is random and changes on each call

After:

⟩ make clean
⟩ make -j20 full-linux-kernel-slides.pdf
⟩ # works without errors

Signed-off-by: Théo Lebrun <[email protected]>
  • Loading branch information
tleb committed Jan 15, 2025
1 parent c1c51ee commit e16c791
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# See the README file for usage instructions

INKSCAPE = inkscape
# SELF_CALL avoids checking other instances, which fails with --jobs > 1.
# https://gitlab.com/inkscape/inkscape/-/issues/4716#note_1898150983
INKSCAPE = SELF_CALL=true inkscape
PDFLATEX = xelatex
DIA = dia
EPSTOPDF = epstopdf

INKSCAPE_IS_NEW = $(shell inkscape --version | grep -q "^Inkscape 1" && echo YES)
INKSCAPE_IS_NEW = $(shell $(INKSCAPE) --version | grep -q "^Inkscape 1" && echo YES)

ifeq ($(INKSCAPE_IS_NEW),YES)
INKSCAPE_PDF_OPT = -o
Expand Down

0 comments on commit e16c791

Please sign in to comment.