<?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>8907</bug_id>
          
          <creation_ts>2016-01-11 14:39:54 +0000</creation_ts>
          <short_desc>do_package can show errors but succeed</short_desc>
          <delta_ts>2016-02-24 13:44:58 +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>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Igor Stoppa">igor.stoppa</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>bogdanx.a.voiculescu</cc>
    
    <cc>patrick.ohly</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          <qa_contact name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</qa_contact>
          <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>57712</commentid>
    <comment_count>0</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2016-01-11 14:39:54 +0000</bug_when>
    <thetext>Premise
-------

I have a - broken - package which installs some files, but these files are not stored in the corresponding package.


The check &apos;installed-vs-shipped&apos; QA test is labeled as an ERROR in WARN_TO_ERROR_QA .


An, as expected, building the recipe triggers the message:

&quot;ERROR: QA Issue: recipe-name: Files/directories were installed but not shipped in any package:&quot;

and the build stops.



Triggering action
-----------------

Then I try again to build the package.


Expected Outcome
----------------

The build should fail in the same way it already failed.


Actual Outcome
--------------

The build &quot;succeeds&quot;.

I&apos;m speculating on this, but I think the reason why it succeeds is that the broken package (broken because it is missing files that were installed) is still present in the SSTATE, so the second attempt re-uses it, failing to notice that files are missing from it.

The simpler (and probably also the more correct) solution would be to remove the broken package from the SSTATE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57713</commentid>
    <comment_count>1</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2016-01-11 14:40:49 +0000</bug_when>
    <thetext>In the premise, replace the first occurrence of &quot;package&quot; with &quot;recipe&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57763</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-01-12 18:01:03 +0000</bug_when>
    <thetext>Issue root caused, patch sent to the list (http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/wip&amp;id=bc6d92fbf8ee60dcb6e05c7845a4ffdceeda98ad)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57782</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-01-13 10:24:27 +0000</bug_when>
    <thetext>The bug mentioned here is valid, the explanation of what is happening is not correct though, this has nothing to do with sstate.

The problem was that do_package and show ERROR messages but then the task can succeed rather than fail. That means the build continues without failing but due to the ERROR messages, bitbake sets a failure exit code.

Upon a subsequent build, things work fine since the task succeeded and since the task isn&apos;t rerun, no ERROR messages are shown.

What would have been useful here was a reproducer for the bug. I created one by adding:

do_install_append () {
       touch ${D}/dummy
}

to the bash recipe and then building bash. After the proposed patch, this fails every time and the do_package task never succeeds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58064</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-01-21 15:21:50 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=ea29bec6c7bf08cd862b45703bfb8be3ca129d1e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59431</commentid>
    <comment_count>5</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2016-02-24 13:44:58 +0000</bug_when>
    <thetext>Verified on master: 
Build Configuration:
BB_VERSION        = &quot;1.29.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;Ubuntu-14.04&quot;
TARGET_SYS        = &quot;aarch64-poky-linux&quot;
MACHINE           = &quot;qemuarm64&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.0+snapshot-20160224&quot;
TUNE_FEATURES     = &quot;aarch64&quot;
TARGET_FPU        = &quot;&quot;
meta
meta-yocto
meta-yocto-bsp    = &quot;master:36b43b233c841b3c09fc17e04686b4b758780963&quot;

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: QA Issue: bash: Files/directories were installed but not shipped in any package:
  /dummy
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
bash: 1 installed and not shipped files. [installed-vs-shipped]
ERROR: Fatal QA errors found, failing task.
ERROR: Function failed: do_package
ERROR: Logfile of failure stored in: /home/yocto/yocto/poky-test/8891/build/tmp/work/aarch64-poky-linux/bash/4.3.30-r0/temp/log.do_package.5110
ERROR: Task 14 (/home/yocto/yocto/poky-test/poky/meta/recipes-extended/bash/bash_4.3.30.bb, do_package) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 677 tasks of which 676 didn&apos;t need to be rerun and 1 failed.
No currently running tasks (568 of 682)

Summary: 1 task failed:
  /home/yocto/yocto/poky-test/poky/meta/recipes-extended/bash/bash_4.3.30.bb, do_package</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>