<?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>14807</bug_id>
          
          <creation_ts>2022-05-20 07:45:16 +0000</creation_ts>
          <short_desc>oe.utils.ImageQAFailed is not BBHandled</short_desc>
          <delta_ts>2024-09-23 09:57:57 +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>configuration</component>
          <version>4.0.1</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>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ola Nilsson">ola.x.nilsson</reporter>
          <assigned_to name="Ola Nilsson">ola.x.nilsson</assigned_to>
          <cc>louis.rannou</cc>
    
    <cc>richard.purdie</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>93288</commentid>
    <comment_count>0</comment_count>
    <who name="Ola Nilsson">ola.x.nilsson</who>
    <bug_when>2022-05-20 07:45:16 +0000</bug_when>
    <thetext>The code in meta/classes/image.bbclass do_image_qa indicates that image QA checks should raise oe.utils.ImageQAFailed exceptions when a problem is discovered.  

When the actual test function is executed by bb.utils.better_exec, there is no special handling for ImageQAFailed and better_exec will print the backtrace before forwarding the exception to do_image_qa to print the expected error messages. 

It&apos;s worth noting that the only image_qa_test in Poky -- license_qa_dead_symlink from meta/classes/license_image.bbclass -- does not use ImageQAException.  It uses bb.error instead.

The best solution might be to migrate to the oe.qa.handle_error function, except it might break existing image qa checks in other layers. 

Making ImageQAFailed inherit from BBHandledException would make better_exec ignore it.  But that would mean importing bb.utils into oe.utils which currently only imports standard library modules.  

Making better_exec aware of ImageQAFailed would reverse the import problem and better_exec should not need to know about image_qa specifics.

A more pythonic option might be to implement some kind of protocol where we make Exceptions indicate their bbhandled status with a object property somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93326</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-05-26 12:59:12 +0000</bug_when>
    <thetext>I&apos;d accept a patch to make ImageQAFailed inherit BBHandledException, that seems reasonable.

I also agree we should move to the oe.qa.handle_error function. I&apos;m not too worried about backwards compatibility for this code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99683</commentid>
    <comment_count>2</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2024-09-23 09:57:57 +0000</bug_when>
    <thetext>Fixed by 905e224849fbbed1719e0add231b00e2d570b3b4</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>