diff mbox series

vte: support reproducibility when debug build is enabled

Message ID 20251103064517.1211222-1-hongxu.jia@windriver.com
State New
Headers show
Series vte: support reproducibility when debug build is enabled | expand

Commit Message

Hongxu Jia Nov. 3, 2025, 6:45 a.m. UTC
When debug build is enabled, there is a build path issue in source file
which caused build is not reproducible
...subprojects/simdutf/simdutf.h...
 1 /* auto-generated on 2025-03-17 16:13:41 -0400. Do not edit! */
 2 /* begin file include/simdutf.h */
 3 // /build-dir/vte-0.82.1/subprojects/simdutf/include/simdutf.h:1
 4 #ifndef SIMDUTF_H
...subprojects/simdutf/simdutf.h...

The source file is auto generated by python script amalgamate.py,
apply a fix to the script to use relative path to instead

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...rt-reproducibility-for-debug-sources.patch | 48 +++++++++++++++++++
 meta/recipes-support/vte/vte_0.82.1.bb        |  4 +-
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/vte/vte/0001-support-reproducibility-for-debug-sources.patch
diff mbox series

Patch

diff --git a/meta/recipes-support/vte/vte/0001-support-reproducibility-for-debug-sources.patch b/meta/recipes-support/vte/vte/0001-support-reproducibility-for-debug-sources.patch
new file mode 100644
index 0000000000..20e8f71c0e
--- /dev/null
+++ b/meta/recipes-support/vte/vte/0001-support-reproducibility-for-debug-sources.patch
@@ -0,0 +1,48 @@ 
+From 0959004adbe46f88d558d2ce61b496c662c196f5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 3 Nov 2025 06:13:11 +0000
+Subject: [PATCH] support reproducibility for debug sources
+
+While option --debug-sources is used, the generated source file contains
+build path comments which caused the build is not reproducible [1]
+...subprojects/simdutf/simdutf.h...
+ 1 /* auto-generated on 2025-03-17 16:13:41 -0400. Do not edit! */
+ 2 /* begin file include/simdutf.h */
+ 3 // /build-dir/vte-0.82.1/subprojects/simdutf/include/simdutf.h:1
+ 4 #ifndef SIMDUTF_H
+...subprojects/simdutf/simdutf.h...
+
+After apply this commit, use relative path to instead
+...subprojects/simdutf/simdutf.h...
+ 1 /* auto-generated on 2025-03-17 16:13:41 -0400. Do not edit! */
+ 2 /* begin file include/simdutf.h */
+ 3 // include/simdutf.h:1
+ 4 #ifndef SIMDUTF_H
+...subprojects/simdutf/simdutf.h...
+
+[1] https://reproducible-builds.org/
+
+Upstream-Status: Submitted [https://github.com/simdutf/simdutf/pull/848]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ singleheader/amalgamate.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/singleheader/amalgamate.py b/singleheader/amalgamate.py
+index 190b2f6..75e0d78 100755
+--- a/singleheader/amalgamate.py
++++ b/singleheader/amalgamate.py
+@@ -385,7 +385,8 @@ def filter_features(file):
+                 current_features = None
+             elif enabled:
+                 if context.args.debug_sources and not prev_line.endswith('\\'):
+-                    yield f"// {file}:{lineno}"
++                    RELFILE = os.path.relpath(file, PROJECTPATH)
++                    yield f"// {RELFILE}:{lineno}"
+ 
+                 if line or (not line and prev_line):
+                     yield line
+-- 
+2.48.1
+
diff --git a/meta/recipes-support/vte/vte_0.82.1.bb b/meta/recipes-support/vte/vte_0.82.1.bb
index 4fa8115a20..b5d6f2fb62 100644
--- a/meta/recipes-support/vte/vte_0.82.1.bb
+++ b/meta/recipes-support/vte/vte_0.82.1.bb
@@ -17,7 +17,9 @@  GIR_MESON_OPTION = 'gir'
 GIDOCGEN_MESON_OPTION = "docs"
 inherit gnomebase gi-docgen features_check upstream-version-is-even gobject-introspection systemd vala
 
-SRC_URI += "file://0001-Add-W_EXITCODE-macro-for-non-glibc-systems.patch"
+SRC_URI += "file://0001-Add-W_EXITCODE-macro-for-non-glibc-systems.patch \
+            file://0001-support-reproducibility-for-debug-sources.patch;patchdir=./subprojects/simdutf \
+"
 
 SRC_URI[archive.sha256sum] = "79376d70402d271e2d38424418e1aea72357934d272e321e3906b71706a78e3a"