Skip to contentSkip to conversation

perl: add more module RDEPENDS that don't get detected

PATCH In review Ross Burton 2 participants 5 messages Mar 24, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 perl: add more module RDEPENDS that don't get detected

These dependencies are in the source but the dependency generator does not see them.

---
 meta/recipes-devtools/perl/files/perl-rdepends.txt | 2 ++
 meta/recipes-devtools/perl/perl_5.40.0.bb          | 2 ++
 2 files changed, 4 insertions(+)
meta/recipes-devtools/perl/files/perl-rdepends.txt +2 -0
index 48e5a9de2f1..462456bba08 100644
@@ -1,6 +1,8 @@
 
 # Some additional dependencies that the above doesn't manage to figure out
+RDEPENDS:perl-module-file-path += "perl-module-file-spec"
 RDEPENDS:perl-module-file-spec += "perl-module-file-spec-unix"
+RDEPENDS:perl-module-file-spec += "perl-module-constant"
 RDEPENDS:perl-module-scalar-util += "perl-module-list-util"
 RDEPENDS:perl-module-file-temp += "perl-module-scalar-util"
 RDEPENDS:perl-module-file-temp += "perl-module-file-spec"
meta/recipes-devtools/perl/perl_5.40.0.bb +2 -0
index 30f2431f279..0d4338f29f7 100644
@@ -369,7 +369,9 @@ do_create_rdepends_inc() {
     cat <<'EOPREAMBLE' > ${WORKDIR}/perl-rdepends.inc
 
 # Some additional dependencies that the above doesn't manage to figure out
+RDEPENDS:${PN}-module-file-path += "${PN}-module-file-spec"
 RDEPENDS:${PN}-module-file-spec += "${PN}-module-file-spec-unix"
+RDEPENDS:${PN}-module-file-spec += "${PN}-module-constant"
 RDEPENDS:${PN}-module-scalar-util += "${PN}-module-list-util"
 RDEPENDS:${PN}-module-file-temp += "${PN}-module-scalar-util"
 RDEPENDS:${PN}-module-file-temp += "${PN}-module-file-spec"
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/4 attr: merge .bb and .inc

There's only one recipe using the .inc so the split is mostly pointless.

---
 meta/recipes-support/attr/attr.inc      | 76 -------------------------
 meta/recipes-support/attr/attr_2.5.2.bb | 75 +++++++++++++++++++++++-
 2 files changed, 74 insertions(+), 77 deletions(-)
 delete mode 100644 meta/recipes-support/attr/attr.inc
meta/recipes-support/attr/attr.inc deleted +0 -76
deleted file mode 100644
index 5d6929fe507..00000000000
@@ -1,76 +0,0 @@
-SUMMARY = "Utilities for manipulating filesystem extended attributes"
-DESCRIPTION = "Implement the ability for a user to attach name:value pairs to objects within the XFS filesystem."
-
-HOMEPAGE = "http://savannah.nongnu.org/projects/attr/"
-SECTION = "libs"
-
-DEPENDS = "virtual/libintl"
-
-LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later"
-LICENSE:${PN} = "GPL-2.0-or-later"
-LICENSE:lib${BPN} = "LGPL-2.1-or-later"
-LIC_FILES_CHKSUM = "file://doc/COPYING;md5=2d0aa14b3fce4694e4f615e30186335f \
-                    file://doc/COPYING.LGPL;md5=b8d31f339300bc239d73461d68e77b9c \
-                    file://tools/attr.c;endline=17;md5=be0403261f0847e5f43ed5b08d19593c \
-                    file://libattr/libattr.c;endline=17;md5=7970f77049f8fa1199fff62a7ab724fb"
-
-SRC_URI = "${SAVANNAH_GNU_MIRROR}/attr/${BP}.tar.gz \
-           file://run-ptest \
-           file://0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch \
-"
-
-inherit ptest update-alternatives autotools gettext
-
-PACKAGES =+ "lib${BPN}"
-
-FILES:lib${BPN} = "${libdir}/lib*${SOLIBS} ${sysconfdir}"
-
-ALTERNATIVE_PRIORITY = "100"
-ALTERNATIVE:${PN} = "setfattr getfattr"
-ALTERNATIVE_TARGET[setfattr] = "${bindir}/setfattr"
-ALTERNATIVE_TARGET[getfattr] = "${bindir}/getfattr"
-
-PTEST_BUILD_HOST_FILES = "builddefs"
-PTEST_BUILD_HOST_PATTERN = "^RPM"
-
-do_install_ptest() {
-        cp ${B}/Makefile ${D}${PTEST_PATH}
-        sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
-            -e 's|${DEBUG_PREFIX_MAP}||g' \
-            -e 's:${HOSTTOOLS_DIR}/::g' \
-            -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
-            -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
-            -i ${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}
-}
-
-do_install_ptest:append:libc-musl() {
-        sed -i -e 's|f: Operation n|f: N|g' ${D}${PTEST_PATH}/test/attr.test
-}
-
-RDEPENDS:${PN}-ptest = "attr \
-                        bash \
-                        coreutils \
-                        perl-module-constant \
-                        perl-module-filehandle \
-                        perl-module-getopt-std \
-                        perl-module-posix \
-                        make \
-                        perl \
-                        gawk \
-                        perl-module-cwd \
-                        perl-module-file-basename \
-                        perl-module-file-path \
-                        perl-module-file-spec \
-                        "
-
-BBCLASSEXTEND = "native nativesdk"
meta/recipes-support/attr/attr_2.5.2.bb +74 -1

79 lines not on this page · raw message

Signature · 1 line
2.43.0
#2 lore raw

Patchtest results for [PATCH 2/4] attr: merge .bb and .inc

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/2-4-attr-merge-.bb-and-.inc.patch

FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
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 src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)
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: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
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 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!

#3 lore raw

PATCH 3/4 attr: improve ptest packaging

In reply to Ross Burton

As there's just a few test binaries in attr, instead of installing large chunks of the build tree we can install just those and use a boilerplate test runner.

Also add a comment explaining why we have to sed the test suite if musl is used.

---
 meta/recipes-support/attr/attr/run-ptest | 34 +++++++++++++++-----
 meta/recipes-support/attr/attr_2.5.2.bb  | 40 +++++++-----------------
 2 files changed, 38 insertions(+), 36 deletions(-)
meta/recipes-support/attr/attr/run-ptest +27 -7
index 3e7a3a17a04..028671a9bde 100644
@@ -1,10 +1,30 @@
 #!/bin/sh
 
-set +e
-make test-suite.log
-exitcode=$?
-if [ $exitcode -ne 0 -a -e test-suite.log ]; then
-    cat test-suite.log
-fi
-exit $exitcode
+failed=0
+all=0
 
+for f in *.test; do
+    ./run $f
+    case "$?" in
+        0)
+            echo "PASS: $f"
+            all=$((all + 1))
+            ;;
+        77)
+            echo "SKIP: $f"
+            ;;
+        *)
+            echo "FAIL: $f"
+            failed=$((failed + 1))
+            all=$((all + 1))
+            ;;
+    esac
+done
+
+if [ "$failed" -eq 0 ] ; then
+    echo "All $all tests passed"
+    exit 0
+else
+    echo "$failed of $all tests failed"
+    exit 1
+fi
meta/recipes-support/attr/attr_2.5.2.bb +11 -29
index b1a20930ed7..390445b959f 100644
@@ -32,47 +32,29 @@ ALTERNATIVE:${PN} = "setfattr getfattr"
 ALTERNATIVE_TARGET[setfattr] = "${bindir}/setfattr"
 ALTERNATIVE_TARGET[getfattr] = "${bindir}/getfattr"
 
-PTEST_BUILD_HOST_FILES = "builddefs"
-PTEST_BUILD_HOST_PATTERN = "^RPM"
-
 do_install_ptest() {
-        cp ${B}/Makefile ${D}${PTEST_PATH}
-        sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
-            -e 's|${DEBUG_PREFIX_MAP}||g' \
-            -e 's:${HOSTTOOLS_DIR}/::g' \
-            -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
-            -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
-            -i ${D}${PTEST_PATH}/Makefile
+    install -m755 ${S}/test/run ${S}/test/sort-getfattr-output ${D}${PTEST_PATH}/
 
-	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}
+    for t in $(makefile-getvar ${S}/test/Makemodule.am TESTS); do
+        install -m644 ${S}/$t ${D}${PTEST_PATH}/
+    done
 }
 
 do_install_ptest:append:libc-musl() {
-        sed -i -e 's|f: Operation n|f: N|g' ${D}${PTEST_PATH}/test/attr.test
+    # With glibc strerror(ENOTSUP) is "Operation not supported" but
+    # musl is "Not supported".
+    # https://savannah.nongnu.org/bugs/?62370
+    sed -i -e 's|f: Operation not supported|f: Not supported|g' ${D}${PTEST_PATH}/attr.test
 }
 
 RDEPENDS:${PN}-ptest = "attr \
-                        bash \
-                        coreutils \
-                        perl-module-constant \
-                        perl-module-filehandle \
-                        perl-module-getopt-std \
-                        perl-module-posix \
-                        make \
                         perl \
-                        gawk \
                         perl-module-cwd \
                         perl-module-file-basename \
                         perl-module-file-path \
-                        perl-module-file-spec \
+                        perl-module-filehandle \
+                        perl-module-getopt-std \
+                        perl-module-posix \
                         "
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/4 acl: improve ptest packaging

In reply to Ross Burton

As there's a small number of test binaries in acl, instead of installing large chunks of the build tree we can install just those and use a boilerplate test runner.

Drop 0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch and replace with an explicit -DBASEDIR= flag passed at build time.

Drop 0001-test-patch-out-failing-bits.patch and delete the tests that fail entirely, as the lines that were being deleted in the patch were the key parts of the test.

Backport a patch from upstream so that some tests don't use excessive amounts of memory.

Add a patch to disable a single test which makes assumptions about how stdout and stderr interleave when read, which is dependent on the libc implementation. The tests assume glibc and musl behaves different, so instead of deleting the entire test file just remove the single test.

Clean up dependencies now that we're not shipping the build system.

---
 ...t_uid-fix-memory-wasting-loop-if-use.patch | 49 +++++++++++++++
 .../0001-test-patch-out-failing-bits.patch    | 60 ------------------
 ...dcode-the-build-path-into-a-helper-l.patch | 24 -------
 meta/recipes-support/attr/acl/run-ptest       | 37 +++++++----
 .../attr/acl/tests-not-musl.patch             | 47 ++++++++++++++
 meta/recipes-support/attr/acl_2.3.2.bb        | 62 +++++++------------
 6 files changed, 145 insertions(+), 134 deletions(-)
 create mode 100644 meta/recipes-support/attr/acl/0001-libmisc-__acl_get_uid-fix-memory-wasting-loop-if-use.patch
 delete mode 100644 meta/recipes-support/attr/acl/0001-test-patch-out-failing-bits.patch
 delete mode 100644 meta/recipes-support/attr/acl/0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch
 create mode 100644 meta/recipes-support/attr/acl/tests-not-musl.patch
meta/recipes-support/attr/acl/0001-libmisc-__acl_get_uid-fix-memory-wasting-loop-if-use.patch new file +49 -0
new file mode 100644
index 00000000000..5052bdaa2f1
@@ -0,0 +1,49 @@
+From 56abe432b65801f31277fb9a3bca0f9e31502315 Mon Sep 17 00:00:00 2001
+From: Matthias Gerstner <[email protected]>
+Date: Thu, 25 Apr 2024 12:43:49 +0200
+Subject: [PATCH] libmisc: __acl_get_uid(): fix memory wasting loop if user
+ does not exist
+
+I noticed that `acl_from_text()` unexpectedly returns ENOMEM for invalid
+user names. The reason for this is a missing break statement in the for
+loop in `__acl_get_uid()`, which causes the loop to act as if ERANGE was
+returned from `getpwnam_r()`, thereby exponentially increasing the
+buffer size to (in my case) multiple gigabytes, until `grow_buffer()`
+reports ENOMEM, which terminates the `__acl_get_uid()` function.
+
+This is a pretty costly "no such user" lookup that can disturb a
+process's heap memory management, but can also cause a process to fail
+e.g. if it is multithreaded and other threads encounter an ENOMEM,
+before `__acl_get_uid()` frees the gigantic heap buffer and returns.
+The allocated memory isn't actually used. Therefore on Linux it should
+not affect other processes by default, due to its overcommit memory
+and lazy memory allocation strategy.
+
+Fix this by properly terminating the for loop on any conditions except
+an ERANGE error being reported. The same break statement correctly
+exists in `__acl_get_gid()` already.
+
+Fixes: 3737f00 ("use thread-safe getpwnam_r and getgrnam_r")
+Signed-off-by: Andreas Gruenbacher <[email protected]>
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <[email protected]>
+---
+ libmisc/uid_gid_lookup.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libmisc/uid_gid_lookup.c b/libmisc/uid_gid_lookup.c
+index a4f21f6..74baab4 100644
+--- a/libmisc/uid_gid_lookup.c
++++ b/libmisc/uid_gid_lookup.c
+@@ -91,6 +91,7 @@ __acl_get_uid(const char *token, uid_t *uid_p)
+ 		if (err == ERANGE)
+ 			continue;
+ 		errno = err ? err : EINVAL;
++		break;
+ 	}
+ 	free(buffer);
+ 	return result ? 0 : -1;
+-- 
+2.43.0
+
meta/recipes-support/attr/acl/0001-test-patch-out-failing-bits.patch deleted +0 -60

60 lines not on this page · raw message

meta/recipes-support/attr/acl/0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch deleted +0 -24
deleted file mode 100644
index 748f37f3e7e..00000000000
@@ -1,24 +0,0 @@
-From 42ae3f8a5e32ba0681ccd1552a203ddad8748a6e Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Thu, 12 Dec 2019 13:45:52 +0100
-Subject: [PATCH] tests: do not hardcode the build path into a helper library
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- test/Makemodule.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/test/Makemodule.am b/test/Makemodule.am
-index e1d715d..cffe732 100644
---- a/test/Makemodule.am
-+++ b/test/Makemodule.am
-@@ -30,7 +30,7 @@ EXTRA_DIST += \
- check_LTLIBRARIES = libtestlookup.la
- 
- libtestlookup_la_SOURCES = test/test_passwd.c test/test_group.c
--libtestlookup_la_CFLAGS = -DBASEDIR=\"$(abs_srcdir)\"
-+libtestlookup_la_CFLAGS = -DBASEDIR=\"/tmp/acl-ptest\"
- libtestlookup_la_LDFLAGS = -rpath $(abs_builddir)
- 
- # Make sure translations don't break tests when matching output.
meta/recipes-support/attr/acl/run-ptest +26 -11
index 3af75c84fea..f28d8c12122 100644
@@ -1,16 +1,31 @@
 #!/bin/sh
-#
-#This script is used to run acl test suites
 
-#umask 077
+failed=0
+all=0
 
-mkdir -p /tmp/acl-ptest/test
-cp test/test.* /tmp/acl-ptest/test
 
-set +e
-make test-suite.log
-exitcode=$?
-if [ $exitcode -ne 0 -a -e test-suite.log ]; then
-    cat test-suite.log
+for f in *.test; do
+    LD_PRELOAD=$(pwd)/libtestlookup.so ./run $f
+    case "$?" in
+        0)
+            echo "PASS: $f"
+            all=$((all + 1))
+            ;;
+        77)
+            echo "SKIP: $f"
+            ;;
+        *)
+            echo "FAIL: $f"
+            failed=$((failed + 1))
+            all=$((all + 1))
+            ;;
+    esac
+done
+
+if [ "$failed" -eq 0 ] ; then
+    echo "All $all tests passed"
+    exit 0
+else
+    echo "$failed of $all tests failed"
+    exit 1
 fi
-exit $exitcode
meta/recipes-support/attr/acl/tests-not-musl.patch new file +47 -0

47 lines not on this page · raw message

meta/recipes-support/attr/acl_2.3.2.bb +23 -39

90 lines not on this page · raw message

Signature · 1 line
2.43.0