diff mbox series

[meta-webserver] cockpit: Fix a build race generating fail-html.c

Message ID 20250509232249.616767-1-raj.khem@gmail.com
State New
Headers show
Series [meta-webserver] cockpit: Fix a build race generating fail-html.c | expand

Commit Message

Khem Raj May 9, 2025, 11:22 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../recipes-webadmin/cockpit/cockpit_337.bb   |  1 +
 ...am-Create-src-common-directory-befor.patch | 34 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 meta-webserver/recipes-webadmin/cockpit/files/0001-Makefile-common.am-Create-src-common-directory-befor.patch
diff mbox series

Patch

diff --git a/meta-webserver/recipes-webadmin/cockpit/cockpit_337.bb b/meta-webserver/recipes-webadmin/cockpit/cockpit_337.bb
index b456fe1951..986a924fb5 100644
--- a/meta-webserver/recipes-webadmin/cockpit/cockpit_337.bb
+++ b/meta-webserver/recipes-webadmin/cockpit/cockpit_337.bb
@@ -7,6 +7,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 SRC_URI += " \
     https://github.com/cockpit-project/cockpit/releases/download/${PV}/cockpit-${PV}.tar.xz \
     file://0001-Warn-not-error-if-xsltproc-is-not-found.patch \
+    file://0001-Makefile-common.am-Create-src-common-directory-befor.patch \
     file://cockpit.pam \
     "
 SRC_URI[sha256sum] = "df51ef5920fae69e1b435f657376aa93772c0c1720b954a3bac10ebba26bfedf"
diff --git a/meta-webserver/recipes-webadmin/cockpit/files/0001-Makefile-common.am-Create-src-common-directory-befor.patch b/meta-webserver/recipes-webadmin/cockpit/files/0001-Makefile-common.am-Create-src-common-directory-befor.patch
new file mode 100644
index 0000000000..36cb6c09c7
--- /dev/null
+++ b/meta-webserver/recipes-webadmin/cockpit/files/0001-Makefile-common.am-Create-src-common-directory-befor.patch
@@ -0,0 +1,34 @@ 
+From fb3b427bcbc17257ac8c38438a82435b2bd36e38 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 9 May 2025 16:17:05 -0700
+Subject: [PATCH] Makefile-common.am: Create src/common directory before
+ generating fail-html.c
+
+During parallel builds, its possible that <build>/src/common directory is
+not yet created and this codepath to generate fail-html.c is executed and
+it will end in build failures
+
+Fixes
+ make[1]: Entering directory 'build/tmp/work/riscv64-yoe-linux/cockpit/337/build'
+   ../cockpit-337/tools/escape-to-c cockpit_webresponse_fail_html_text < ../cockpit-337/src/common/fail.html > src/common/fail-html.c.tmp && mv src/common/fail-html.c.tmp src/common/fail-html.c
+ /bin/bash: src/common/fail-html.c.tmp: No such file or directory
+ make[1]: *** [Makefile:6044: src/common/fail-html.c] Error 1
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/common/Makefile-common.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common/Makefile-common.am b/src/common/Makefile-common.am
+index ec4b30d..1d55576 100644
+--- a/src/common/Makefile-common.am
++++ b/src/common/Makefile-common.am
+@@ -94,6 +94,7 @@ libcockpit_common_a_SOURCES = \
+ # libcockpit-common.a static-links an HTML template to use on failures
+ nodist_libcockpit_common_a_SOURCES = src/common/fail-html.c
+ src/common/fail-html.c: src/common/fail.html
++	$(MKDIR_P) $(dir $@)
+ 	$(AM_V_GEN) $(top_srcdir)/tools/escape-to-c cockpit_webresponse_fail_html_text < $< > $@.tmp && mv $@.tmp $@
+ CLEANFILES += src/common/fail-html.c
+ EXTRA_DIST += src/common/fail.html