diff options
author | Yoann Congal <yoann.congal@smile.fr> | 2025-07-04 11:51:43 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-07-04 09:42:10 -0700 |
commit | 1c3a75acc03aa31ca013e5e3f4341ddd9ee9e667 (patch) | |
tree | 24056bc4cac49ce0ec4ee635e51b2996d6263c50 | |
parent | f64fa6252cee668131e895a63e9cf4fe3e9525c0 (diff) | |
download | meta-openembedded-1c3a75acc03aa31ca013e5e3f4341ddd9ee9e667.tar.gz |
gutenprint: fix a build race-condition
Gutenprint install hooks run in parallel but depend on each other. This
is a race condition and might trigger a build failure (e.g on AB [0]):
| chmod 700 $WORKDIR/image/usr/libexec/cups/backend/backend_gutenprint
| chmod: cannot access '$WORKDIR/image/usr/libexec/cups/backend/backend_gutenprint': Not a directory
| make[5]: *** [Makefile:2166: install-exec-hook] Error 1
Fixes this by adding an explicit dependency between the dependent
targets.
[0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/46/steps/33/logs/stdio
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-printing/gutenprint/gutenprint/0001-cups-fix-a-build-race-condition-around-empty-directo.patch | 60 | ||||
-rw-r--r-- | meta-oe/recipes-printing/gutenprint/gutenprint_5.3.4.bb | 4 |
2 files changed, 63 insertions, 1 deletions
diff --git a/meta-oe/recipes-printing/gutenprint/gutenprint/0001-cups-fix-a-build-race-condition-around-empty-directo.patch b/meta-oe/recipes-printing/gutenprint/gutenprint/0001-cups-fix-a-build-race-condition-around-empty-directo.patch new file mode 100644 index 0000000000..758acfe6be --- /dev/null +++ b/meta-oe/recipes-printing/gutenprint/gutenprint/0001-cups-fix-a-build-race-condition-around-empty-directo.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From e3b0952fe936f90cfda9cbed368fae2143b72089 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yoann Congal <yoann.congal@smile.fr> | ||
3 | Date: Thu, 3 Jul 2025 15:27:04 +0200 | ||
4 | Subject: [PATCH] cups: fix a build race-condition around empty directories | ||
5 | removal | ||
6 | |||
7 | In automake, install-exec and install-data happen in parallel. | ||
8 | install-exec installs executables and install-data finishes with | ||
9 | install-data-hook that removes empty directories. If install-data-hook | ||
10 | happen before install-exec finishes, it might remove a directory while | ||
11 | it is used by the install process and make it fail. | ||
12 | |||
13 | Fix this by adding an explicit dependency between install-data-hook and | ||
14 | install-exec. | ||
15 | |||
16 | For example, here is the log of such a failure: | ||
17 | | make install-data-hook | ||
18 | | hosttools/mkdir -p 'image/usr/libexec/cups/backend' | ||
19 | | make[5]: Entering directory '$WORKDIR/build/src/cups' | ||
20 | | Expect a number of "rmdir: Directory not empty" warnings | ||
21 | | /bin/bash ../../libtool --mode=install $HOSTTOOLS/install -c backend_gutenprint '$WORKDIR/image/usr/libexec/cups/backend' | ||
22 | # Start of the install process (from install-exec) | ||
23 | | These messages are harmless and should be ignored. | ||
24 | ... | ||
25 | | rmdir $WORKDIR/image/usr/libexec/cups/backend | ||
26 | # empty /usr/libexec/cups/backend is removed (from install-data-hook) | ||
27 | ... | ||
28 | | libtool: install: $HOSTTOOLS/install -c backend_gutenprint $WORKDIR/image/usr/libexec/cups/backend | ||
29 | # install in a non-existing directory: backend_gutenprint is installed | ||
30 | # as /usr/libexec/cups/backend (this is now a file instead of a | ||
31 | # directory) | ||
32 | | make install-exec-hook | ||
33 | | make[5]: Entering directory '$WORKDIR/build/src/cups' | ||
34 | | chmod 700 $WORKDIR/image/usr/libexec/cups/backend/backend_gutenprint | ||
35 | | chmod: cannot access '$WORKDIR/image/usr/libexec/cups/backend/backend_gutenprint': Not a directory | ||
36 | # chmod fails because /usr/libexec/cups/backend is a file and not a | ||
37 | # directory | ||
38 | | make[5]: *** [Makefile:2166: install-exec-hook] Error 1 | ||
39 | |||
40 | Signed-off-by: Yoann Congal <yoann.congal@smile.fr> | ||
41 | Upstream-Status: Submitted [https://sourceforge.net/p/gimp-print/mailman/gimp-print-devel/thread/20250703164244.1120340-1-yoann.congal%40smile.fr/#msg59202153] | ||
42 | --- | ||
43 | src/cups/Makefile.am | 3 ++- | ||
44 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
45 | |||
46 | diff --git a/src/cups/Makefile.am b/src/cups/Makefile.am | ||
47 | index 7928ee3..fe45c92 100644 | ||
48 | --- a/src/cups/Makefile.am | ||
49 | +++ b/src/cups/Makefile.am | ||
50 | @@ -206,8 +206,9 @@ uninstall-local: $(INSTALL_DATA_LOCAL_DEPS) $(INSTALL_BLACKLIST) | ||
51 | $(RM) -f "$(DESTDIR)$(cupsdata_blacklistdir)/net.sf.gimp-print.usb-quirks" | ||
52 | $(RM) -f "$(DESTDIR)$(pkglibdir)/backend/gutenprint$(GUTENPRINT_MAJOR_VERSION)$(GUTENPRINT_MINOR_VERSION)+usb" | ||
53 | |||
54 | -install-data-hook: | ||
55 | +install-data-hook: install-exec | ||
56 | # Remove unused directories in install tree | ||
57 | +# Note: it removes "exec" directories, so it must happen after install-exec. | ||
58 | -@echo 'Expect a number of "rmdir: Directory not empty" warnings' | ||
59 | -@echo 'These messages are harmless and should be ignored.' | ||
60 | -rmdir $(DESTDIR)$(cups_modeldir) | ||
diff --git a/meta-oe/recipes-printing/gutenprint/gutenprint_5.3.4.bb b/meta-oe/recipes-printing/gutenprint/gutenprint_5.3.4.bb index 5263890239..f90a123293 100644 --- a/meta-oe/recipes-printing/gutenprint/gutenprint_5.3.4.bb +++ b/meta-oe/recipes-printing/gutenprint/gutenprint_5.3.4.bb | |||
@@ -14,7 +14,9 @@ HOMEPAGE = "http://gimp-print.sourceforge.net/" | |||
14 | LICENSE = "GPL-2.0-or-later" | 14 | LICENSE = "GPL-2.0-or-later" |
15 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" | 15 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" |
16 | 16 | ||
17 | SRC_URI = "https://downloads.sourceforge.net/gimp-print/${BP}.tar.xz" | 17 | SRC_URI = "https://downloads.sourceforge.net/gimp-print/${BP}.tar.xz \ |
18 | file://0001-cups-fix-a-build-race-condition-around-empty-directo.patch \ | ||
19 | " | ||
18 | SRC_URI[sha256sum] = "db44a701d2b8e6a8931c83cec06c91226be266d23e5c189d20a39dd175f2023b" | 20 | SRC_URI[sha256sum] = "db44a701d2b8e6a8931c83cec06c91226be266d23e5c189d20a39dd175f2023b" |
19 | 21 | ||
20 | inherit autotools gettext pkgconfig | 22 | inherit autotools gettext pkgconfig |