<?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>15515</bug_id>
          
          <creation_ts>2024-06-13 12:01:53 +0000</creation_ts>
          <short_desc>Improve oe.qa.handle_error not to depend on whole ERROR_QA and WARN_QA value</short_desc>
          <delta_ts>2024-09-03 10:47: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>OE-Core</product>
          <component>oe-core other</component>
          <version>unspecified</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>5.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Jansa">Martin.Jansa</reporter>
          <assigned_to name="Martin Jansa">Martin.Jansa</assigned_to>
          <cc>peter.kjellerstedt</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</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>99177</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2024-06-13 12:01:53 +0000</bug_when>
    <thetext>13:48 &lt; JaMa&gt; would it make sense to implement something like DISTRO_FEATURES_FILTER_NATIVE from 
              https://git.openembedded.org/openembedded-core/commit/?id=731744d5538e315702be828e6f2bd556309dee07 but for ERROR_QA and WARN_QA? I 
              have DISTROs with different ERROR_QA and they don&apos;s share -native sstate, because do_recipe_qa is different

13:50 &lt; JaMa&gt; when it was only used in do_package_qa then it was fine (as it didn&apos;t affect -native), but now with 
              meta/classes-global/insane.bbclass:addtask do_recipe_qa before do_fetch do_package_qa do_build it affects everything

13:54 &lt; JaMa&gt; or change it similarly as DISTRO_FEATURES that it changes signature only when one of the currently used ones is or isn&apos;t in 
              ERROR_QA (currently it uses missing-metadata, missing-maintainer, src-uri-bad)

13:55 &lt; RP&gt; JaMa: the latter sounds more attractive
13:55 &lt; JaMa&gt; if error_class in (d.getVar(&quot;ERROR_QA&quot;) or &quot;&quot;).split() replacing this with contains might help, right?
13:56 &lt; JaMa&gt; in meta/lib/oe/qa.py handle_error

13:56 &lt; RP&gt; JaMa: yes, that would be the right direction
13:56 &lt; JaMa&gt; ok, will add it to my TODO list</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99229</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2024-06-19 17:13:09 +0000</bug_when>
    <thetext>I&apos;ve updated 2 WIP commits in:
https://git.openembedded.org/openembedded-core-contrib/log/?h=jansa/master-qa

Unfortunately this still isn&apos;t enough, with this applied I still see
in bitbake-diffsigs output:
List of dependencies for variable ERROR_QA is []
List of dependencies for variable oe.qa.handle_error is [&apos;ERROR_QA&apos;, &apos;oe.qa.write_error&apos;]
Variable ERROR_QA value is dev-so debug-deps
Variable oe.qa.handle_error value is

Need to debug the parser a bit to find why it still tracks whole ERROR_QA.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99242</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2024-06-21 10:07:35 +0000</bug_when>
    <thetext>With some debug output added to codeparser.py I&apos;ve found that bb.utils.contains correctly ends in def visit_Call(self, node):
https://git.openembedded.org/bitbake/tree/lib/bb/codeparser.py?id=89712949de9476e4674864a8dcd6862fefe92eae#n261

                if name in self.containsfuncs and isinstance(node.args[1], ast.Constant):
                    if varname not in self.contains:
                        self.contains[varname] = set()
                    self.contains[varname].add(node.args[1].value)

But error_class variable isn&apos;t ast.Constant so it doesn&apos;t use this optimization and instead just adds whole ERROR_QA varname in:
https://git.openembedded.org/bitbake/tree/lib/bb/codeparser.py?id=89712949de9476e4674864a8dcd6862fefe92eae#n275

Not sure what we can do in this case without bigger changes to codeparser or how handle_error used (e.g. doing the contains first and then calling handle_error or handle_warn or handle_note, but that would make instane.bbclass terrible and won&apos;t even work in cases like:

meta/classes-global/insane.bbclass:        oe.qa.handle_error(w, warnings[w], d)
meta/classes-global/insane.bbclass:        oe.qa.handle_error(e, errors[e], d)

Please suggest if there is better way how to fix this (or to close as Won&apos;t Fix).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99276</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-06-27 14:35:23 +0000</bug_when>
    <thetext>Richard will take a deeper look at this but maybe not for 5.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99577</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-08-28 12:11:05 +0000</bug_when>
    <thetext>I&apos;ve added some code to bitbake which allows handle_error to be specially handled. This solves some of the issues in do_recipe_qa and do_populate_sysroot but we&apos;ll still have to rework insane to use string constants in the calls if we want things to work there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99578</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2024-08-28 12:18:39 +0000</bug_when>
    <thetext>https://lists.openembedded.org/g/bitbake-devel/message/16523
https://lists.openembedded.org/g/openembedded-core/message/203881
https://lists.openembedded.org/g/openembedded-core/message/203880

are the related changes now on ML.

Thanks RP!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99598</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-09-03 10:47:08 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/?id=be6a4145ea02bc472688a1e4b38a1d0b1f3b0d50 and the preceding patches mean ERROR_QA no longer causes unnecessary task rebuilds.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>