Skip to contentSkip to conversation

kea: correctly eliminate build host paths from installed file

PATCH New Alexander Kanavin 1 participant 5 messages Jun 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 kea: correctly eliminate build host paths from installed file

From: Alexander Kanavin <[email protected]>

Only the ${B} part should be trimmed, not what follows (which is subject to change, depending on where the sources are).

---
 meta/recipes-connectivity/kea/kea_2.6.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/kea/kea_2.6.1.bb +1 -1
index ff7fb51fe0f..17e4378746d 100644
@@ -69,7 +69,7 @@ do_install:append() {
     sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@BASE_BINDIR@,${base_bindir},g' \
            -e 's,@LOCALSTATEDIR@,${localstatedir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' \
            ${D}${systemd_system_unitdir}/kea-dhcp*service ${D}${sbindir}/keactrl
-    sed -i "s:${B}/../${BPN}-${PV}:@abs_top_builddir_placeholder@:g" ${D}${sbindir}/kea-admin
+    sed -i "s:${B}:@abs_top_builddir_placeholder@:g" ${D}${sbindir}/kea-admin
 }
 
 do_install:append() {
Signature · 1 line
2.39.5
#1 lore raw

PATCH 2/5 systemtap: correctly set include location for the python module

From: Alexander Kanavin <[email protected]>

This issue was as well exposed by setting S to be in UNPACKDIR.

---
 ...am-use-absolute-path-for-source-dire.patch | 36 +++++++++++++++++++
 .../recipes-kernel/systemtap/systemtap_git.bb |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-kernel/systemtap/systemtap/0001-python-Makefile.am-use-absolute-path-for-source-dire.patch
meta/recipes-kernel/systemtap/systemtap/0001-python-Makefile.am-use-absolute-path-for-source-dire.patch new file +36 -0
new file mode 100644
index 00000000000..dacd19edd1d
@@ -0,0 +1,36 @@
+From 71e4ffd46dbbb7de1d06edb66f3e1fe0de423586 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Wed, 21 May 2025 13:25:46 +0200
+Subject: [PATCH] python/Makefile.am: use absolute path for source directory
+ includes as well
+
+Otherwise it would be relative to the build directory,
+which works only if the build and source directory are in the
+same parent directory, and breaks if they're on different levels.
+
+Upstream-Status: Submitted [by email to [email protected],[email protected],[email protected]]
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ python/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/python/Makefile.am b/python/Makefile.am
+index 9d5cb7bcb..130e90b24 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -2,10 +2,10 @@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+-# Note that we have to use 'abs_builddir' here since we change
++# Note that we have to use absolute directores here since we change
+ # directories back to the source directory when building the python
+ # extension.
+-AM_CPPFLAGS = -I$(srcdir)/../includes
++AM_CPPFLAGS = -I$(abs_srcdir)/../includes
+ AM_CPPFLAGS += -I$(abs_builddir)/../includes/sys
+ 
+ # Add OE's CFLAGS which contains `-fdebug-prefix-map' options to
+-- 
+2.39.5
+
meta/recipes-kernel/systemtap/systemtap_git.bb +1 -0
index 254bac4d6f9..588b3b8d36f 100644
@@ -9,6 +9,7 @@ require systemtap_git.inc
 SRC_URI += " \
            file://0001-improve-reproducibility-for-c-compiling.patch \
            file://0001-staprun-address-ncurses-6.3-failures.patch \
+           file://0001-python-Makefile.am-use-absolute-path-for-source-dire.patch \
            "
 
 DEPENDS = "elfutils"
Signature · 1 line
2.39.5
#2 lore raw

PATCH 3/5 piglit: replace setting PIGLIT_BUILD_DIR with a correct reproducibility fix

In reply to Alexander Kanavin

From: Alexander Kanavin <[email protected]>

PIGLIT_BUILD_DIR was set to source tree location relative to B as a reproducibility workaround some years ago. Aafter some investigation I found where the actual issue is (addressed by the patch).

Also, setting PIGLIT_BUILD_DIR relative to ${B} in a hardcoded way is problematic as S and B are not necessarily related that way (e.g. when sources are in UNPACKDIR or somewhere else entirely).

---
 ...r.py-modify-_command-and-not-command.patch | 32 +++++++++++++++++++
 meta/recipes-graphics/piglit/piglit_git.bb    |  3 +-
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-graphics/piglit/piglit/0001-tests-no_error.py-modify-_command-and-not-command.patch
meta/recipes-graphics/piglit/piglit/0001-tests-no_error.py-modify-_command-and-not-command.patch new file +32 -0
new file mode 100644
index 00000000000..f8600556e5d
@@ -0,0 +1,32 @@
+From 846efe923932d66810305b228fa09f83a172296d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Thu, 22 May 2025 17:34:15 +0200
+Subject: [PATCH] tests/no_error.py: modify _command and not command
+
+command getter function has hidden magic that prepends build paths;
+this is an undesirable side effect here, as we only want to append a parameter
+and not change anything else.
+
+In particular this avoids adding build paths to installed .xml.gz file,
+ensuring reproducibility. Xml writer is already using _command for the
+same reason.
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/1016]
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ tests/no_error.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/no_error.py b/tests/no_error.py
+index 4ecaa9a01..c64eec0a1 100644
+--- a/tests/no_error.py
++++ b/tests/no_error.py
+@@ -21,4 +21,4 @@ for name, test in itertools.chain(_profile1.test_list.items(),
+                                   _profile2.test_list.items()):
+     if isinstance(test, (PiglitGLTest, ShaderTest, MultiShaderTest)):
+         profile.test_list['{} khr_no_error'.format(name)] = test
+-        test.command += ['-khr_no_error']
++        test._command += ['-khr_no_error']
+-- 
+2.39.5
+
meta/recipes-graphics/piglit/piglit_git.bb +1 -2
index e30efdf33bd..dc210ff56d8 100644
@@ -12,6 +12,7 @@ SRC_URI = "git://gitlab.freedesktop.org/mesa/piglit.git;protocol=https;branch=ma
            file://0001-tests-Fix-narrowing-errors-seen-with-clang.patch \
            file://0001-CMakeLists.txt-do-not-obtain-wayland-scanner-path-fr.patch \
            file://0001-tests-egl-spec-make-egl_ext_surface_compression-cond.patch \
+           file://0001-tests-no_error.py-modify-_command-and-not-command.patch \
            "
 UPSTREAM_CHECK_COMMITS = "1"
 
@@ -48,8 +49,6 @@ PACKAGECONFIG[x11] = "-DPIGLIT_USE_X11=1 -DPIGLIT_BUILD_GL_TESTS=ON -DPIGLIT_BUI
 PACKAGECONFIG[vulkan] = "-DPIGLIT_BUILD_VK_TESTS=ON,-DPIGLIT_BUILD_VK_TESTS=OFF,glslang-native vulkan-loader,glslang"
 PACKAGECONFIG[wayland] = "-DPIGLIT_USE_WAYLAND=1,-DPIGLIT_USE_WAYLAND=0,wayland-native wayland wayland-protocols"
 
-export PIGLIT_BUILD_DIR = "../../../../git"
-
 do_configure:prepend() {
    if [ "${@bb.utils.contains('PACKAGECONFIG', 'freeglut', 'yes', 'no', d)}" = "no" ]; then
         sed -i -e "/^#.*include <GL\/freeglut_ext.h>$/d" ${S}/src/piglit/glut_wrap.h
Signature · 1 line
2.39.5
#3 lore raw

PATCH 4/5 strace: better sed expression for ptest Makefile

In reply to Alexander Kanavin

From: Alexander Kanavin <[email protected]>

The previous one wasn't particularly readable, and assumed a particular relationship between S and B. The new one also works when S is in UNPACKDIR, or anywhere else.

---
 meta/recipes-devtools/strace/strace_6.15.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/strace/strace_6.15.bb +1 -1
index d8ac2a53d09..2093c92eb31 100644
@@ -45,7 +45,7 @@ do_install_ptest() {
 	mkdir -p ${D}${PTEST_PATH}/src
 	install -m 755 ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
 	install -m 644 ${B}/src/config.h ${D}${PTEST_PATH}/src/
-	sed -e '/^src/s/strace.*[0-9]/ptest/' \
+	sed -e 's/^srcdir = .*/srcdir = ..\/..\/ptest\/tests/' \
 	    -e "/^TEST_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \
 	    -i ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
 }
Signature · 1 line
2.39.5
#4 lore raw

PATCH 5/5 m4: simplify path substitutions in ptest

In reply to Alexander Kanavin

From: Alexander Kanavin <[email protected]>

There's no need to setup a fake 'source directory' and redirect the tests to it; rather it's possible to point them directly to ptest directory (this needs to be done twice, in Makefile substitutions, and as a C define during ptest compilation).

This also eliminates the assumption that S and B are in the same directory (no longer true when S is in UNPACKDIR).

---
 meta/recipes-devtools/m4/m4-1.4.20.inc | 5 +----
 meta/recipes-devtools/m4/m4/run-ptest  | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)
meta/recipes-devtools/m4/m4-1.4.20.inc +1 -4
index a31335f173e..aad57b8b649 100644
@@ -27,7 +27,7 @@ EXTRA_OEMAKE += "'infodir=${infodir}'"
 do_compile_ptest() {
 	cd ${B}/tests
 	sed -i '/^buildtest-TESTS: /c buildtest-TESTS: $(TESTS) $(check_LIBRARIES) $(check_PROGRAMS)' Makefile
-	oe_runmake buildtest-TESTS
+	oe_runmake CPPFLAGS="-DSRCDIR=\\\"${PTEST_PATH}/tests/\\\"" buildtest-TESTS
 }
 
 do_install_ptest() {
@@ -39,9 +39,6 @@ do_install_ptest() {
                 chmod 0755 ${D}${PTEST_PATH}/tests/test-spawn-pipe-main \
                      ${D}${PTEST_PATH}/tests/test-spawn-pipe-child ${D}${PTEST_PATH}/tests/test-version-etc \
                      ${D}${PTEST_PATH}/tests/test-xalloc-die
-
-                ln -sf ptest ${D}${libdir}/${BPN}/${BP}
-                sed -i -e 's/@BP@/${BP}/g' ${D}${PTEST_PATH}/run-ptest
 }
 
 do_install_ptest:append:libc-glibc() {
meta/recipes-devtools/m4/m4/run-ptest +1 -1
index a91c372e541..da786e26f43 100644
@@ -2,4 +2,4 @@
 #
 #This script is used to run m4 test suites
 cd tests 
-make -k runtest-TESTS abs_aux_dir=../../@BP@/tests/build-aux abs_top_srcdir=../../@BP@/tests abs_srcdir=../../@BP@/tests top_srcdir=.. srcdir=.
+make -k runtest-TESTS abs_aux_dir=./build-aux abs_top_srcdir=. abs_srcdir=. top_srcdir=.. srcdir=.
Signature · 1 line
2.39.5