<?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>10948</bug_id>
          
          <creation_ts>2017-01-20 19:27:47 +0000</creation_ts>
          <short_desc>buildhistory not reporting srcrev&apos;s when using sstate cache</short_desc>
          <delta_ts>2017-06-16 16:18:59 +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>Scripts and Tools</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86</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>2.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Richardson">jon.richardson</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>eduard.bartosh</cc>
    
    <cc>ross.burton</cc>
    
    <cc>scott.branden</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>69973</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-01-20 19:27:47 +0000</bug_when>
    <thetext>I enable buildhistory by adding INHERIT += &quot;buildhistory&quot; to local.conf. When we do a build with the sstate cache disabled, the latest_srcrev files are written properly to the buildhistory directory and running buildhistory-collect-srcrevs returns the SRCREV for all our recipes using AUTOREV. When we run the same commands with a populated sstate cache, there is almost never latest_srcrev files written in buildhistory and the buildhistory-collect-srcrevs returns nothing. Sometimes it returns one the SRCREV of one recipe - not sure why.

I tried deleting build/tmp and build/cache but it makes no difference.

sstate cache is enabled with SSTATE_DIR and SSTATE_MIRRORS populated. When disabled, neither are specified.

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69974</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-01-20 19:50:57 +0000</bug_when>
    <thetext>A bit more info on what we&apos;re compiling. When we do a build we are generating a custom image with many recipes included in the image that use AUTOREV. It also builds several bootloaders such as u-boot, plus a couple of others, built at the same time the image is generated by using EXTRA_IMAGEDEPENDS in our machine conf. Even when doing a bitbake &lt;recipe&gt; -c cleanall and rebuilding I don&apos;t get SRCREV info.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71122</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-03-08 12:21:49 +0000</bug_when>
    <thetext>Couple of observations and questions

- you can&apos;t disable sstate cache by commenting out SSTATE_DIR. This will just make sstate to use default location of sstate-cache, which is &quot;${TOPDIR}/sstate-cache&quot;

- it looks like the difference comes from SSTATE_MIRRORS, i.e. buildhistory-collect-srcrevs doesn&apos;t show AUTOREV revisions when SSTATE_MIRRORS are enabled. Please, confirm it.

- Can you show the value of SSTATE_MIRRORS please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71156</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-03-09 01:59:32 +0000</bug_when>
    <thetext>Hi Ed. Yes, correct on both points. I can confirm that buildhistory-collect-srcrevs doesn&apos;t show AUTOREV revisions when SSTATE_MIRRORS is enabled. 

The value of the variable to enable sstate is:
SSTATE_MIRRORS=&quot;file://.* file:///projects/sw/yocto/mirror/sstate-cache/PATH&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71402</commentid>
    <comment_count>4</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2017-03-17 17:25:49 +0000</bug_when>
    <thetext>It appears the question was answered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71860</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-03-29 14:07:15 +0000</bug_when>
    <thetext>I&apos;m not able to get any output from buildhistory-collect-srcrevs even with commented out SSTATE_MIRRORS line in local.conf

Jonathan, can you suggest some way to reproduce this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71983</commentid>
    <comment_count>6</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-04-01 00:22:13 +0000</bug_when>
    <thetext>Not sure why you don&apos;t get any output if you&apos;re using autorev. I put together a simple test. If you need a real recipe I&apos;ll find one I can share and modify it exactly, but I&apos;ll assume you have some recipe pointing to a git repo using autorev:

my-recipe.bb:
SRCREV = &quot;${AUTOREV}&quot;
SRC_URI = &quot;git://somewhere.com/repo.git;protocol=ssh;branch=master;&quot;
# Force access to git repo every time.
PV=&quot;git${SRCPV}&quot;

1) In build/conf/local.conf add:

INHERIT += &quot;buildhistory&quot;

# I have these variables in (conf/distro/include/my-distro-defaults.inc), but local.conf should be fine
SSTATE_DIR ?= &quot;${TOPDIR}/../../../new-yocto-cache/sstate-cache&quot;
SSTATE_MIRRORS = &quot;&quot;

2) bitbake my-recipe

3) buildhistory-collect-srcrevs
SRCREV_pn-my-recipe = &quot;2069d0d124c5d325890a91a6c309693c45143ff9&quot;

4) Populate the sstate cache:
  - mkdir ~/mirror
  - cp -fr ../../../new-yocto-cache/sstate-cache /home/user/mirror/

5) Set SSTATE_MIRRORS to the populated sstate cache:
SSTATE_MIRRORS ?= &quot;file://.* file:///home/user/yocto/mirror/sstate-cache/PATH

6) In your build dir:
   rm -rf buildhistory cache tmp

7) bitbake my-recipe

8) buildhistory-collect-srcrevs
&lt;no output&gt;

9) bitbake my-recipe -c cleanall

10) buildhistory-collect-srcrevs
&lt;no output&gt;

11) Remove SSTATE_MIRRRORS:
SSTATE_MIRRORS = &quot;&quot;

12) bitbake my-recipe -c cleanall; bitbake my-recipe

13) buildhistory-collect-srcrevs
SRCREV_pn-my-recipe = &quot;2069d0d124c5d325890a91a6c309693c45143ff9&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72068</commentid>
    <comment_count>7</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-04 14:42:44 +0000</bug_when>
    <thetext>Jonathan, thank you for detailed example.

I was able to reproduce this. The reason for it is that latest_srcrev files are written after sources are fetched, i.e. after do_fetch task is executed. This does not happen when sstate mirror already has fetched sources. So, latest_srcrev files are not created and buildhistory-collect-srcrevs reports nothing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72098</commentid>
    <comment_count>8</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-05 11:23:09 +0000</bug_when>
    <thetext>I&apos;ve noticed one difference in your example:

with enabled SSTATE_MIRRORS you don&apos;t build your recipe again after running cleanall task:
9) bitbake my-recipe -c cleanall

with disabled SSTATE_MIRRORS you do:
12) bitbake my-recipe -c cleanall; bitbake my-recipe

when you build the recipe after cleaning do_fetch task is called and write_srcrev is called too and creates latest_srcrev for your recipe. However, if you don&apos;t build a recipe it doesn&apos;t happen.

Can you try to run bitbake my-recipe when SSTATE_MIRRORS is enabled?

It worked just fine for me:

$ grep ^SSTATE_MIRRORS conf/local.conf 
SSTATE_MIRRORS = &quot;file://.* file:///home/ed/yocto/poky/sstate-cache.mirror/PATH&quot;

$ rm -rf buildhistory cache tmp
$ bitbake lz4 -c cleanall
$ buildhistory-collect-srcrevs 
# core2-64-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;

I&apos;m using modified lz4 recipe. Here is the diff:
--- a/meta/recipes-support/lz4/lz4.bb
+++ b/meta/recipes-support/lz4/lz4.bb
@@ -2,13 +2,15 @@ SUMMARY = &quot;Extremely Fast Compression algorithm&quot;
 DESCRIPTION = &quot;LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.&quot;
 
 LICENSE = &quot;BSD&quot;
-LIC_FILES_CHKSUM = &quot;file://lib/LICENSE;md5=0b0d063f37a4477b54af2459477dcafd&quot;
+LIC_FILES_CHKSUM = &quot;file://lib/LICENSE;md5=ebc2ea4814a64de7708f1571904b32cc&quot;
 
-SRCREV = &quot;d86dc916771c126afb797637dda9f6421c0cb998&quot;
+#SRCREV = &quot;d86dc916771c126afb797637dda9f6421c0cb998&quot;
+SRCREV = &quot;${AUTOREV}&quot;
 
-PV = &quot;131+git${SRCPV}&quot;
+#PV = &quot;131+git${SRCPV}&quot;
+PV=&quot;git${SRCPV}&quot;
 
-SRC_URI = &quot;git://github.com/Cyan4973/lz4.git&quot;
+SRC_URI = &quot;git://github.com/Cyan4973/lz4.git;branch=master&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72099</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-05 11:42:26 +0000</bug_when>
    <thetext>Sorry, missed &apos;bitbake lz4&apos; command in previous comment. Here is how it should loook:

$ grep ^SSTATE_MIRRORS conf/local.conf 
SSTATE_MIRRORS = &quot;file://.* file:///home/ed/yocto/poky/sstate-cache.mirror/PATH&quot;

$ rm -rf buildhistory cache tmp
$ bitbake lz4 -c cleanall
$ bitbake lz4
$ buildhistory-collect-srcrevs 
# core2-64-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72110</commentid>
    <comment_count>10</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-04-05 20:23:30 +0000</bug_when>
    <thetext>Hi Ed. Sorry, there were a couple of typos in my instructions. I still see the failure even with lz4.

Step 5 had the wrong directory for the sstate cache. Correction below.
5) Set SSTATE_MIRRORS to the populated sstate cache:
#SSTATE_MIRRORS ?= &quot;file://.* file:///home/user/yocto/mirror/sstate-cache/PATH
SSTATE_MIRRORS ?= &quot;file://.* file:///home/user/mirror/sstate-cache/PATH

Step 9 was meant to re-compile the recipe again.
9) bitbake my-recipe -c cleanall; bitbake my-recipe

Just want to make sure my instructions didn&apos;t mess up your test when the sstate-cache was copied to /home/user/mirror and not /home/user/yocto/mirror. I went back and forth enabling/disabling SSTATE_MIRRORS and it consistently fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72138</commentid>
    <comment_count>11</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-06 15:29:36 +0000</bug_when>
    <thetext>I&apos;m not able to reproduce it in my environment. Below is the set of steps I performed following your instructions.

I used modified lz4 example on the latest poky master (633ad6c9f436f5d2b6ee1a005b697661a054a394)

1) In build/conf/local.conf I have the following variables:
SSTATE_DIR ?= &quot;${TOPDIR}/../sstate-cache&quot;
SSTATE_MIRRORS = &quot;&quot;
...
INHERIT += &quot;buildhistory&quot;

2) bitbake lz4

3) buildhistory-collect-srcrevs
# core2-64-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;

4) Populate the sstate cache:
  - cp -fr ../sstate-cache ../sstate-cache.mirror

5) Set SSTATE_MIRRORS to the populated sstate cache:
SSTATE_MIRRORS = &quot;file://.* file:///home/ed/yocto/poky/sstate-cache.mirror/PATH&quot;

6) In my build dir:
   rm -rf buildhistory cache tmp

7) bitbake lz4

8) buildhistory-collect-srcrevs
&lt;no output&gt;

9) bitbake lz4 -c cleanall

10) buildhistory-collect-srcrevs
buildhistory-collect-srcrevs
# core2-64-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;


Please, try to repeat this with the same repository and revision that I used. It might be that the issue is fixed only in master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72555</commentid>
    <comment_count>12</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-04-17 21:12:45 +0000</bug_when>
    <thetext>Thanks, I&apos;ll try to reproduce it as soon as I can. Issues beyond my control are preventing me from accessing some of the git repos required when upgrading to the latest. I do see a commit in there that may have fixed it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72768</commentid>
    <comment_count>13</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-04-21 18:53:47 +0000</bug_when>
    <thetext>I upgraded poky to 633ad6c9f436f5d2b6ee1a005b697661a054a394. Unfortunately I can&apos;t reproduce your results. buildhistory-collect-srcrevs still doesn&apos;t return anything. I tried removing my PREMIRRORS_prepend, DL_DIR, and BB_GENERATE_MIRROR_TARBALLS variables also in case those were affecting it.

I tried using SSTATE_MIRRORS set and doing &apos;bitbake lz4 -c install -f&apos; and it works fine, but it&apos;s not surprising because the sstate cache is bypassed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72943</commentid>
    <comment_count>14</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2017-04-28 16:31:37 +0000</bug_when>
    <thetext>It appears the question has been answered.  Moving back to Ed to work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72970</commentid>
    <comment_count>15</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-05-02 07:31:10 +0000</bug_when>
    <thetext>Sorry for the delay. I was on vacation.

I&apos;ll try to reproduce the issue with absolutely clean build on the latest master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72974</commentid>
    <comment_count>16</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-05-02 08:56:57 +0000</bug_when>
    <thetext>I&apos;m still not able to reproduce this issue even with a clean build on the latest poky master (381897c64069ea43d595380a3ae913bcc79cf7e1).

Here is a detailed list of what I did:

1. Modify lz4 recipe to use AUTOREV:

diff --git a/meta/recipes-support/lz4/lz4.bb b/meta/recipes-support/lz4/lz4.bb
index 03c5a7a..9a8e612 100644
--- a/meta/recipes-support/lz4/lz4.bb
+++ b/meta/recipes-support/lz4/lz4.bb
@@ -2,13 +2,15 @@ SUMMARY = &quot;Extremely Fast Compression algorithm&quot;
 DESCRIPTION = &quot;LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.&quot;
 
 LICENSE = &quot;BSD&quot;
-LIC_FILES_CHKSUM = &quot;file://lib/LICENSE;md5=0b0d063f37a4477b54af2459477dcafd&quot;
+LIC_FILES_CHKSUM = &quot;file://lib/LICENSE;md5=ebc2ea4814a64de7708f1571904b32cc&quot;
 
-SRCREV = &quot;d86dc916771c126afb797637dda9f6421c0cb998&quot;
+#SRCREV = &quot;d86dc916771c126afb797637dda9f6421c0cb998&quot;
+SRCREV = &quot;${AUTOREV}&quot;
 
-PV = &quot;131+git${SRCPV}&quot;
+#PV = &quot;131+git${SRCPV}&quot;
+PV=&quot;git${SRCPV}&quot;
 
-SRC_URI = &quot;git://github.com/Cyan4973/lz4.git&quot;
+SRC_URI = &quot;git://github.com/Cyan4973/lz4.git;branch=master&quot;
 
 S = &quot;${WORKDIR}/git&quot;

2. Create fresh build directory:

$ . oe-init-build-env build-10948
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.

You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.

The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/


### Shell environment set up for builds. ###

You can now run &apos;bitbake &lt;target&gt;&apos;

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-ide-support

You can also run generated qemu images with a command like &apos;runqemu qemux86&apos;

3. Add 2 lines to conf/local.conf:

SSTATE_MIRRORS = &quot;&quot;
INHERIT += &quot;buildhistory&quot;

4. Build lz4:

$ bitbake lz4

WARNING: Host distribution &quot;opensuse-13.2&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:20
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;opensuse-13.2&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/1.6/x86_64-nativesdk-libc.tar.bz2;sha256sum=2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a
--2017-05-02 11:04:38--  http://downloads.yoctoproject.org/releases/uninative/1.6/x86_64-nativesdk-libc.tar.bz2
Resolving proxy-chain.intel.com (proxy-chain.intel.com)... 163.33.7.140
Connecting to proxy-chain.intel.com (proxy-chain.intel.com)|163.33.7.140|:911... connected.
Proxy request sent, awaiting response... 200 OK
Length: 2535308 (2.4M) [application/octet-stream]
Saving to: ‘/home/ed/git/yocto/poky/build-10948/downloads/uninative/2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a/x86_64-nativesdk-libc.tar.bz2’


2017-05-02 11:04:39 (2.99 MB/s) - ‘/home/ed/git/yocto/poky/build-10948/downloads/uninative/2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a/x86_64-nativesdk-libc.tar.bz2’ saved [2535308/2535308]

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: gmp-native-6.1.2-r0 do_fetch: Failed to fetch URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2, attempting MIRRORS if available
NOTE: Tasks Summary: Attempted 470 tasks of which 0 didn&apos;t need to be rerun and all succeeded.

Summary: There were 2 WARNING messages shown.

5. Run buildhistory-collect-srcrevs

$ buildhistory-collect-srcrevs
# i586-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;

6. Populate the sstate cache:

$ cp -fr sstate-cache sstate-cache.mirror

7. Set SSTATE_MIRRORS to the populated sstate cache in conf/local.conf:

SSTATE_MIRRORS = &quot;file://.* file:///home/ed/yocto/poky/build-10948/sstate-cache.mirror/PATH&quot;

8. Remove buildhistory, cache and tmp directories:

$ rm -rf buildhistory cache tmp

9. Build lz4 again:

$ bitbake lz4

WARNING: Host distribution &quot;opensuse-13.2&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:20
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;opensuse-13.2&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 470 tasks of which 469 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.

10. Run buildhistory-collect-srcrevs to ensure it doesn&apos;t produce anything:

$ buildhistory-collect-srcrevs

11. Clean all

$ bitbake lz4 -c cleanall

WARNING: Host distribution &quot;opensuse-13.2&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:13
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal-4.8&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3 tasks of which 0 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.

12. Build lz4 again:

$ bitbake lz4

WARNING: Host distribution &quot;opensuse-13.2&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |#################################################################################################################################################| Time: 0:00:00
Loaded 1296 entries from dependency cache.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:00
Parsing of 830 .bb files complete (829 cached, 1 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal-4.8&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
Checking sstate mirror object availability: 100% |####################################################################################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 470 tasks of which 456 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.

13. Run buildhistory-collect-srcrevs again:

$ buildhistory-collect-srcrevs
# i586-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;

Please, try to repeat above steps. It could be that the issue is only reproducible on your machine and/or your host distribution.

If you&apos;re able to reproduce my results on default machine (qemux86) you can try to change machine and let me know which machine and distro you&apos;ve used to reproduce the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73287</commentid>
    <comment_count>17</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-05-16 21:54:12 +0000</bug_when>
    <thetext>I tried again using qemux86. It still doesn&apos;t work for me. It is reproducible on all of our ubuntu 14.04 machines.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73318</commentid>
    <comment_count>18</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-05-18 10:58:16 +0000</bug_when>
    <thetext>ok, thanks. I&apos;ll try to reproduce it on Ubuntu 14.04.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73322</commentid>
    <comment_count>19</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-05-18 14:28:29 +0000</bug_when>
    <thetext>I couldn&apos;t reproduce the issue on Ubuntu 16.04
it works the same way as on OpenSUSE.

will try Ubuntu 14.04.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73374</commentid>
    <comment_count>20</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-05-19 09:10:41 +0000</bug_when>
    <thetext>It&apos;s the same on Ubuntu 14.04 - not reproducible.

I repeated steps that I mentioned here before. The result is the same for the clean qemux86 build on 3 distros: OpenSUSE 13.2, Ubuntu 16.04 and Ubuntu 14.04

I used Ubuntu 14.04and 16.04 docker images from docker hub.

Here is a full console log from Ubuntu 14.04:

[ed@594ce71a39e0 poky (master)]$ . oe-init-build-env build-10948
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.

You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.

The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/


### Shell environment set up for builds. ###

You can now run &apos;bitbake &lt;target&gt;&apos;

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-ide-support

You can also run generated qemu images with a command like &apos;runqemu qemux86&apos;
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ vi conf/local.conf 
[ed@594ce71a39e0 build-10948 (master)]$ vi /tmp/diff
[ed@594ce71a39e0 build-10948 (master)]$ cd ../
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ patch -p1 &lt; /tmp/diff
patching file meta/recipes-support/lz4/lz4.bb
Reversed (or previously applied) patch detected!  Assume -R? [n] ^C
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ 
[ed@594ce71a39e0 poky (master)]$ cd build-10948/
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ vi conf/local.conf 
[ed@594ce71a39e0 build-10948 (master)]$ bitbake lz4
WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:20
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;ubuntu-14.04&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/1.6/x86_64-nativesdk-libc.tar.bz2;sha256sum=2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a
--2017-05-19 08:07:51--  http://downloads.yoctoproject.org/releases/uninative/1.6/x86_64-nativesdk-libc.tar.bz2
Resolving proxy-chain.intel.com (proxy-chain.intel.com)... 163.33.7.139
Connecting to proxy-chain.intel.com (proxy-chain.intel.com)|163.33.7.139|:911... connected.
Proxy request sent, awaiting response... 200 OK
Length: 2535308 (2.4M) [application/octet-stream]
Saving to: ‘/home/ed/git/yocto/poky/build-10948/downloads/uninative/2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a/x86_64-nativesdk-libc.tar.bz2’


2017-05-19 08:07:52 (3.04 MB/s) - ‘/home/ed/git/yocto/poky/build-10948/downloads/uninative/2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a/x86_64-nativesdk-libc.tar.bz2’ saved [2535308/2535308]

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: elfutils-native-0.168-r0 do_fetch: Failed to fetch URL ftp://sourceware.org/pub/elfutils/0.168/elfutils-0.168.tar.bz2, attempting MIRRORS if available
WARNING: expat-native-2.2.0-r0 do_fetch: Failed to fetch URL http://downloads.sourceforge.net/expat/expat-2.2.0.tar.bz2, attempting MIRRORS if available
NOTE: Tasks Summary: Attempted 470 tasks of which 0 didn&apos;t need to be rerun and all succeeded.

Summary: There were 3 WARNING messages shown.
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ buildhistory-collect-srcrevs
# i586-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ cp -fr sstate-cache sstate-cache.mirror
[ed@594ce71a39e0 build-10948 (master)]$ vi conf/local.conf 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ rm -rf buildhistory cache tmp
[ed@594ce71a39e0 build-10948 (master)]$ bitbake lz4
WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:18
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;ubuntu-14.04&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 470 tasks of which 469 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
[ed@594ce71a39e0 build-10948 (master)]$ buildhistory-collect-srcrevs
[ed@594ce71a39e0 build-10948 (master)]$ bitbake lz4 -c cleanall
WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:13
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal-4.8&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3 tasks of which 0 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
[ed@594ce71a39e0 build-10948 (master)]$ bitbake lz4
WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |#################################################################################################################################################| Time: 0:00:00
Loaded 1296 entries from dependency cache.
Parsing recipes: 100% |###############################################################################################################################################| Time: 0:00:00
Parsing of 830 .bb files complete (829 cached, 1 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal-4.8&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:381897c64069ea43d595380a3ae913bcc79cf7e1&quot;

Initialising tasks: 100% |############################################################################################################################################| Time: 0:00:00
Checking sstate mirror object availability: 100% |####################################################################################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 470 tasks of which 456 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
[ed@594ce71a39e0 build-10948 (master)]$ buildhistory-collect-srcrevs
# i586-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;


Jonatan, can you try to repeat what I did? I mean to repeat exactly all steps. At this point I&apos;m pretty sure we do different things. That&apos;s the only reason I can see why we have different results.

Please, assign this bug back to me when you&apos;re done. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73653</commentid>
    <comment_count>21</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-06-02 18:48:06 +0000</bug_when>
    <thetext>I&apos;m not sure why we&apos;re seeing different results. I guess I need to debug it on our machines. Something is different. 

I tried again doing exactly what you did. The only part I can&apos;t see is what you changed SSTATE_MIRRORS to after this step:

[ed@594ce71a39e0 build-10948 (master)]$ cp -fr sstate-cache sstate-cache.mirror
[ed@594ce71a39e0 build-10948 (master)]$ vi conf/local.conf 
[ed@594ce71a39e0 build-10948 (master)]$ 
[ed@594ce71a39e0 build-10948 (master)]$ 

I switched to the master branch:

jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky$ git branch
  bcm/master
* master
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky$ git log
commit 3dea90e8b7bfe988bc4bb70f0f0c50b4f74416bf
Author: Paul Eggleton &lt;paul.eggleton@linux.intel.com&gt;
Date:   Mon May 15 09:29:56 2017 +1200

    bitbake: lib/bb/fetch2: fix typo in conflicting revision message
    
    spcify -&gt; specify
    
    (Bitbake rev: c46f183b3ea94789dd83cb280a1bf5735189c9bc)
    
    Signed-off-by: Paul Eggleton &lt;paul.eggleton@linux.intel.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;

I built everything from scratch, it took a couple of hours. Same results. To give you a log I just used my sstate-cache from the first build and setup a new build dir:

jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky$ . oe-init-build-env build-10948
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.

You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.

The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/


### Shell environment set up for builds. ###

You can now run &apos;bitbake &lt;target&gt;&apos;

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-ide-support

You can also run generated qemu images with a command like &apos;runqemu qemux86&apos;
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ ll
total 12
drwxrwxr-x  3 jonathar jonathar 4096 Jun  2 11:43 ./
drwxrwxr-x 19 jonathar jonathar 4096 Jun  2 11:43 ../
drwxrwxr-x  2 jonathar jonathar 4096 Jun  2 11:43 conf/
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ bitbake lz4
WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes:  45% |########################################                                                  | ETA:  0:00:15
Keyboard Interrupt, closing down...

Parsing recipes: 100% |##########################################################################################| Time: 0:00:13
Parsing of 830 .bb files complete (0 cached, 384 parsed). 586 targets, 28 skipped, 0 masked, 0 errors.

Summary: There was 1 WARNING message shown.
Execution was interrupted, returning a non-zero exit code.
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ bitbake lz4
WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |##########################################################################################| Time: 0:00:22
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;ubuntu-14.04&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:3dea90e8b7bfe988bc4bb70f0f0c50b4f74416bf&quot;

NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/1.6/x86_64-nativesdk-libc.tar.bz2;sha256sum=2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a
--2017-06-02 11:45:13--  http://downloads.yoctoproject.org/releases/uninative/1.6/x86_64-nativesdk-libc.tar.bz2
Resolving downloads.yoctoproject.org (downloads.yoctoproject.org)... 198.145.20.127
Connecting to downloads.yoctoproject.org (downloads.yoctoproject.org)|198.145.20.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2535308 (2.4M) [application/octet-stream]
Saving to: ‘/home/jonathar/work/yocto/buildhistory-issue/poky/build-10948/downloads/uninative/2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a/x86_64-nativesdk-libc.tar.bz2’


2017-06-02 11:45:15 (1.21 MB/s) - ‘/home/jonathar/work/yocto/buildhistory-issue/poky/build-10948/downloads/uninative/2b4fffa308d9f19e0742a1a404ff42495fb50c165e5ca0458cedca157372691a/x86_64-nativesdk-libc.tar.bz2’ saved [2535308/2535308]

Initialising tasks: 100% |#######################################################################################| Time: 0:00:01
Checking sstate mirror object availability: 100% |###############################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 857 tasks of which 856 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ buildhistory-collect-srcrevs
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ 

jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ tail conf/local.conf
#ASSUME_PROVIDED += &quot;libsdl-native&quot;

# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn&apos;t mean anything to you.
CONF_VERSION = &quot;1&quot;

SSTATE_MIRRORS=&quot;file://.* file:///home/jonathar/mirror/sstate-cache/PATH&quot;
INHERIT += &quot;buildhistory&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73654</commentid>
    <comment_count>22</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-06-02 19:38:18 +0000</bug_when>
    <thetext>I added this first line to buildhistory.bbclass to get it to work. If it&apos;s cached and do_fetch doesn&apos;t run then how is it supposed to write the latest_srcrev file?

do_populate_lic_setscene[postfuncs] += &quot;write_srcrev&quot;
do_fetch[postfuncs] += &quot;write_srcrev&quot;
do_fetch[vardepsexclude] += &quot;write_srcrev&quot;
python write_srcrev() {

When it&apos;s cached the do_fetch task isn&apos;t run:

jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ cat tmp/work/i586-poky-linux/lz4/1_gitAUTOINC+7bb64ff2b6-r0/temp/log.task_order 
do_populate_lic_setscene (12787): log.do_populate_lic_setscene.12787
do_package_write_rpm_setscene (12927): log.do_package_write_rpm_setscene.12927
do_populate_sysroot_setscene (12934): log.do_populate_sysroot_setscene.12934
do_package_qa_setscene (12957): log.do_package_qa_setscene.12957
do_packagedata_setscene (13248): log.do_packagedata_setscene.13248</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73669</commentid>
    <comment_count>23</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-06-03 21:08:40 +0000</bug_when>
    <thetext>do_fetch was rerun on all my tests mentioned above after bitbake lz4 -c cleanall. It&apos;s still a mistery for me why it&apos;s not rerun in your setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73797</commentid>
    <comment_count>24</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-06-07 14:10:27 +0000</bug_when>
    <thetext>Can you try this patch, please?

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 3e907fc..057a3cb 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -336,6 +336,7 @@ def write_recipehistory(rcpinfo, d):
         f.write(u&quot;PACKAGES = %s\n&quot; %  rcpinfo.packages)
         f.write(u&quot;LAYER = %s\n&quot; %  rcpinfo.layer)
 
+    write_latest_srcrev(d, pkghistdir)
 
 def write_pkghistory(pkginfo, d):
     bb.debug(2, &quot;Writing package history for package %s&quot; % pkginfo.name)
@@ -853,7 +854,10 @@ def _get_srcrev_values(d):
 do_fetch[postfuncs] += &quot;write_srcrev&quot;
 do_fetch[vardepsexclude] += &quot;write_srcrev&quot;
 python write_srcrev() {
-    pkghistdir = d.getVar(&apos;BUILDHISTORY_DIR_PACKAGE&apos;)
+    write_latest_srcrev(d, d.getVar(&apos;BUILDHISTORY_DIR_PACKAGE&apos;))
+}
+
+def write_latest_srcrev(d, pkghistdir):
     srcrevfile = os.path.join(pkghistdir, &apos;latest_srcrev&apos;)
 
     srcrevs, tag_srcrevs = _get_srcrev_values(d)
@@ -891,4 +895,3 @@ python write_srcrev() {
     else:
         if os.path.exists(srcrevfile):
             os.remove(srcrevfile)
-}


I can&apos;t reproduce the issue. Hopefully forcing of srcrev writing can fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73927</commentid>
    <comment_count>25</comment_count>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2017-06-08 22:28:49 +0000</bug_when>
    <thetext>The fix works for me. Thanks.

jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ rm -rf buildhistory/ cache/ tmp/
  
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ 
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ bitbake lz4
WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |##########################################################################################| Time: 0:00:28
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 48 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.34.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;ubuntu-14.04&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.3&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:3dea90e8b7bfe988bc4bb70f0f0c50b4f74416bf&quot;

Initialising tasks: 100% |#######################################################################################| Time: 0:00:02
Checking sstate mirror object availability: 100% |###############################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 857 tasks of which 856 didn&apos;t need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ buildhistory-collect-srcrevs
# i586-poky-linux
SRCREV_pn-lz4 = &quot;7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65&quot;
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ cat tmp/work/
i586-poky-linux/    qemux86-poky-linux/ x86_64-linux/       
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ cat tmp/work/i586-poky-linux/
bash/               expat/              glibc/              lz4/                perl/               sqlite3/
bc/                 flex/               glibc-locale/       m4/                 ptest-runner/       xz/
bzip2/              gawk/               libffi/             make/               python/             zlib/
cryptodev-linux/    gcc-runtime/        libgcc/             ncurses/            python3/            
db/                 gdbm/               libtool-cross/      openssl/            readline/           
diffutils/          gettext/            linux-libc-headers/ opkg-utils/         sed/                
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ cat tmp/work/i586-poky-linux/lz4/1_gitAUTOINC+7bb64ff2b6-r0/temp/log.task_order 
do_populate_lic_setscene (22856): log.do_populate_lic_setscene.22856
do_populate_sysroot_setscene (22857): log.do_populate_sysroot_setscene.22857
do_package_write_rpm_setscene (23062): log.do_package_write_rpm_setscene.23062
do_package_qa_setscene (23063): log.do_package_qa_setscene.23063
do_packagedata_setscene (23142): log.do_packagedata_setscene.23142
jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$ tail conf/local.conf
#ASSUME_PROVIDED += &quot;libsdl-native&quot;

# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn&apos;t mean anything to you.
CONF_VERSION = &quot;1&quot;

SSTATE_MIRRORS=&quot;file://.* file:///home/jonathar/mirror/sstate-cache/PATH&quot;
INHERIT += &quot;buildhistory&quot;

jonathar@lbrmn-lnxub108:~/work/yocto/buildhistory-issue/poky/build-10948$</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73935</commentid>
    <comment_count>26</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-06-09 11:51:34 +0000</bug_when>
    <thetext>Patch has been sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2017-June/137836.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74041</commentid>
    <comment_count>27</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-06-13 08:09:44 +0000</bug_when>
    <thetext>The fix has been merged to poky master.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>