perl recipes: fix modules that fail to load
cover perl recipes: fix modules that fail to load
These Perl modules fail to load on target even with all their RDEPENDS installed, or their ptest fails:
- Curses: Curses.so is not linked against ncurses.
- Chipcard::PCSC: libpcsclite.so.1 is loaded with dlopen(), so nothing installs pcsc-lite-lib.
- Authen::SASL::Perl and Env: Tie::Handle and Tie::Array are missing from RDEPENDS.
- libunix-statgrab: the ptest misses Test::More, and t/00-load needs -T on the perl command line. With both fixed it passes, so move it to PTESTS_FAST_META_PERL.
This series applies on top of "[PATCH v2 00/26] perl recipes: add missing base, DynaLoader and other perl-module RDEPENDS", which touches the same libcurses-perl and libpcsc-perl recipes.
Tested on qemux86-64: the modules load in a core-image-minimal without perl-modules, and the libauthen-sasl-perl (15 pass, 2 skip) and libunix-statgrab (3 pass, 1 skip) ptests pass.
AI-Generated: Uses Claude Code (Claude Opus 5.5)
Tim Orling (5):
libcurses-perl: link Curses.so against ncurses
libpcsc-perl: add pcsc-lite-lib to RDEPENDS
libauthen-sasl-perl: add perl-module-tie-handle to RDEPENDS
libenv-perl: add perl-module-tie-array to RDEPENDS
libunix-statgrab: fix ptest
meta-oe/recipes-devtools/perl/libpcsc-perl_1.4.15.bb | 3 ++- meta-perl/conf/include/ptest-packagelists-meta-perl.inc | 2 +- .../recipes-perl/libauthen/libauthen-sasl-perl_2.2100.bb | 2 +- meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb | 9 ++++++++- meta-perl/recipes-perl/libenv/libenv-perl_1.04.bb | 2 ++ .../recipes-perl/libstatgrab/libunix-statgrab_0.112.bb | 7 +++++++ 6 files changed, 21 insertions(+), 4 deletions(-)
Signature · 1 line
2.47.3
PATCH 1/5 libcurses-perl: link Curses.so against ncurses
LIBS=-L${STAGING_LIBDIR} in EXTRA_CPANFLAGS replaces the libraries that Makefile.PL picks, so Curses.so is not linked against ncurses and fails to load on target:
Curses.so: undefined symbol: curscr
Makefile.PL also picks the library by looking at the host's /usr/include. Set CURSES_LIBTYPE, CURSES_CFLAGS and CURSES_LDFLAGS instead, which Makefile.PL reads, using ncursesw unless ENABLE_WIDEC is disabled, as the musl CFLAGS already do.
AI-Generated: Uses Claude Code (Claude Opus 5.5)
--- meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
meta-perl/recipes-perl/libcurses/libcurses-perl_1.46.bb +8 -1
@@ -17,7 +17,14 @@ SRC_URI[sha256sum] = "9631d6e3e2859c85913d8b8724f61fbebb9e932e9e50aa0493a4e02766 S = "${UNPACKDIR}/Curses-${PV}" -EXTRA_CPANFLAGS = "INC=-I${STAGING_INCDIR} LIBS=-L${STAGING_LIBDIR} TEST_SYMS_OPTS=-v" +EXTRA_CPANFLAGS = "TEST_SYMS_OPTS=-v" + +# Tell Makefile.PL which library to link, instead of letting it look in +# the host /usr/include +CURSES_LIBTYPE = "${@'ncursesw' if bb.utils.to_boolean((d.getVar('ENABLE_WIDEC') or 'True')) else 'ncurses'}" +export CURSES_LIBTYPE +export CURSES_CFLAGS = "-I${STAGING_INCDIR}" +export CURSES_LDFLAGS = "-L${STAGING_LIBDIR} -l${CURSES_LIBTYPE}" # enable NCURSES_WIDECHAR=1 only if ENABLE_WIDEC has not been explicitly disabled (e.g. by the distro config). # When compiling against the ncurses library, NCURSES_WIDECHAR needs to explicitly set to 0 in this case.
Signature · 1 line
2.47.3
PATCH 2/5 libpcsc-perl: add pcsc-lite-lib to RDEPENDS
In reply to Tim OrlingChipcard::PCSC loads libpcsclite.so.1 with dlopen() when the module is loaded, so the package gets no shared library dependency on it, and without pcsc-lite-lib installed the module fails with:
Failed to load PCSC library
AI-Generated: Uses Claude Code (Claude Opus 5.5)
--- meta-oe/recipes-devtools/perl/libpcsc-perl_1.4.15.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-devtools/perl/libpcsc-perl_1.4.15.bb +2 -1
@@ -19,6 +19,7 @@ inherit cpan pkgconfig DEPENDS += "pcsc-lite" -RDEPENDS:${PN} += "perl-module-carp perl-module-dynaloader" +# Chipcard::PCSC dlopen()s libpcsclite.so.1 +RDEPENDS:${PN} += "pcsc-lite-lib perl-module-carp perl-module-dynaloader" BBCLASSEXTEND = "native"
Signature · 1 line
2.47.3
PATCH 3/5 libauthen-sasl-perl: add perl-module-tie-handle to RDEPENDS
In reply to Tim OrlingAuthen::SASL::Perl does "require Tie::Handle" when it is loaded, but only the ptest package RDEPENDS on perl-module-tie-handle, so the module fails to load with "Can't locate Tie/Handle.pm" unless something else installs it.
AI-Generated: Uses Claude Code (Claude Opus 5.5)
--- meta-perl/recipes-perl/libauthen/libauthen-sasl-perl_2.2100.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-perl/recipes-perl/libauthen/libauthen-sasl-perl_2.2100.bb +1 -1
@@ -9,7 +9,7 @@ LICENSE = "Artistic-1.0 OR GPL-1.0-or-later" LIC_FILES_CHKSUM = "file://lib/Authen/SASL/Perl.pm;beginline=1;endline=3;md5=17123315bbcda19f484c07227594a609" DEPENDS = "perl" -RDEPENDS:${PN} = "libcrypt-urandom-perl libdigest-hmac-perl" +RDEPENDS:${PN} = "libcrypt-urandom-perl libdigest-hmac-perl perl-module-tie-handle" SRC_URI = "${CPAN_MIRROR}/authors/id/E/EH/EHUELS/Authen-SASL-${PV}.tar.gz \ file://run-ptest \
Signature · 1 line
2.47.3
PATCH 4/5 libenv-perl: add perl-module-tie-array to RDEPENDS
In reply to Tim OrlingEnv uses Tie::Array, but nothing in its RDEPENDS pulls in perl-module-tie-array, so the module fails to load with "Can't locate Tie/Array.pm" unless something else installs it. Found by the perl-rdeps QA check.
AI-Generated: Uses Claude Code (Claude Opus 5.5)
--- meta-perl/recipes-perl/libenv/libenv-perl_1.04.bb | 2 ++ 1 file changed, 2 insertions(+)
meta-perl/recipes-perl/libenv/libenv-perl_1.04.bb +2 -0
@@ -17,4 +17,6 @@ S = "${UNPACKDIR}/Env-${PV}" inherit cpan +RDEPENDS:${PN} += "perl-module-tie-array" + BBCLASSEXTEND = "native"
Signature · 1 line
2.47.3
PATCH 5/5 libunix-statgrab: fix ptest
In reply to Tim OrlingThe ptest fails on every test case:
- t/01-methods, t/02-hashlist and t/03-leak use Test::More, which is not in RDEPENDS:${PN}-ptest. Found by the perl-rdeps QA check.
- t/00-load has "#!perl -T", and run-ptest does not pass -T to perl. Drop the -T, so the test still checks that Unix::Statgrab loads.
With both fixed the ptest passes (3 pass, 1 skip), so move it from PTESTS_PROBLEMS_META_PERL to PTESTS_FAST_META_PERL.
AI-Generated: Uses Claude Code (Claude Opus 5.5)
--- meta-perl/conf/include/ptest-packagelists-meta-perl.inc | 2 +- .../recipes-perl/libstatgrab/libunix-statgrab_0.112.bb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
meta-perl/conf/include/ptest-packagelists-meta-perl.inc +1 -1
@@ -40,6 +40,7 @@ PTESTS_FAST_META_PERL = "\ libtest-warn-perl \ libtext-diff-perl \ libunicode-linebreak-perl \ + libunix-statgrab \ liburi-perl \ "
@@ -49,5 +50,4 @@ PTESTS_SLOW_META_PERL = "\ PTESTS_PROBLEMS_META_PERL = "\ libhtml-parser-perl \ - libunix-statgrab \ "
meta-perl/recipes-perl/libstatgrab/libunix-statgrab_0.112.bb +7 -0
@@ -38,3 +38,10 @@ do_configure:prepend() { # Toolchains forcibly define LD, so override it in the task export LD="${CCLD}" } + +do_install:prepend() { + # run-ptest does not pass -T, so drop it from the #! line + sed -i '1s/^#!perl -T$/#!perl/' ${B}/t/00-load.t +} + +RDEPENDS:${PN}-ptest += "perl-module-test-more"
Signature · 1 line
2.47.3