<?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>12873</bug_id>
          
          <creation_ts>2018-08-08 17:35:57 +0000</creation_ts>
          <short_desc>cpan_build.bbclass is broken (no dependency Module::Build)</short_desc>
          <delta_ts>2019-08-01 14:54:40 +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>devtools / tool chain</component>
          <version>2.3.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Backport to 2.6.x, 2.7.x</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.8 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pau Espin Pedrol">pespin.shar</reporter>
          <assigned_to name="Tim Orling">tim.orling</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>pespin.shar</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>tim.orling</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>81273</commentid>
    <comment_count>0</comment_count>
      <attachid>4356</attachid>
    <who name="Pau Espin Pedrol">pespin.shar</who>
    <bug_when>2018-08-08 17:35:57 +0000</bug_when>
    <thetext>Created attachment 4356
sample user of cpan_build.bbclass: libio-stty-perl_0.03.bb

As explained in IRC today:

&lt;pespin_&gt; hi, I&apos;m using a recipe which inherits cpan_build.bbclass but it fails at configure time with: &quot;Can&apos;t locate Module/Build.pm in @INC (you may need to install the Module::Build module)&quot;
&lt;pespin_&gt; I&apos;m indeed unable to find the Build.pm file in any sysroot
&lt;pespin_&gt; shouldn&apos;t the bbclass take care to install that one automatically? (using cpan.bbclass? I don&apos;t have much perl knowledge)
&lt;pespin_&gt; as far as I understand from cpan_build.bbclass, Module::Build used to be installed by perl-native but at some point it was dropped.
&lt;pespin_&gt; But it seems nobody provided a new recipe to install it from cpan in cpan_build.bbclass
&lt;pespin_&gt; here&apos;s a sample recipe using cpan_build if some else with more perl knowledge wants to give it a try: https://paste.debian.net/1037170/
&lt;pespin_&gt; because it seems no recipe in poky uses cpan_build.bbclass, that probably explains why it&apos;s broken?
&lt;pespin_&gt; in here it explains dropping Module::Build from perl core: http://www.dagolden.com/index.php/2140/paying-respect-to-modulebuild/
&lt;smurray&gt; pespin_: it looks like the meta-perl layer in meta-openembedded has libmodule-build-perl, and the one cpan_build user in there add DEPENDS += &quot;libmodule-build-perl-native&quot; to have things work
&lt;pespin_&gt; smurray, shouldn&apos;t that be in poky or oe-core then? otherwise the bbclass is broken
&lt;smurray&gt; pespin_: It does seem a bit odd, but if there are no users in oe-core, I suspect it&apos;s fallen through the cracks
&lt;pespin_&gt; smurray, not sure if the one in meta-openembedded works though, since libmodule-build-perl inherits cpan_build....
&lt;pespin_&gt; I think that libmodule-build-perl.bb should be changed to use cpan instead of cpan_build. Then revert this commit in poky: https://git.yoctoproject.org/cgit.cgi/poky/commit/meta/classes/cpan_build.bbclass?id=304ebe1fa2b05f62a15882095317044fd29c4c8d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81282</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2018-08-09 14:47:46 +0000</bug_when>
    <thetext>Richard requests that we move a single perl recipe from meta-oe to oe-core to test for this type of failure. It can be libio-stty-perl_0.03.bb or perhaps another recipe that also fails would be a better choice. By adding a single recipe, we&apos;ll avoid future regressions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81297</commentid>
    <comment_count>2</comment_count>
    <who name="Pau Espin Pedrol">pespin.shar</who>
    <bug_when>2018-08-09 21:04:34 +0000</bug_when>
    <thetext>Here&apos;s a proposed set of 3 patches to poky that allows me to build libio-stty-perl using cpan_build. You can find it in branch pespin/cpan of my poky.git fork in github [1]. The branch is on top of latest pyro, since it&apos;s the poky version I&apos;m currently using, but as far as I can see the issues are the same with master.

Please give them a review and some testing and provide feedback or fix them as needed. The changes I did to cpan.bbclass may break other perl recipes, I didn&apos;t try building other ones.


[1] https://github.com/pespin/poky/commits/pespin/cpan</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82734</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2019-01-10 16:12:17 +0000</bug_when>
    <thetext>I agree with Randy in Comment #1 that we need to have a recipe in oe-core that depends on libmodule-build-perl (and therefore moving libmodule-build-perl to oe-core will make sense).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82740</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2019-01-10 16:23:34 +0000</bug_when>
    <thetext>We should also have a test in oeqa that verifies the cpan_build.bbclass is functional.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82819</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2019-01-17 15:46:38 +0000</bug_when>
    <thetext>libmodule-build-perl itself inherits cpan_build, so that recipe alone might be enough. I am currently fighting ptests for libmodule-build-perl (it expects to run all tests from blib, rather than vendor_perl). All other lib&lt;foo&gt;-perl modules in oe-core have ptest enabled and passing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84224</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2019-06-17 22:19:57 +0000</bug_when>
    <thetext>Submitted as part of:
https://patchwork.openembedded.org/series/18187/

The actual moving of the recipe was trivial, but fixing perl-rdepends.txt, especially with ptest enabled, was a big chore. Nine of the tests fail (~5 are known failing upstream, the others are non-obvious cause: &quot;build_params&quot; missing and OUTPUT typemap issues).

We still need to decide if we need another recipe that inherits cpan_build in oe-core. I would also prefer oeselftest, but not sure how to approach that off the top of my head. Perhaps use the Simple example the libmodule-build-perl builds as part of its tests. Or perhaps the ptesting is enough?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84229</commentid>
    <comment_count>7</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-06-18 10:48:02 +0000</bug_when>
    <thetext>I think with basic ptests we get at least some coverage and that helps address some of my concerns that I had when this was originally discussed. A simple module that tests it would still be nice to have but not essential.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84566</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2019-08-01 14:54:40 +0000</bug_when>
    <thetext>I am going to mark this as resolved. The patches were merged.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4356</attachid>
            <date>2018-08-08 17:35:57 +0000</date>
            <delta_ts>2018-08-08 17:35:57 +0000</delta_ts>
            <desc>sample user of cpan_build.bbclass: libio-stty-perl_0.03.bb</desc>
            <filename>libio-stty-perl_0.03.bb</filename>
            <type>application/octet-stream</type>
            <size>449</size>
            <attacher name="Pau Espin Pedrol">pespin.shar</attacher>
            
              <data encoding="base64">REVTQ1JJUFRJT04gPSAiSW50ZXJmYWNlIHRvIHNlY3VyZSBwc2V1ZG8gdHR5cyIKU0VDVElPTiA9
ICJsaWJzIgpMSUNFTlNFID0gIkFydGlzdGljIHwgR1BMdjErIgpQUiA9ICJyMCIKCkxJQ19GSUxF
U19DSEtTVU0gPSAiZmlsZTovL01FVEEueW1sO21kNT02ZTBiM2MxNTMxZTdiZDdmMjU3ZmNiZDg4
NjU5MGQ4NCIKClNSQ19VUkkgPSAiaHR0cDovL3d3dy5jcGFuLm9yZy9tb2R1bGVzL2J5LW1vZHVs
ZS9JTy9JTy1TdHR5LSR7UFZ9LnRhci5neiIKClMgPSAiJHtXT1JLRElSfS9JTy1TdHR5LSR7UFZ9
IgoKaW5oZXJpdCBjcGFuX2J1aWxkCgpTUkNfVVJJW21kNXN1bV0gPSAiOTM2Mzg2YjM5OTY2MTM2
NzhkOGI2YTdmMGIwNDRmNjciClNSQ19VUklbc2hhMjU2c3VtXSA9ICI2OTI5NTI4ZGI4NWU4OWQy
M2E5NzYxZjQwMGI1YjY1NTVhZDVhOWViYTUyMDhiNjU5OTIzOTljOGJkODA5MTUyIgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>