Bug 3635

Summary: sstate-cache-management script does not remove anything
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Stoicescu Cornel <corneliux.stoicescu>
Component: coreAssignee: Hongxu Jia <hongxu.jia>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: hongxu.jia, kai.kang, liang.li2, liezhi.yang, Martin.Jansa, meta.mr.watcher, meta.watcher, Qi.Chen, sgw, yi.zhao, zhenfeng.zhao
Version: 1.4   
Target Milestone: 1.4 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Stoicescu Cornel 2012-12-21 20:40:47 UTC
Build Configuration:
BB_VERSION        = "1.17.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "1.3+snapshot-20121221"
TUNE_FEATURES     = "m64"
TARGET_FPU        = ""
meta
meta-yocto
meta-yocto-bsp    = "(nobranch):90c0eb29f0b41e4ac2d3d17ebad7295c2ebdc02a"


1. Download poky source and prepare the build environment.
2. Follow the wiki steps to setup a sstate cache on local machine,
https://wiki.yoctoproject.org/wiki/Enable_sstate_cache
3. Run "bitbake core-image-minimal" to build a image.
4. Set MACHINE to another architecture. Run "bitbake core-image-minimal" to build a image.
5. Run script ../scripts/sstate-cache-management.sh --cache-dir=sstate-cache --remove-duplicated and check the ouput.

Notice nothing is reported to be removed.
Comment 1 Scott Garman 2013-01-08 17:28:03 UTC
This bug is for denzil, if this issue also exists in master, please file a *separate* bug for that, since the issue can be fixed in different branches at different times.
Comment 2 Stoicescu Cornel 2013-01-08 18:13:16 UTC
Actually this issue is for master, as the commit: 90c0eb29f0b41e4ac2d3d17ebad7295c2ebdc02a belongs to master. I actually passed this test in denzil: 3456295898bf157e40ea1f8c335f0b7285d3d8a7 .

As with 3633, I made a mistake and I did not specify the branch when posting.

I am sorry for the confusion on this. Won't happen again! I will let you change the version and milestone in case I missed something here.
Comment 3 Scott Garman 2013-01-09 17:12:35 UTC
Thanks for clarifying - setting version and milestone back to 1.4 and assigning to Robert as per discussion with Saul.
Comment 4 Chen Qi 2013-02-26 06:12:54 UTC
https://bugzilla.yoctoproject.org/show_bug.cgi?id=2897
See comment#28 for some info.

To rebuild from sstate-cache correctly both archs are needed.
So setting MACHINE to another arch should result in nothing being removed, I guess.

Best Regards,
Chen Qi
Comment 5 Hongxu Jia 2013-02-26 07:14:30 UTC
This is not a bug, the implementation of `--remove-duplicated' has been
modified by the following commit:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0740f82aea92da0195524e37c372f9981e7f5e6d

In above commit, sstate cache files with multiple archs is not considered
duplicate and don't need to be removed as duplicated any more.

The description of `--remove-duplicated' in usage is not consistent
with implementation and it is should be updated.

But there are other defects in sstate-cache-management.sh:
1, The variable of sstate_suffixes is hardcoed and it misses `packagedata'.
   The better way is to assign sstate_suffixes dynamically.

2, The description of option `-d' is not correct in useage. It is used to
   remove duplicated and debug at the same time.

I will fix them and don't file another bug.
Comment 7 Yi Zhao 2013-03-08 05:44:38 UTC
Verified with master branch: 164a4cb2fc64e76836182ad2d412343a7b26b964

The "packagedata" sstate_suffix now can be found in the cache directory:
########
...
...
Figuring out the suffixes in the sstate cache dir ... Done
The following suffixes have been found in the cache dir:
deploy deploy-deb deploy-ipk deploy-rpm package packagedata populate-lic populate-sysroot
...
...
########