openembedded-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [BUG] meta-perl: libcapture-tiny-perl-native installs into ${D}${STAGING_DIR_NATIVE} so Capture/Tiny.pm never reaches native sysroot
@ 2025-08-30 20:14 Joseph Mills
  2025-09-02  7:07 ` [oe] " Gyorgy Sarvari
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Mills @ 2025-08-30 20:14 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 3879 bytes --]

Hi all,

I’m seeing a native-packaging/sysroot staging issue with
libcapture-tiny-perl on current meta-perl.

Environment
Host: Debian sid (for reproducibility reports)
Poky: perl-native 5.38.4 (meta/recipes-devtools/perl/perl_5.38.4.bb)
meta-perl: libcapture-tiny-perl 0.48 (BBCLASSEXTEND = "native")
cpan.bbclass + perlnative.bbclass

Symptom (consumer fails to find Capture::Tiny in native sysroot)
A dependent native build (e.g. libunix-statgrab) dies with:

Can't locate Capture/Tiny.pm in @INC ...

In that consumer’s workdir:

$ find recipe-sysroot-native/usr/lib/perl5 -name Tiny.pm
# (empty)
$ find recipe-sysroot/usr/lib/perl5 -name Tiny.pm
.../vendor_perl/5.38.4/Capture/Tiny.pm   # target variant present

Provider logs (native variant)
libcapture-tiny-perl-native:do_install writes under an absolute path that
includes the provider’s recipe-sysroot-native:

NOTE: make -j 32 DESTDIR=.../libcapture-tiny-perl-native/0.48/image
install_vendor
Installing
.../image/.../recipe-sysroot-native/usr/lib/perl5/vendor_perl/5.38.4/Capture/Tiny.pm
Installing
.../image/.../recipe-sysroot-native/usr/share/man/man3/Capture::Tiny.3

So the file ends up at:
${D}${STAGING_DIR_NATIVE}/usr/lib/perl5/vendor_perl/5.38.4/Capture/Tiny.pm

instead of the expected:
${D}/usr/lib/perl5/vendor_perl/5.38.4/Capture/Tiny.pm

Because do_populate_sysroot stages from ${D}/usr/..., anything under
${D}${STAGING_DIR_NATIVE}/usr/... is skipped. The provider’s
recipe-sysroot-native thus lacks Capture/Tiny.pm, and dependents can’t use
Capture::Tiny.

Configure context
cpan.bbclass runs:

perl ... Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1 ...

For class-native, perl-native’s Config.pm advertises
installvendorlib/installvendorarch as absolute paths pointing into the
provider’s .../recipe-sysroot-native/usr/.... ExtUtils::MakeMaker then
combines those absolutes with DESTDIR=${D}, producing the
${D}${STAGING_DIR_NATIVE}/... install tree shown above.

Minimal reproduction
bitbake -c cleanall libcapture-tiny-perl-native
bitbake -c install libcapture-tiny-perl-native
# Observe absolute path under image/:
find tmp/work/*-linux/libcapture-tiny-perl-native/*/image -name 'Tiny.pm'
-print
# Observe absence in staged sysroot:
bitbake -c populate_sysroot libcapture-tiny-perl-native
find tmp/work/*-linux/libcapture-tiny-perl-native/*/recipe-sysroot-native
-name 'Tiny.pm' -print

Impact
Affects *-native CPAN modules that install into vendor_perl. Target builds
are fine; only native staging is affected. In downstream recipes this
presents as missing Capture/Tiny.pm (or similar CPAN modules) despite
correct DEPENDS.

Proposed direction
For class-native in cpan.bbclass, pass relative vendor install dirs to
Makefile.PL so DESTDIR=${D} lands under ${D}/usr/... (prefix-relative),
which do_populate_sysroot will stage as usual. For example:

#??? Conceptual sketch for class-native: ???
Makefile.PL ... \
  INSTALLVENDORLIB=${libdir}/perl5/vendor_perl/${perlver} \
  INSTALLVENDORARCH=${libdir}/perl5/vendor_perl/${perlver}/${perlhostarch}

That would keeps target behavior unchanged, and fixes native staging
without per-recipe hacks.
Workaround (recipe-local, for those blocked now) In a
libcapture-tiny-perl_%.bbappend limited to class-native, forcing relative
vendor paths at configure time unblocks the build:

EXTRA_CPANFLAGS:append:class-native = " \
    INSTALLVENDORLIB=${libdir}/perl5/vendor_perl/${@get_perl_version(d)} \

 INSTALLVENDORARCH=${libdir}/perl5/vendor_perl/${@get_perl_version(d)}/${@get_perl_hostarch(d)}
\
"
After that, do_install places Capture/Tiny.pm under
${D}/usr/lib/perl5/vendor_perl/..., and do_populate_sysroot stages it
correctly.

Happy to provide full logs/workdirs privately if needed. Thanks!

— Joseph Mills (jmills)

[-- Attachment #2: Type: text/html, Size: 4111 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [oe] [BUG] meta-perl: libcapture-tiny-perl-native installs into ${D}${STAGING_DIR_NATIVE} so Capture/Tiny.pm never reaches native sysroot
  2025-08-30 20:14 [BUG] meta-perl: libcapture-tiny-perl-native installs into ${D}${STAGING_DIR_NATIVE} so Capture/Tiny.pm never reaches native sysroot Joseph Mills
@ 2025-09-02  7:07 ` Gyorgy Sarvari
  0 siblings, 0 replies; 2+ messages in thread
From: Gyorgy Sarvari @ 2025-09-02  7:07 UTC (permalink / raw)
  To: josephjamesmills, openembedded-devel

On 8/30/25 22:14, Joseph Mills via lists.openembedded.org wrote:
> Hi all,
>
> I’m seeing a native-packaging/sysroot staging issue with
> libcapture-tiny-perl on current meta-perl.
>
> Environment
> Host: Debian sid (for reproducibility reports)
> Poky: perl-native 5.38.4 (meta/recipes-devtools/perl/perl_5.38.4.bb
> <http://perl_5.38.4.bb>)
> meta-perl: libcapture-tiny-perl 0.48 (BBCLASSEXTEND = "native")
> cpan.bbclass + perlnative.bbclass
>
> Symptom (consumer fails to find Capture::Tiny in native sysroot)
> A dependent native build (e.g. libunix-statgrab) dies with:
>
> Can't locate Capture/Tiny.pm in @INC ...
>
> In that consumer’s workdir:
>
> $ find recipe-sysroot-native/usr/lib/perl5 -name Tiny.pm
> # (empty)
> $ find recipe-sysroot/usr/lib/perl5 -name Tiny.pm
> .../vendor_perl/5.38.4/Capture/Tiny.pm   # target variant present
>
> Provider logs (native variant)
> libcapture-tiny-perl-native:do_install writes under an absolute path
> that includes the provider’s recipe-sysroot-native:
>
> NOTE: make -j 32 DESTDIR=.../libcapture-tiny-perl-native/0.48/image
> install_vendor
> Installing
> .../image/.../recipe-sysroot-native/usr/lib/perl5/vendor_perl/5.38.4/Capture/Tiny.pm
> Installing
> .../image/.../recipe-sysroot-native/usr/share/man/man3/Capture::Tiny.3
>
> So the file ends up at:
> ${D}${STAGING_DIR_NATIVE}/usr/lib/perl5/vendor_perl/5.38.4/Capture/Tiny.pm
>
> instead of the expected:
> ${D}/usr/lib/perl5/vendor_perl/5.38.4/Capture/Tiny.pm
>
> Because do_populate_sysroot stages from ${D}/usr/..., anything under
> ${D}${STAGING_DIR_NATIVE}/usr/... is skipped. The provider’s
> recipe-sysroot-native thus lacks Capture/Tiny.pm, and dependents can’t
> use Capture::Tiny.
>
> Configure context
> cpan.bbclass runs:
>
> perl ... Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1 ...
>
> For class-native, perl-native’s Config.pm advertises
> installvendorlib/installvendorarch as absolute paths pointing into the
> provider’s .../recipe-sysroot-native/usr/.... ExtUtils::MakeMaker then
> combines those absolutes with DESTDIR=${D}, producing the
> ${D}${STAGING_DIR_NATIVE}/... install tree shown above.
>
> Minimal reproduction
> bitbake -c cleanall libcapture-tiny-perl-native
> bitbake -c install libcapture-tiny-perl-native
> # Observe absolute path under image/:
> find tmp/work/*-linux/libcapture-tiny-perl-native/*/image -name
> 'Tiny.pm' -print
> # Observe absence in staged sysroot:
> bitbake -c populate_sysroot libcapture-tiny-perl-native
> find
> tmp/work/*-linux/libcapture-tiny-perl-native/*/recipe-sysroot-native
> -name 'Tiny.pm' -print
>
> Impact
> Affects *-native CPAN modules that install into vendor_perl. Target
> builds are fine; only native staging is affected. In downstream
> recipes this presents as missing Capture/Tiny.pm (or similar CPAN
> modules) despite correct DEPENDS.
>
> Proposed direction
> For class-native in cpan.bbclass, pass relative vendor install dirs to
> Makefile.PL so DESTDIR=${D} lands under ${D}/usr/...
> (prefix-relative), which do_populate_sysroot will stage as usual. For
> example:
>
> #??? Conceptual sketch for class-native: ???
> Makefile.PL ... \
>   INSTALLVENDORLIB=${libdir}/perl5/vendor_perl/${perlver} \
>   INSTALLVENDORARCH=${libdir}/perl5/vendor_perl/${perlver}/${perlhostarch}

This sounds like an issue in oe-core, not in meta-oe. I'm not a perl
user, personally I can't really comment on the overall soundness of
this, but why not prepare a patch and send it to the oe-core mailing list?

>
> That would keeps target behavior unchanged, and fixes native staging
> without per-recipe hacks.
> Workaround (recipe-local, for those blocked now) In a
> libcapture-tiny-perl_%.bbappend limited to class-native, forcing
> relative vendor paths at configure time unblocks the build:
>
> EXTRA_CPANFLAGS:append:class-native = " \
>     INSTALLVENDORLIB=${libdir}/perl5/vendor_perl/${@get_perl_version(d)} \
>    
>  INSTALLVENDORARCH=${libdir}/perl5/vendor_perl/${@get_perl_version(d)}/${@get_perl_hostarch(d)}
> \
> "
> After that, do_install places Capture/Tiny.pm under
> ${D}/usr/lib/perl5/vendor_perl/..., and do_populate_sysroot stages it
> correctly.
>
> Happy to provide full logs/workdirs privately if needed. Thanks!
>
> — Joseph Mills (jmills)
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#119150): https://lists.openembedded.org/g/openembedded-devel/message/119150
> Mute This Topic: https://lists.openembedded.org/mt/114982249/6084445
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-02  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-30 20:14 [BUG] meta-perl: libcapture-tiny-perl-native installs into ${D}${STAGING_DIR_NATIVE} so Capture/Tiny.pm never reaches native sysroot Joseph Mills
2025-09-02  7:07 ` [oe] " Gyorgy Sarvari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).