<?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>4396</bug_id>
          
          <creation_ts>2013-04-23 09:23:27 +0000</creation_ts>
          <short_desc>Some bb.error should be bb.warn</short_desc>
          <delta_ts>2013-09-05 07:27:30 +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>core</component>
          <version>1.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.yoctoproject.org/show_bug.cgi?id=3190</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.5 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>marcin</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</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>32514</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-04-23 09:23:27 +0000</bug_when>
    <thetext>From the bitbake-devel mailing list:

Marcin Juszkiewicz wrote:
&gt; There is one thing which kind of bothers me. &quot;ERROR&quot; message which is
&gt; just a warning. Like:
&gt;
&gt; ERROR: libelf is listed in PACKAGES multiple times, this leads to packaging errors.
&gt; ERROR: libasm is listed in PACKAGES multiple times, this leads to packaging errors.
&gt; ERROR: libdw is listed in PACKAGES multiple times, this leads to packaging errors.
&gt; ERROR: libdw-dev is listed in PACKAGES multiple times, this leads to packaging errors.
&gt; ERROR: libasm-dev is listed in PACKAGES multiple times, this leads to packaging errors.
&gt; ERROR: libelf-dev is listed in PACKAGES multiple times, this leads to packaging errors.
&gt;
&gt; If it is error then let BitBake exit instead of doing task. If it is
&gt; not error but just a warning then let it be renamed?

RP&apos;s reply:

What we&apos;re trying to do is move everything to use a standard mechanism
for reporting issues of this type. With insane.bbclass, you can elect
whether a given type of error is a warning or errors and fails the task.

There are however several places where bb.error is used without that
mechanism. I&apos;d love to see them fixed, please file a bug for it...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32637</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2013-04-25 14:43:37 +0000</bug_when>
    <thetext>These use the QA_WARNING mechanism, which allows it to be selected if it&apos;s a warning or error which will correctly allow the build to continue or stop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32640</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2013-04-25 14:49:58 +0000</bug_when>
    <thetext>*** Bug 4397 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32934</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-05-08 06:08:34 +0000</bug_when>
    <thetext>Hi Saul / RP:

Here is the design, please help me to take a look at it since I&apos;m not sure whether I have got the point:

Summary:
Use package_qa_handle_error() to replace bb.error() and bb.warn() in insane.bbclass in package.bbclass and insane.bbclass (will we do this for other bbclass?), the package_qa_handle_error() respects the WARN_QA and ERROR_QA well.

Steps:
Define a name for the bb.error() or bb.warn() message, add it to ERROR_QA or WARN_QA,e.g., we have the following code in insane.bbclass:


def package_qa_check_license(workdir, d): 
    [snip]
    if not lic_files:
        bb.error(pn + &quot;: Recipe file does not have license file information (LIC_FILES_CHKSUM)&quot;)
        return False
    [snip]

We can change it to:

# Define this message to &quot;license&quot; and add it to ERROR_QA (since it&apos;s bb.error())
ERROR_QA += &quot;license&quot;

def package_qa_check_license(workdir, d): 
    [snip]
    if not lic_files:
        package_qa_handle_error (&quot;license&quot;, pn + &quot;: Recipe file does not have license file information (LIC_FILES_CHKSUM)&quot;, d)
    [snip]


This is similar to another case 3190</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32937</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-05-08 09:14:37 +0000</bug_when>
    <thetext>The idea looks right and this should let us solve the simpler cases. 

In package.bbclass we might have an issue calling functions from insane.bbclass and we may need to move exceplictly agree that insane.bbclass is no longer optional and is becomes a requirement (always included). That shouldn&apos;t be a big issue, we just need to consciously decide it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33717</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-06-08 03:08:27 +0000</bug_when>
    <thetext>Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=43713b9e17707992569d807cdd61aaaf969ec6fc
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b4371dd0e41713979b59875fff8d8724761b69d1
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=829d6bf005882137aeea397fa1896285a17bee72
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=5a0f74ac0418e219c6127e7906fd550a15809920</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36317</commentid>
    <comment_count>6</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2013-09-05 07:27:30 +0000</bug_when>
    <thetext>Verified.

Test case:

Steps:
1. Add the following lines to a .bb file. For expample, gzip_1.6.bb:
PACKAGES += &quot;${PN}-dbg&quot;

2. Run &quot;bitbake gzip&quot;

3. Modify the meta-yocto/conf/distro/poky.conf. Move the &quot;packages-list&quot; from ERROR_QA to WARN_QA. Run &quot;bitbake gzip&quot; again.

Expected results:
In step 2, the build should failed and show the following error:
########################
ERROR: QA Issue: gzip-dbg is listed in PACKAGES multiple times, this leads to packaging errors.
ERROR: QA run found fatal errors. Please consider fixing them.
ERROR: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /buildarea1/yzhao1/poky/build-test/tmp/work/i586-poky-linux/gzip/1.6-r0/temp/log.do_package.28207
ERROR: Task 10 (/buildarea1/yzhao1/poky/meta/recipes-extended/gzip/gzip_1.6.bb, do_package) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 734 tasks of which 733 didn&apos;t need to be rerun and 1 failed.
No currently running tasks (498 of 738)

Summary: 1 task failed:
  /buildarea1/yzhao1/poky/meta/recipes-extended/gzip/gzip_1.6.bb, do_package
Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
##########################
Check the return value of the command,should be 1.
echo $?
1

In step 3, the build can finish but will show a warning message:
####################
WARNING: QA Issue: gzip-dbg is listed in PACKAGES multiple times, this leads to packaging errors.
NOTE: Tasks Summary: Attempted 738 tasks of which 577 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
####################

Check the return value of the command,should be 0.
echo $?
0</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>