<?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>13212</bug_id>
          
          <creation_ts>2019-02-28 16:24:33 +0000</creation_ts>
          <short_desc>image_qa task is always triggered with rm_work class enabled</short_desc>
          <delta_ts>2019-11-19 00:54:32 +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>3.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>with backport</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.0.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Romuald Jeanne">romuald.jeanne</reporter>
          <assigned_to name="Anuj Mittal">anuj.mittal</assigned_to>
          <cc>jacob.kroon</cc>
    
    <cc>randy.macleod</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>83159</commentid>
    <comment_count>0</comment_count>
    <who name="Romuald Jeanne">romuald.jeanne</who>
    <bug_when>2019-02-28 16:24:33 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
Setup default Yocto configuration on THUD release:
DISTRO=nodistro
MACHINE=(any machine)

Add in &apos;local.conf&apos; file
INHERIT += &quot;rm_work&quot;

Triggering Action/Cause
-----------------------
Once bitbake environment enabled, build the core-image-base several time in a row:
bitbake core-image-base
bitbake core-image-base
bitbake core-image-base

Expectation
-----------
The first build should last for a few hours (depending on your network and host).
Then following builds for the same image should not trigger any specific tasks as the image has been already built.

Actual Result
-------------
After the first build, the other builds trigger each time the &apos;image_qa&apos; task.

Reproducibility
---------------
1/1

Pre-Analysis:
-------------
In &apos;rm_work.bbclass&apos; class we should also manage the do_image_qa_setscene and do_image_qa tasks in the same way do_image_complete_setscene and do_image_complete tasks are handled.

I suggest to add in &apos;rm_work.bbclass&apos; file,
line 66 (just after the switch &apos;*do_image_complete*)&apos; :

 *do_image_qa_setscene*)
     # Ensure we don&apos;t &apos;stack&apos; setscene extensions to this stamp with the section below
     i=dummy
     ;;
 *do_image_qa*)
     # Promote do_image_complete stamps to setscene versions (ahead of *do_image* below)
     mv $i `echo $i | sed -e &quot;s#do_image_qa#do_image_qa_setscene#&quot;`
     i=dummy
     ;;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83212</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2019-03-07 16:43:33 +0000</bug_when>
    <thetext>If you are not using poky to get bitbake, could you try bringing up bitbake to the latest version? There is a known bug where newer versions of oe-core don&apos;t work quite right with older versions of bitbake and it can cause tasks to re-run.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83261</commentid>
    <comment_count>2</comment_count>
    <who name="Romuald Jeanne">romuald.jeanne</who>
    <bug_when>2019-03-12 10:48:13 +0000</bug_when>
    <thetext>I&apos;m using the Poky release thud-20.0.1 (or yocto-2.6.1)
SHA1: 1cab405d88149fd63322a867c6adb4a80ba68db3

If you look at the &apos;log.task_order&apos; file for core-image-base build:

* without enabling &apos;rm_work&apos; class, I have the following log:

do_prepare_recipe_sysroot (24001): log.do_prepare_recipe_sysroot.24001
do_rootfs (24046): log.do_rootfs.24046
do_image_qa (5884): log.do_image_qa.5884
do_image (5888): log.do_image.5888
do_image_stmultiubi (5928): log.do_image_stmultiubi.5928
do_image_tar (5930): log.do_image_tar.5930
do_image_ext4 (5932): log.do_image_ext4.5932
do_image_complete (5982): log.do_image_complete.5982
do_populate_lic_deploy (6110): log.do_populate_lic_deploy.6110

If I launch again the same image build, nothing is added to the &apos;log.task_order&apos; as there is no task scheduled.

* with &apos;rm_work&apos; class enabled, I just launch again the same build, and I have the &apos;log.task_order&apos; file populated with these additional lines:

do_image_complete (4472): log.do_image_complete.4472
do_populate_lic_deploy (4762): log.do_populate_lic_deploy.4762
do_rm_work (4765): log.do_rm_work.4765

Again I launch the same build, and I got the follwoing update:

do_prepare_recipe_sysroot (5027): log.do_prepare_recipe_sysroot.5027
do_rootfs (5082): log.do_rootfs.5082
do_image_qa (13375): log.do_image_qa.13375
do_populate_lic_deploy (13379): log.do_populate_lic_deploy.13379
do_rm_work (13381): log.do_rm_work.13381

And again:

do_prepare_recipe_sysroot (13520): log.do_prepare_recipe_sysroot.13520
do_rootfs (13534): log.do_rootfs.13534
do_image_qa (21395): log.do_image_qa.21395
do_populate_lic_deploy (21399): log.do_populate_lic_deploy.21399
do_rm_work (21401): log.do_rm_work.21401

So when &apos;rm_work&apos; class is enabled, I have the &apos;do_image_qa&apos; task that is triggered, while it should not.

And as soon as I apply the correction I&apos;ve suggested in &apos;rm_work&apos; class to manage the &apos;do_image_qa&apos; task in the same way &apos;do_image_complete&apos; task is handled, then I can get &apos;log.task_order&apos; file updated in this way:

do_prepare_recipe_sysroot (25833): log.do_prepare_recipe_sysroot.25833
do_rootfs (26144): log.do_rootfs.26144
do_image_qa (1775): log.do_image_qa.1775
do_populate_lic_deploy (1800): log.do_populate_lic_deploy.1800
do_rm_work (1812): log.do_rm_work.1812
[ new build ]
do_populate_lic_deploy (1993): log.do_populate_lic_deploy.1993
do_rm_work (2001): log.do_rm_work.2001
[ new build ]
do_populate_lic_deploy (2124): log.do_populate_lic_deploy.2124
do_rm_work (2131): log.do_rm_work.2131
[ new build ]
do_populate_lic_deploy (7512): log.do_populate_lic_deploy.7512
do_rm_work (7578): log.do_rm_work.7578

I hope I&apos;m clear enought.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85330</commentid>
    <comment_count>3</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-10-13 19:10:32 +0000</bug_when>
    <thetext>looking at the current rm_work.bbclass in master, I don&apos;t see anything like these changes so I suspect this will affect master too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85339</commentid>
    <comment_count>4</comment_count>
    <who name="Jacob Kroon">jacob.kroon</who>
    <bug_when>2019-10-13 19:57:21 +0000</bug_when>
    <thetext>FWIW: I&apos;ve seen this bug for years using OE. To me it has not been annoying enough for me to complain loudly, since the rootfs tasks that are re-run each time don&apos;t take a huge amount of time. But it would be great if this could be fixed. I did try patching rm_work.bbclass according to the bug-report, and it does seem to solve the problem with re-running tasks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85340</commentid>
    <comment_count>5</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-10-13 20:31:47 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; FWIW: I&apos;ve seen this bug for years using OE. To me it has not been annoying
&gt; enough for me to complain loudly, since the rootfs tasks that are re-run
&gt; each time don&apos;t take a huge amount of time. But it would be great if this
&gt; could be fixed. I did try patching rm_work.bbclass according to the
&gt; bug-report, and it does seem to solve the problem with re-running tasks.

I will change the milestone to 3.1 with backport and see what the Bug triage team thinks of it.

thanks for the info.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85504</commentid>
    <comment_count>6</comment_count>
    <who name="Jacob Kroon">jacob.kroon</who>
    <bug_when>2019-11-08 06:30:14 +0000</bug_when>
    <thetext>Fix merged to master:

commit 3d3bd7952cf4bf5c94e4d18b45a604b95b69e8c3
Author: Jacob Kroon &lt;jacob.kroon@gmail.com&gt;
Date:   Wed Nov 6 13:34:58 2019 +0100

    rm_work: Promote do_image_qa stamps to setscene versions
    
    [ YOCTO #13212 ]
    
    Suggested-by: Romuald Jeanne &lt;romuald.jeanne@st.com&gt;
    Signed-off-by: Jacob Kroon &lt;jacob.kroon@gmail.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85569</commentid>
    <comment_count>7</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-11-18 23:56:30 +0000</bug_when>
    <thetext>assigning to anuj to backport for Zeus</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85571</commentid>
    <comment_count>8</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2019-11-19 00:54:32 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; assigning to anuj to backport for Zeus

This is in zeus already:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=zeus&amp;id=4ad64a5cf5a4ce03185120cc6e27a0b985f3244c

Closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>