Skip to contentSkip to conversation

Remove automake patch that changes path to test-driver

PATCH New [email protected] 1 participant 7 messages Nov 13, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover Remove automake patch that changes path to test-driver

From: Ola x Nilsson <[email protected]>

Fixes [YOCTO #15635]

The automake patch
"Set relative to top_builddir path in Makefile to access" sets the default path of test-driver to $(top_builddir)/$(config_aux_dir) instead of the normal $(top_srcdir)/$(config_aux_dir).

This breaks check test for Automake projects in generated images.

To reproduce, use core-image-kernel-dev with git added.

git clone https://git.kernel.org/pub/scm/linux/kernel/git/kay/libabc.git
(cd libabc && ./autogen.sh)
mkdir build
cd build
../libabc/configure CFLAGS='-g -O0' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib make check

/bin/sh: ./build-aux/test-driver: No such file or directory

Removing the patch makes the checks complete successfully.

Some ptests depend on this patch to find test-driver. They need to be addressed individually. In all cases I've found so far this is just another sed substitution and should work even before removing the patch.

I have not verified the ptests in meta-openembedded yet, but I'm working on it.

Ola x Nilsson (6):
acl: Fix the ptest path to test-driver
attr: Fix the ptest path to test-driver
sed: Fix the ptest path to test-driver
parted: Fix the ptest path to test-driver
strace: Fix the ptest path to test-driver
automake: Remove patch that changes path to test-driver

 ...top_builddir-path-in-Makefile-to-acc.patch | 50 -------------------
 .../automake/automake_1.17.bb                 |  1 -
 meta/recipes-devtools/strace/strace_6.11.bb   |  4 +-
 meta/recipes-extended/parted/parted_3.6.bb    | 16 +++---
 meta/recipes-extended/sed/sed_4.9.bb          |  1 +
 meta/recipes-support/attr/acl_2.3.2.bb        | 10 ++--
 meta/recipes-support/attr/attr.inc            | 11 ++--
 7 files changed, 26 insertions(+), 67 deletions(-)
 delete mode 100644 meta/recipes-devtools/automake/automake/0005-Set-relative-to-top_builddir-path-in-Makefile-to-acc.patch
#1 lore raw

PATCH v2 1/6 acl: Fix the ptest path to test-driver

From: Ola x Nilsson <[email protected]>

Add a sed substitution for ${PTEST_PATH}/Makefile that transforms
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
to
TEST_LOG_DRIVER = $(SHELL) $(top_builddir)/build-aux/test-driver
which is where the test-driver script can be found when installed.

There used to be an oe-core automake patch to do this, but it broke non-ptest use of automake.

Relates to [YOCTO #15635]

---
 meta/recipes-support/attr/acl_2.3.2.bb | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meta/recipes-support/attr/acl_2.3.2.bb +6 -4
index 61784738738..dd959a5051b 100644
@@ -52,10 +52,12 @@ do_install_ptest() {
             -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
             -i ${D}${PTEST_PATH}/Makefile
 
-        sed -i "s|^srcdir =.*|srcdir = \.|g" ${D}${PTEST_PATH}/Makefile
-        sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" ${D}${PTEST_PATH}/Makefile
-        sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = \.\.|g" ${D}${PTEST_PATH}/Makefile
-        sed -i "s|^Makefile:.*|Makefile:|g" ${D}${PTEST_PATH}/Makefile
+        sed -e "s|^srcdir =.*|srcdir = .|" \
+	    -e "s|^abs_srcdir =.*|abs_srcdir = .|" \
+	    -e "s|^abs_top_srcdir =.*|abs_top_srcdir = ..|" \
+	    -e "s|^Makefile:.*|Makefile:|" \
+	    -e "/^TEST_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \
+	    -i ${D}${PTEST_PATH}/Makefile
 
         rm ${D}${PTEST_PATH}/.libs/libtestlookup.lai
 }
#2 lore raw

PATCH v2 2/6 attr: Fix the ptest path to test-driver

In reply to [email protected]

From: Ola x Nilsson <[email protected]>

Add a sed substitution for ${PTEST_PATH}/Makefile that transforms
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
to
TEST_LOG_DRIVER = $(SHELL) $(top_builddir)/build-aux/test-driver
which is where the test-driver script can be found when installed.

There used to be an oe-core automake patch to do this, but it broke non-ptest use of automake.

Relates to [YOCTO #15635]

---
 meta/recipes-support/attr/attr.inc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
meta/recipes-support/attr/attr.inc +7 -4
index 60339344015..5d6929fe507 100644
@@ -42,10 +42,13 @@ do_install_ptest() {
             -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
             -i ${D}${PTEST_PATH}/Makefile
 
-        sed -i "s|^srcdir =.*|srcdir = \.|g" ${D}${PTEST_PATH}/Makefile
-        sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" ${D}${PTEST_PATH}/Makefile
-        sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = \.\.|g" ${D}${PTEST_PATH}/Makefile
-        sed -i "s|^Makefile:.*|Makefile:|g" ${D}${PTEST_PATH}/Makefile
+	sed -e "s|^srcdir =.*|srcdir = .|" \
+	    -e "s|^abs_srcdir =.*|abs_srcdir = .|" \
+	    -e "s|^abs_top_srcdir =.*|abs_top_srcdir = ..|" \
+	    -e "s|^Makefile:.*|Makefile:|" \
+	    -e "/^TEST_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \
+	    -i ${D}${PTEST_PATH}/Makefile
+
 	cp -rf ${S}/build-aux/ ${D}${PTEST_PATH}
 	cp -rf ${S}/test/ ${D}${PTEST_PATH}
 }
#3 lore raw

PATCH v2 3/6 sed: Fix the ptest path to test-driver

In reply to [email protected]

From: Ola x Nilsson <[email protected]>

Add a sed substitution for ${PTEST_PATH}/Makefile that transforms
SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver PL_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
to
SH_LOG_DRIVER = $(SHELL) $(top_builddir)/build-aux/test-driver PL_LOG_DRIVER = $(SHELL) $(top_builddir)/build-aux/test-driver
which is where the test-driver script can be found when installed.

There used to be an oe-core automake patch to do this, but it broke non-ptest use of automake.

Relates to [YOCTO #15635]

---
 meta/recipes-extended/sed/sed_4.9.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/sed/sed_4.9.bb +1 -0
index c4d89c34b2a..b30ddc73ca6 100644
@@ -59,6 +59,7 @@ do_install_ptest() {
 	    -e 's:abs_srcdir =.*:abs_srcdir = ..:g' \
 	    -e 's:top_srcdir =.*:top_srcdir = ..:g' \
 	    -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+	    -e "/^\(PL\|SH\)_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \
 	    -i ${D}${PTEST_PATH}/Makefile
 }
 
#4 lore raw

PATCH v2 4/6 parted: Fix the ptest path to test-driver

In reply to [email protected]

From: Ola x Nilsson <[email protected]>

Add a sed substitution for ${PTEST_PATH}/tests/Makefile that transforms
SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
to
SH_LOG_DRIVER = $(SHELL) $(top_builddir)/build-aux/test-driver
which is where the test-driver script can be found when installed.

There used to be an oe-core automake patch to do this, but it broke non-ptest use of automake.

Relates to [YOCTO #15635]

---
 meta/recipes-extended/parted/parted_3.6.bb | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
meta/recipes-extended/parted/parted_3.6.bb +9 -7
index a537ef74dba..fae35815be9 100644
@@ -35,13 +35,15 @@ do_install_ptest() {
 	cp ${B}/tests/Makefile $t/tests/
 	mkdir $t/lib
 	cp ${B}/lib/config.h $t/lib
-	sed -i "s|^VERSION.*|VERSION = ${PV}|g" $t/tests/Makefile
-	sed -i "s|^srcdir =.*|srcdir = \.|g" $t/tests/Makefile
-	sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" $t/tests/Makefile
-	sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = "${PTEST_PATH}"|g" $t/tests/Makefile
-	sed -i "s|^abs_top_builddir =.*|abs_top_builddir = "${PTEST_PATH}"|g" $t/tests/Makefile
-	sed -i "s|^Makefile:.*|Makefile:|g" $t/tests/Makefile
-	sed -i "/^BUILDINFO.*$/d" $t/tests/Makefile
+	sed -e "s|^VERSION.*|VERSION = ${PV}|g" \
+	    -e "s|^srcdir =.*|srcdir = \.|g" \
+	    -e "s|^abs_srcdir =.*|abs_srcdir = \.|g" \
+	    -e "s|^abs_top_srcdir =.*|abs_top_srcdir = "${PTEST_PATH}"|g" \
+	    -e "s|^abs_top_builddir =.*|abs_top_builddir = "${PTEST_PATH}"|g" \
+	    -e "/^SH_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \
+	    -e "s|^Makefile:.*|Makefile:|g" \
+	    -e "/^BUILDINFO.*$/d" \
+	    -i $t/tests/Makefile
 	for i in print-align print-max print-flags dup-clobber duplicate fs-resize; \
 	  do cp ${B}/tests/.libs/$i $t/tests/; \
 	done
#5 lore raw

PATCH v2 5/6 strace: Fix the ptest path to test-driver

In reply to [email protected]

From: Ola x Nilsson <[email protected]>

Add a sed substitution for ${PTEST_PATH}/tests/Makefile that transforms
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
to
TEST_LOG_DRIVER = $(SHELL) $(top_builddir)/build-aux/test-driver
which is where the test-driver script can be found when installed.

There used to be an oe-core automake patch to do this, but it broke non-ptest use of automake.

Relates to [YOCTO #15635]

---
 meta/recipes-devtools/strace/strace_6.11.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/strace/strace_6.11.bb +3 -1
index 4ab78e7a9b9..1bc8aa99e71 100644
@@ -45,7 +45,9 @@ 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 -i -e '/^src/s/strace.*[0-9]/ptest/' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
+	sed -e '/^src/s/strace.*[0-9]/ptest/' \
+	    -e "/^TEST_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \
+	    -i ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
 }
 
 RDEPENDS:${PN}-ptest += "make coreutils grep gawk sed locale-base-en-us"
#6 lore raw

PATCH v2 6/6 automake: Remove patch that changes path to test-driver

In reply to [email protected]

From: Ola x Nilsson <[email protected]>

The patch "Set relative to top_builddir path in Makefile to access" sets the default path of test-driver to $(top_builddir)/$(config_aux_dir) instead of the normal $(top_srcdir)/$(config_aux_dir).

This breaks check test for Automake projects in generated images, and probably other places like SDKs.

A typical error would be

/bin/sh: ./build-aux/test-driver: No such file or directory

Removing the patch makes such checks complete successfully.

Fixes [YOCTO #15635]

---
 ...top_builddir-path-in-Makefile-to-acc.patch | 50 -------------------
 .../automake/automake_1.17.bb                 |  1 -
 2 files changed, 51 deletions(-)
 delete mode 100644 meta/recipes-devtools/automake/automake/0005-Set-relative-to-top_builddir-path-in-Makefile-to-acc.patch
meta/recipes-devtools/automake/automake/0005-Set-relative-to-top_builddir-path-in-Makefile-to-acc.patch deleted +0 -50
deleted file mode 100644
index a5bad068a45..00000000000
@@ -1,50 +0,0 @@
-From 4f576c10613b43cbbfcdf5a451d893faecd6fea9 Mon Sep 17 00:00:00 2001
-From: Adrian Calianu <[email protected]>
-Date: Thu, 25 Feb 2016 16:08:04 +0100
-Subject: [PATCH 5/6] Set relative to top_builddir path in Makefile to access
- test-driver
-
-Signed-off-by: Adrian Calianu <[email protected]>
-Upstream-Status: Inappropriate [specific to oe-core target ptest installation]
-Bug-Report: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19042
----
- bin/automake.in | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/bin/automake.in b/bin/automake.in
-index 18626de..3aa8706 100644
---- a/bin/automake.in
-+++ b/bin/automake.in
-@@ -325,6 +325,9 @@ my $config_aux_dir_set_in_configure_ac = 0;
- # $AM_CONFIG_AUX_DIR is prefixed with $(top_srcdir), so it can be used
- # in Makefiles.
- my $am_config_aux_dir = '';
-+# Directory used at runtime like running test-driver that should not
-+# depend on $(top_srcdir)
-+my $am_config_rt_aux_dir = '';
- 
- # Directory to search for AC_LIBSOURCE files, as set by AC_CONFIG_LIBOBJ_DIR
- # in configure.ac.
-@@ -4917,7 +4920,7 @@ sub handle_per_suffix_test
-     {
-       require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
-       define_variable ("${pfx}LOG_DRIVER",
--                       "\$(SHELL) $am_config_aux_dir/test-driver",
-+                       "\$(SHELL) $am_config_rt_aux_dir/test-driver",
-                        INTERNAL);
-     }
-   my $driver = '$(' . $pfx . 'LOG_DRIVER)';
-@@ -7554,6 +7557,10 @@ sub locate_aux_dir ()
-   $am_config_aux_dir =
-     '$(top_srcdir)' . ($config_aux_dir eq '.' ? "" : "/$config_aux_dir");
-   $am_config_aux_dir =~ s,/*$,,;
-+
-+  $am_config_rt_aux_dir =
-+    '$(top_builddir)' . ($config_aux_dir eq '.' ? "" : "/$config_aux_dir");
-+  $am_config_rt_aux_dir =~ s,/*$,,;
- }
- 
- 
--- 
-2.39.2
-
meta/recipes-devtools/automake/automake_1.17.bb +0 -1
index 27d8dfe1827..e22e51498bf 100644
@@ -23,7 +23,6 @@ SRC_URI += "\
            file://0002-automake-Update-for-python.m4-to-respect-libdir.patch \
            file://0003-build-fix-race-in-parallel-builds.patch \
            file://0004-Add-a-new-distro-feature-ptest.patch \
-           file://0005-Set-relative-to-top_builddir-path-in-Makefile-to-acc.patch \
            file://0006-automake-Remove-delays-in-configure-scripts-using-au.patch \
            "