<?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>15010</bug_id>
          
          <creation_ts>2023-01-18 11:17:37 +0000</creation_ts>
          <short_desc>native.bbclass is unable to clear unconditional overrides during dependency rewriting</short_desc>
          <delta_ts>2023-03-07 12:25:08 +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>unspecified</version>
          <rep_platform>All</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>4.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Enrico Jorns">ejo</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>ejo</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yocto</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>94749</commentid>
    <comment_count>0</comment_count>
    <who name="Enrico Jorns">ejo</who>
    <bug_when>2023-01-18 11:17:37 +0000</bug_when>
    <thetext>When using

  DEPENDS:append = &quot; something&quot;

in a recipe that uses BBCLASSEXTED += &quot;native&quot;, the generated DEPENDS list (after parsing the -native variant) will contain both &quot;something-native&quot; as well as &quot;something&quot;.

(The latter is then an unexpected target dependency in a -native recipe.)

What should happen instead is that the override (:append) gets cleared during `map_dependencies()` of native.bbclass. Instead, it is applied twice (once during native mapping, and again at the finalization of DEPENDS).

That the appends are not cleared is caused by 

   d.setVar(varname, &quot; &quot;.join(newdeps), parsing=True)

being called with &apos;parsing=True&apos; introduced by https://git.yoctoproject.org/poky/commit/meta/classes/native.bbclass?id=c4257ed8b1040a5a0e9a95846d81961741239116.

While not clearing overrides is valid for *conditional* overrides, it is not for *unconditional* ones.

However, at the moment there is no bitbake API allowing us to differentiate this.

One possible solution to this mentioned by RP in #yocto is implementing &apos;filters&apos; as proposed by JPEW: https://git.yoctoproject.org/poky-contrib/log/?h=jpew/bb-filters</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94781</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-01-20 12:50:12 +0000</bug_when>
    <thetext>I made some tests and it looks like for whatever reason we can now remove the parsing=True. I&apos;ll send a patch. Ultimately it would be better to switch to some filtering mechanism but that is for another day.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95071</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-03-07 12:25:08 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/meta/classes-recipe/native.bbclass?id=e3ada9938ce44f7b25e3040900a553fff8540008</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>