diff options
author | Kéléfa Sané <kelefa.sane@smile.fr> | 2025-04-14 13:58:36 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-04-15 12:52:20 -0700 |
commit | ac086f2f510038a87c2b3fd94c9bf30dc859a844 (patch) | |
tree | 690edf345551f454f27e9ce0f46cd66c192a09a1 | |
parent | d6c334c52618e0aabd0f3e8989c0d7417a0a4ada (diff) | |
download | meta-openembedded-ac086f2f510038a87c2b3fd94c9bf30dc859a844.tar.gz |
multipath-tool: Fix reproducibility issue on libdmmp docs/man pages
Reproducibility test reveal different timestamp values in docs/man
pages. The root cause is due to the makefile target rule which update
the timestamp not always beeing executed, depending on the order, the
target (dmmp_strerror.3) and prerequisite (libdmmp.h) are written on the
disk during the clone of the repo.
Update recipe to set the KBUILD_BUILD_TIMESTAMP to reproducible
timestamp (SOURCE_DATE_EPOCH).
Signed-off-by: Kéléfa Sané <kelefa.sane@smile.fr>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 73 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/multipath-tools/files/0013-libdmmp-Makefile-Fix-KBUILD_BUILD_TIMESTAMP-usage.patch b/meta-oe/recipes-support/multipath-tools/files/0013-libdmmp-Makefile-Fix-KBUILD_BUILD_TIMESTAMP-usage.patch new file mode 100644 index 0000000000..4cca7decb8 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0013-libdmmp-Makefile-Fix-KBUILD_BUILD_TIMESTAMP-usage.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From bcb052a8dadbd0a837986b1e15924b469fc59edc Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?K=C3=A9l=C3=A9fa=20San=C3=A9?= <kelefa.sane@smile.fr> | ||
3 | Date: Thu, 3 Apr 2025 10:08:49 +0200 | ||
4 | Subject: [PATCH] libdmmp/Makefile: Fix KBUILD_BUILD_TIMESTAMP usage | ||
5 | |||
6 | Add missing $ (Makefile need to escape '$' as '$$') | ||
7 | |||
8 | Upstream-Status: Submitted [https://lore.kernel.org/dm-devel/20250404122902.2750036-1-sofiane.hamam@smile.fr/] | ||
9 | |||
10 | Signed-off-by: Yoann Congal <yoann.congal@smile.fr> | ||
11 | Signed-off-by: Sofiane HAMAM <sofiane.hamam@smile.fr> | ||
12 | Signed-off-by: Kelefa Sane <kelefa.sane@smile.fr> | ||
13 | --- | ||
14 | libdmmp/Makefile | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/libdmmp/Makefile b/libdmmp/Makefile | ||
18 | index 172ba045..7e0e2509 100644 | ||
19 | --- a/libdmmp/Makefile | ||
20 | +++ b/libdmmp/Makefile | ||
21 | @@ -74,7 +74,7 @@ doc: docs/man/dmmp_strerror.3 | ||
22 | docs/man/dmmp_strerror.3: $(HEADERS) | ||
23 | $(Q)TEMPFILE=$(shell mktemp); \ | ||
24 | cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \ | ||
25 | - [ "$KBUILD_BUILD_TIMESTAMP" ] || \ | ||
26 | + [ "$$KBUILD_BUILD_TIMESTAMP" ] || \ | ||
27 | KBUILD_BUILD_TIMESTAMP=`git log -n1 --pretty=%cd --date=iso -- $^`; \ | ||
28 | export KBUILD_BUILD_TIMESTAMP; \ | ||
29 | LC_ALL=C \ | ||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0014-libdmmp-Makefile-Add-target-docs-man-dmmp_strerror.3.patch b/meta-oe/recipes-support/multipath-tools/files/0014-libdmmp-Makefile-Add-target-docs-man-dmmp_strerror.3.patch new file mode 100644 index 0000000000..aad46c229b --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0014-libdmmp-Makefile-Add-target-docs-man-dmmp_strerror.3.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 6e231d887c20b2139db75e6dc6c20107273aaacd Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?K=C3=A9l=C3=A9fa=20San=C3=A9?= <kelefa.sane@smile.fr> | ||
3 | Date: Thu, 3 Apr 2025 10:25:30 +0200 | ||
4 | Subject: [PATCH] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to | ||
5 | .PHONY list | ||
6 | |||
7 | When cloning git repos, depending on the order of written to the disk, target | ||
8 | docs/man/dmmp_strerror.3 is more recent that the prerequisite | ||
9 | libdmmp/libdmmp.h this leads to a non reproducible behavior: | ||
10 | Sometimes, the timestamps are updated in the man pages, sometimes not. | ||
11 | |||
12 | Upstream-Status: Denied | ||
13 | |||
14 | https://lore.kernel.org/dm-devel/72355f1d0984647e91f8c50f1c2295071af49e33.camel@suse.com/ | ||
15 | The patch has been rejected by upstream, who will update the timestamps of the | ||
16 | manpages with a new commit. | ||
17 | In order to be reproducible without having a random result, forcing the target | ||
18 | rebuild by adding it to .PHONY is the more acceptable solution, the alternative | ||
19 | would have been to use the make -B option which consider all target has | ||
20 | obsolete and rebuild them all, which is less efficient. | ||
21 | |||
22 | Signed-off-by: Yoann Congal <yoann.congal@smile.fr> | ||
23 | Signed-off-by: Sofiane HAMAM <sofiane.hamam@smile.fr> | ||
24 | Signed-off-by: Kelefa Sane <kelefa.sane@smile.fr> | ||
25 | --- | ||
26 | libdmmp/Makefile | 2 +- | ||
27 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
28 | |||
29 | diff --git a/libdmmp/Makefile b/libdmmp/Makefile | ||
30 | index 7e0e2509..187bcb8c 100644 | ||
31 | --- a/libdmmp/Makefile | ||
32 | +++ b/libdmmp/Makefile | ||
33 | @@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden | ||
34 | LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread | ||
35 | |||
36 | all: $(LIBS) doc | ||
37 | -.PHONY: doc clean install uninstall check speed_test dep_clean | ||
38 | +.PHONY: doc clean install uninstall check speed_test dep_clean docs/man/dmmp_strerror.3 | ||
39 | |||
40 | $(LIBS): $(OBJS) | ||
41 | $(Q)$(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS) | ||
diff --git a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.11.1.bb b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.11.1.bb index 3037d0da8d..3443175d21 100644 --- a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.11.1.bb +++ b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.11.1.bb | |||
@@ -45,6 +45,8 @@ SRC_URI = "git://github.com/opensvc/multipath-tools.git;protocol=https;branch=st | |||
45 | file://0011-fix-bug-of-do_compile-and-do_install.patch \ | 45 | file://0011-fix-bug-of-do_compile-and-do_install.patch \ |
46 | file://0012-add-explicit-dependency-on-libraries.patch \ | 46 | file://0012-add-explicit-dependency-on-libraries.patch \ |
47 | file://0001-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch \ | 47 | file://0001-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch \ |
48 | file://0013-libdmmp-Makefile-Fix-KBUILD_BUILD_TIMESTAMP-usage.patch \ | ||
49 | file://0014-libdmmp-Makefile-Add-target-docs-man-dmmp_strerror.3.patch \ | ||
48 | " | 50 | " |
49 | 51 | ||
50 | LIC_FILES_CHKSUM = "file://COPYING;md5=9ec28527f3d544b51ceb0e1907d0bf3f" | 52 | LIC_FILES_CHKSUM = "file://COPYING;md5=9ec28527f3d544b51ceb0e1907d0bf3f" |
@@ -83,6 +85,7 @@ EXTRA_OEMAKE = 'MULTIPATH_VERSION=${PV} DESTDIR=${D} syslibdir=${base_libdir} \ | |||
83 | modulesloaddir=${sysconfdir}/modules-load.d \ | 85 | modulesloaddir=${sysconfdir}/modules-load.d \ |
84 | tmpfilesdir=${sysconfdir}/tmpfiles.d \ | 86 | tmpfilesdir=${sysconfdir}/tmpfiles.d \ |
85 | ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "SYSTEMD=216", "", d)} \ | 87 | ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "SYSTEMD=216", "", d)} \ |
88 | KBUILD_BUILD_TIMESTAMP="$(date -u -d "@$SOURCE_DATE_EPOCH" +"%Y-%m-%d %H:%M:%S +0000")" \ | ||
86 | ' | 89 | ' |
87 | 90 | ||
88 | do_install() { | 91 | do_install() { |