diff mbox series

busybox: Skip a non-posix awk ptest on musl systems

Message ID 20250511211411.1720365-1-raj.khem@gmail.com
State New
Headers show
Series busybox: Skip a non-posix awk ptest on musl systems | expand

Commit Message

Khem Raj May 11, 2025, 9:14 p.m. UTC
The test depends on BSD extension REG_STARTEND which
is not in POSIX, glibc does implement this extention so it
works on glibc systems. Therefore the patch to disable this test
is made musl specific

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...gsub-erroneous-word-start-match-test.patch | 29 +++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.37.0.bb   |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch

Comments

Alexander Kanavin May 12, 2025, 9:51 a.m. UTC | #1
On Sun, 11 May 2025 at 23:14, Khem Raj via lists.openembedded.org
<raj.khem=gmail.com@lists.openembedded.org> wrote:
>
> The test depends on BSD extension REG_STARTEND which
> is not in POSIX, glibc does implement this extention so it
> works on glibc systems. Therefore the patch to disable this test
> is made musl specific
             "
> +SRC_URI:append:libc-musl = "\
> +                            file://musl.cfg \
> +                            file://0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch"


Please no conditional inappropriate patches that disable things
unconditionally and add breakage and friction to version updates. Can
we rather fix the test itself to determine if the extension is
available, and skip if not so. Or add a configuration switch, or
preprocessor ifdef block, or something more maintainable.

Alex
diff mbox series

Patch

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
index 00000000000..37af192fb08
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch
@@ -0,0 +1,29 @@ 
+From d820b91e4bd8fde08b19a6e9aabf9624ab28b4d0 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: Inappropriate [ Musl-specific ]
+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..a2deadccd 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"$SKIP_KNOWN_BUGS" = x"" && testing 'awk gsub erroneous word start match' \
+ 	"awk 'BEGIN { a=\"abc\"; gsub(/\<b*/,\"\",a); print a }'" \
+ 	'abc\n' \
+ 	'' ''
diff --git a/meta/recipes-core/busybox/busybox_1.37.0.bb b/meta/recipes-core/busybox/busybox_1.37.0.bb
index c3131eb4531..5e1362f4b7c 100644
--- a/meta/recipes-core/busybox/busybox_1.37.0.bb
+++ b/meta/recipes-core/busybox/busybox_1.37.0.bb
@@ -54,6 +54,8 @@  SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://0002-start-stop-daemon-fix-tests.patch \
            file://0003-start-stop-false.patch \
            "
-SRC_URI:append:libc-musl = " file://musl.cfg"
+SRC_URI:append:libc-musl = "\
+                            file://musl.cfg \
+                            file://0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch"
 SRC_URI:append:x86-64 = " file://sha_accel.cfg"
 SRC_URI[tarball.sha256sum] = "3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4"