Bug 1896

Summary: sstate cache is only good for one day
Product: [Build System, Metadata & Runtime] BitBake Reporter: Gary Thomas <gary>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: High CC: poky.bs.watcher, poky.watcher, sgw
Version: unspecified   
Target Milestone: 1.2 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Gary Thomas 2012-01-12 07:33:04 UTC
It seems that the sstate cache is only good on the day it was made :-(

Here's what I tried on day 1:
  * Create a new build, e.g.
    % . /local/poky/oe-init-build-env /local/test_pass1
    -- adjust local.conf to match desired target
    % bitbake core-image-minimal
  * Create a new build, using the previous one's sstate-cache
    % . /local/poky/oe-init-build-env /local/test_pass2
    -- adjust local.conf to match desired target
    -- enable sstate cache via these lines in local.conf:
         SSTATE_MIRRORS ?= "\
         file://.* file:///local/test_pass1/sstate-cache/"
    % bitbake core-image-minimal

This all went to plan - the sstate cache was reused for every package except
one.  For some reason, dbus-1 had to be rebuilt.

On day 2, I tried it again, just like the second step.  Low and behold, virtually
none of the sstate packages were reused :-( 

I worked this down to the do_patch in pseudo-native:
$ bitbake-diffsigs test_pass1/tmp/stamps/i686-linux/pseudo-native-1.2-r4.do_patch.sigdata.6e97a41d825568db298fdc9dbaed563c test_pass3/tmp/stamps/i686-linux/pseudo-native-1.2-r4.do_patch.sigdata.a0d4e99625c211f4f1d793213014ac07 
basehash changed from f5994d735ee2b909b72ee811364befc1 to 564be8db4146afa5fc3579dc4c1618d3
Variable DATE value changed from 20120110 to 20120111
Hash for dependent task quilt-native_0.50.bb.do_populate_sysroot changed from 9307106f3c5dfd49d953e206cb1b6da5 to 24151a370083d625b84a2afb77955021

Why is DATE as a variable important?
Why is it not ignored by this statement in ./meta/classes/patch.bbclass?
   patch_do_patch[vardepsexclude] = "DATE SRCDATE PATCHRESOLVE"

Note: this was tested against master rev 468998cddbe1a803096c9b357e1b5daa3b7e8c2e
Comment 1 Gary Thomas 2012-01-13 07:26:13 UTC
Adding DATE to BB_HASHBASE_WHITELIST in bitbake.conf seems to solve this
issue.  When rerunning the experiment on separate days, the only package
that was rebuilt is dbus-1.  I don't see why at the moment, but overall,
making this change seems to work for me.

Does anyone know why DATE would be important?  Surely if it can be explicitly
ignored for pseudo-native, it could be ignored globally?