]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
busybox: Skip a non-posix awk ptest on musl systems
authorKhem Raj <raj.khem@gmail.com>
Thu, 24 Jul 2025 07:24:13 +0000 (00:24 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 28 Jul 2025 16:16:10 +0000 (17:16 +0100)
The test depends on BSD extension REG_STARTEND which
is not in POSIX, glibc does implement this extention so it
works on glibc systems but musl does not and it needs to
be skipped and LIBC environment variable is used in this
test as well to run it conditionally.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/busybox/busybox.inc
meta/recipes-core/busybox/busybox/0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch [new file with mode: 0644]
meta/recipes-core/busybox/busybox_1.37.0.bb
meta/recipes-core/busybox/files/run-ptest

index 4ebaeb92c97c8b210df9c03ee5e53e49b375a99a..c203f2f8f11e928bbada9403c5398d4cbc606bf8 100644 (file)
@@ -371,6 +371,7 @@ do_install_ptest () {
         rm -rf ${D}${PTEST_PATH}/testsuite/wget
        sort ${B}/.config > ${D}${PTEST_PATH}/.config
        ln -s ${base_bindir}/busybox   ${D}${PTEST_PATH}/busybox
+       sed -i -e 's|LIBC="<libc>"|LIBC=${TCLIBC}|g' ${D}${PTEST_PATH}/run-ptest
 }
 
 inherit update-alternatives
diff --git a/meta/recipes-core/busybox/busybox/0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch b/meta/recipes-core/busybox/busybox/0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch
new file mode 100644 (file)
index 0000000..18e57a8
--- /dev/null
@@ -0,0 +1,28 @@
+From 7ee04187bd59acc922982fb49e76ba6c39dd8a91 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 11 May 2025 08:36:54 -0700
+Subject: [PATCH] busybox: Add awk gsub erroneous word start match test to know fails on musl
+
+Musl does not implement this BSD extension REG_STARTEND and the test states
+that it will fail without this extention, therefore guard it with SKIP_KNOWN_BUGS
+so it can be ignored.
+
+Upstream-Status: Submitted [https://lists.busybox.net/pipermail/busybox/2025-July/091623.html]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testsuite/awk.tests | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testsuite/awk.tests b/testsuite/awk.tests
+index be25f6696..c56e217e8 100755
+--- a/testsuite/awk.tests
++++ b/testsuite/awk.tests
+@@ -612,7 +612,7 @@ b
+ # Currently we use REG_STARTEND ("This flag is a BSD extension, not present in POSIX")
+ # to implement the code to handle this correctly, but if your libc has no REG_STARTEND,
+ # the alternative code mishandles this case.
+-testing 'awk gsub erroneous word start match' \
++test x"$LIBC" != x"musl" && testing 'awk gsub erroneous word start match' \
+       "awk 'BEGIN { a=\"abc\"; gsub(/\<b*/,\"\",a); print a }'" \
+       'abc\n' \
+       '' ''
index 9f7ded3354d91868900eab496708c41144cc3f1b..bec25348b82e8ea423a59aa7b6f722aadd79ccbc 100644 (file)
@@ -55,7 +55,9 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://0003-start-stop-false.patch \
            file://0001-archival-disallow-path-traversals-CVE-2023-39810.patch \
            file://0001-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch \
+           file://0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch \
            "
 SRC_URI:append:libc-musl = " file://musl.cfg"
 SRC_URI:append:x86-64 = " file://sha_accel.cfg"
+
 SRC_URI[tarball.sha256sum] = "3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4"
index 76873c9de202b63192707536ea6d0f412f5de79c..957af36099d9dfe403e968051fe228b67ce2750c 100644 (file)
@@ -4,6 +4,6 @@ current_path=$(readlink -f $0)
 export bindir=$(dirname $current_path)
 export PATH=$bindir/bin:$PATH
 export SKIP_KNOWN_BUGS=1
-
+export LIBC="<libc>"
 cd testsuite || exit 1
 LANG=C.UTF-8 ./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/'