<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13376</bug_id>
          
          <creation_ts>2019-06-04 16:03:26 +0000</creation_ts>
          <short_desc>Need better perl module dependency tooling</short_desc>
          <delta_ts>2026-04-23 14:59:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>5.99</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>IN PROGRESS IMPLEMENTATION</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>6.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Orling">tim.orling</reporter>
          <assigned_to name="Tim Orling">tim.orling</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yf3yu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84060</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2019-06-04 16:03:26 +0000</bug_when>
    <thetext>The core perl dependencies in perl-rdepends.txt are not sufficient for catching the runtime dependencies (as uncovered in ptests). Perl modules, i.e. in meta-oe and meta-perl, also have gaps in dependencies. Unfortunately, the way these dependencies are determined currently is a painfully slow, iterative process of build/run/test/repeat until all dependencies have been met. Testing includes simply running &quot;perl -m&lt;module::name&gt;&quot; or running ptests (which can be enabled with the ptest-perl.bbclass).

In #13200, RP mentioned the use of /usr/lib/rpm/perl.req from the rpm package, which does help catch some dependencies, but misses for instance dependencies that are conditional.

There are a number of tools on CPAN for dependency determination, including tools that cpan or cpanminus use themselves.

https://metacpan.org/pod/Module::ScanDeps
https://metacpan.org/pod/Carton
https://metacpan.org/release/Test-Prereq
https://metacpan.org/release/Module-Extract-Use
https://metacpan.org/release/Perl-PrereqScanner
https://metacpan.org/pod/release/RJBS/Dist-Zilla-5.048/lib/Dist/Zilla/Plugin/AutoPrereq.pm

Worth noting:
http://deps.cpantesters.org/

An informative stackoverflow discussion which uncovered most of the above:
https://stackoverflow.com/questions/358891/how-do-i-find-the-module-dependencies-of-my-perl-script/359687


It is worth mentioning that meta-cpan uses cpan itself to help determine dependencies, but is not in a state that would be ready to merge into oe-core.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89338</commentid>
    <comment_count>1</comment_count>
    <who name="Yi Fan Yu">yf3yu</who>
    <bug_when>2021-02-22 14:58:44 +0000</bug_when>
    <thetext>also interested for this to get a fix:

had to manually update perl dependencies for around an hour when updating tcdump. and it was highly frustrating because of modules depending on other modules.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89492</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2021-03-03 23:13:39 +0000</bug_when>
    <thetext>I have a proof-of-concept in the works [1]

This is a “simple” approach relying on perl.req from rpm. I described the workflow concept recently for lmsensors [2]

That issue highlights the need for an additional use case: perl in the shebang for a script in a {sub}package, which the current implementation would not catch. This would require a regex on every file installed.

This needs more work and time has been elusive, hence bumped to 3.4 (optimism).
In particular, the current approach only works for a clean build... package data is not populated in a usable fashion for sstate derived sysroots.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=timo/perl-deps_13376
[2] https://lists.yoctoproject.org/g/yocto/message/52570</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89493</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2021-03-03 23:23:23 +0000</bug_when>
    <thetext>I have another approach, implemented for recipetool/devtool [1] which relies on querying the metacpan [2] api [3]. This is also still just a proof-of-concept and needs more work.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=timo/recipetool-perl-v3
[2] https://metacpan.org/
[3] https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94235</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-10-24 22:41:58 +0000</bug_when>
    <thetext>Bump. Might get around to it again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94312</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-10-31 00:06:31 +0000</bug_when>
    <thetext>Super simple check for dependencies on target (in this case for libio-*-perl recipe):

for path in $(find /usr/lib/perl5/vendor_perl/5.36.0/IO -name *.pm | sed -e &apos;s~/usr/lib/perl5/vendor_perl/5.36.0/~~&apos; -e &apos;s~/~::~g&apos; -e &apos;s~.pm~~&apos;); do perl -M${path} -e&apos;print&apos;; done</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105224</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2026-04-23 14:59:22 +0000</bug_when>
    <thetext>Still valid. Moving to 6.99.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>