diff mbox series

[6/9] libc-test: Fix strptime and api/main tests

Message ID 20250821064528.754633-6-raj.khem@gmail.com
State New
Headers show
Series [v2,1/9] m4: Fix ptest on musl | expand

Commit Message

Khem Raj Aug. 21, 2025, 6:45 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../libc-test/0001-Fix-strptime-on-musl.patch | 53 +++++++++++++++++++
 ...-optional-obsolete-_PC-_SC-constants.patch | 44 +++++++++++++++
 meta/recipes-core/musl/libc-test_git.bb       |  4 ++
 3 files changed, 101 insertions(+)
 create mode 100644 meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch
 create mode 100644 meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch

Comments

patchtest@automation.yoctoproject.org Aug. 21, 2025, 7:04 a.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/6-9-libc-test-Fix-strptime-and-api-main-tests.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch b/meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch
new file mode 100644
index 00000000000..4c3a2cb21f1
--- /dev/null
+++ b/meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch
@@ -0,0 +1,53 @@ 
+From df26c5206c3234fd2df924cff7ef540af1f2077c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 19 Aug 2025 23:11:40 -0700
+Subject: [PATCH libc-test] Fix strptime on musl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+musl parses the digits for %s but does not populate struct tm
+(it's "parse-only" and intentionally has no effect on tm).
+That's why you get a zeroed-out date like 1900-01-00T00:00:00.
+This is current upstream behavior:
+
+case 's': /* Parse only. Effect on tm is unspecified and presently no effect is implemented.. */
+
+musl's strptime only accepts ±hhmm for %z (e.g., -0600).
+It does not accept ±hh or ±hh:mm. So '-06' fails by design.
+It can be seen that upstream only checks 4 digits after the sign.
+
+Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/08/20/2]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ AUTHORS                   | 1 +
+ src/functional/strptime.c | 4 +++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/AUTHORS b/AUTHORS
+index cf2a394..5e78ef7 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -6,3 +6,4 @@ Jens Gustedt
+ Alexander Monakov
+ Julien Ramseier
+ Alyssa Ross
++Khem Raj
+diff --git a/src/functional/strptime.c b/src/functional/strptime.c
+index b5f8977..f76fa68 100644
+--- a/src/functional/strptime.c
++++ b/src/functional/strptime.c
+@@ -109,10 +109,12 @@ int main() {
+ 
+ 	/* Glibc */
+ 	checkStrptime("1856-07-10", "%F", &tm4);
++#ifdef __GLIBC__
+ 	checkStrptime("683078400", "%s", &tm2);
++#endif
+ 	checkStrptimeTz("+0200", 2, 0);
+ 	checkStrptimeTz("-0530", -5, -30);
+-	checkStrptimeTz("-06", -6, 0);
++	checkStrptimeTz("-0600", -6, 0);
+ 
+ 	return t_status;
+ }
diff --git a/meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch b/meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch
new file mode 100644
index 00000000000..f5685953192
--- /dev/null
+++ b/meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch
@@ -0,0 +1,44 @@ 
+From 90515d553d03d1f0bec8a4bdf03d02626d3968bb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 19 Aug 2025 23:32:52 -0700
+Subject: [PATCH] api/unistd: guard optional/obsolete *_PC/*_SC constants for
+ musl
+
+musl does not define some POSIX option macros:
+- _SC_XOPEN_UUCP is obsolete and absent on musl
+- _PC_TIMESTAMP_RESOLUTION is optional and may be undefined
+
+Build currently fails when these are referenced unconditionally.
+Wrap the checks in #ifdef so the test compiles on musl without
+claiming support for unavailable names.
+
+Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/08/20/3]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/api/unistd.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/api/unistd.c b/src/api/unistd.c
+index 522ccdc..0de547b 100644
+--- a/src/api/unistd.c
++++ b/src/api/unistd.c
+@@ -114,7 +114,9 @@ C(_PC_REC_MIN_XFER_SIZE)
+ C(_PC_REC_XFER_ALIGN)
+ C(_PC_SYMLINK_MAX)
+ C(_PC_SYNC_IO)
++#ifdef _PC_TIMESTAMP_RESOLUTION
+ C(_PC_TIMESTAMP_RESOLUTION)
++#endif
+ C(_PC_VDISABLE)
+ C(_SC_2_C_BIND)
+ C(_SC_2_C_DEV)
+@@ -235,7 +237,9 @@ C(_SC_XOPEN_REALTIME_THREADS)
+ C(_SC_XOPEN_SHM)
+ C(_SC_XOPEN_STREAMS)
+ C(_SC_XOPEN_UNIX)
++#ifdef _SC_XOPEN_UUCP
+ C(_SC_XOPEN_UUCP)
++#endif
+ C(_SC_XOPEN_VERSION)
+ C(STDERR_FILENO)
+ C(STDIN_FILENO)
diff --git a/meta/recipes-core/musl/libc-test_git.bb b/meta/recipes-core/musl/libc-test_git.bb
index c3b562862ac..5ec307c25be 100644
--- a/meta/recipes-core/musl/libc-test_git.bb
+++ b/meta/recipes-core/musl/libc-test_git.bb
@@ -12,6 +12,8 @@  inherit ptest
 SRCREV = "f2bac7711bec93467b73bec1465579ea0b8d5071"
 SRC_URI = " \
     git://repo.or.cz/libc-test;branch=master;protocol=https \
+    file://0001-Fix-strptime-on-musl.patch \
+    file://0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch \
     file://run-ptest \
     file://run-libc-ptests \
 "
@@ -33,8 +35,10 @@  RDEPENDS:${PN} = " \
 
 RDEPENDS:${PN}-ptest = " \
      ${PN} \
+     locale-base-en-us \
      musl-staticdev \
      sed \
+     tzdata \
 "
 
 install_path = "/opt/${PN}"