<?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>14054</bug_id>
          
          <creation_ts>2020-09-21 03:00:22 +0000</creation_ts>
          <short_desc>bitbake-layers allows adding invalid layer configuration</short_desc>
          <delta_ts>2021-02-11 15:23:12 +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>BitBake</product>
          <component>bitbake</component>
          <version>3.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88183</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-09-21 03:00:22 +0000</bug_when>
    <thetext>&apos;bitbake-layers add-layer&apos; doesn&apos;t validate the layer configuration before writing it:

$ bitbake-layers  show-layers
NOTE: Starting bitbake server...
layer                 path                                      priority
==========================================================================
meta                  /home/ross/Yocto/poky/meta                5
meta-poky             /home/ross/Yocto/poky/meta-poky           5
meta-yocto-bsp        /home/ross/Yocto/poky/meta-yocto-bsp      5


$ bitbake-layers add-layer ~/Yocto/meta-arm/meta-arm
NOTE: Starting bitbake server...

$ bitbake-layers  show-layers
NOTE: Starting bitbake server...
Traceback (most recent call last):
  File &quot;/home/ross/Yocto/poky/bitbake/bin/bitbake-layers&quot;, line 95, in &lt;module&gt;
    ret = main()
  File &quot;/home/ross/Yocto/poky/bitbake/bin/bitbake-layers&quot;, line 63, in main
    tinfoil.prepare(True)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/tinfoil.py&quot;, line 410, in prepare
    self.run_command(&apos;parseConfiguration&apos;)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/tinfoil.py&quot;, line 466, in run_command
    raise TinfoilCommandFailed(result[1])
bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last):
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/command.py&quot;, line 81, in runCommand
    result = command_method(self, commandline)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/command.py&quot;, line 281, in parseConfiguration
    command.cooker.parseConfiguration()
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/cooker.py&quot;, line 426, in parseConfiguration
    self.handleCollections(self.data.getVar(&quot;BBFILE_COLLECTIONS&quot;))
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/cooker.py&quot;, line 1255, in handleCollections
    raise CollectionError(&quot;Errors during parsing layer configuration&quot;)
bb.cooker.CollectionError: Errors during parsing layer configuration

The actual error (not visible, see bug 13183) is that meta-arm depends on meta-arm-toolchain.  This should have prevented adding meta-arm to the layers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88194</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-09-23 02:32:09 +0000</bug_when>
    <thetext>The issue is that it probably can&apos;t validate it without writing it, then the exception causes the rollback to fail?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88358</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-10-09 08:28:26 +0000</bug_when>
    <thetext>I see something a little different:

richard@jet$ bitbake-layers add-layer ../meta-arm/meta-arm
NOTE: Starting bitbake server...

richard@jet$ bitbake show-layers
ERROR: Layer &apos;meta-arm&apos; depends on layer &apos;arm-toolchain&apos;, but this layer is not enabled in your configuration

which release was this with?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88359</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-10-09 09:43:30 +0000</bug_when>
    <thetext>Obviously that should be &quot;bitbake-layers show-layers&quot; but it was confusing as the wrong command was showing me the error I wanted!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89213</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-02-11 15:23:12 +0000</bug_when>
    <thetext>Fixed with:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=7283a0b3b6ca49d0d2e13593333a580ef10439a8
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=df90345d33730003300159e0c3e55c0efc61c7c2

so now the layer is not added if dependencies are not met.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>