Bug 2041

Summary: sstate relocation problem
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Mark Hatle <mark.hatle>
Component: meta-yoctoAssignee: Joshua Lock - Disabled <josh>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, josh, poky.bs.watcher, poky.watcher, sgw
Version: 1.1.1   
Target Milestone: 1.3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
local.conf
none
log.do_populate_sysroot none

Description Mark Hatle 2012-02-28 22:04:31 UTC
Created attachment 340 [details]
local.conf

Using the head of the Edison branch, commit e3afb1ebc8eade48df6474e11cf1384ccc53c015, I am unable to get the sstate_mirror code to work reliably.

My configuration is attached.

The /git/sstate directory was populated with a previous build by setting the SSTATE_DIR = "/git/sstate".  The building user does NOT have write permission to that directory, only read permission.  I have verified all of the files and read permissions are properly set.

I am attempting to build "core-image-minimal", error message follows:

| tar (child): /home/yocto1/Desktop/poky/build/sstate-cache/sstate-dbus-x86_64-poky-linux-1.4.12-r1-x86_64-2-03c464c53be3a0482234651d6046e02f_populate-sysroot.tgz: Cannot open: Permission denied

(full log is will be attached as well)
Comment 1 Mark Hatle 2012-02-28 22:05:52 UTC
Created attachment 341 [details]
log.do_populate_sysroot
Comment 2 Mark Hatle 2012-02-28 22:08:42 UTC
note if I rerun the build it will continue and go further.. until something else fails in approx the same place.  If I retry enough times, it will succeed.
Comment 3 Mark Hatle 2012-02-28 22:43:50 UTC
Maybe it's not the mirror code after all.  I just got the same error copying the sstate to a second user and using it as my primary SSTATE_DIR.

I have deleted all of the native sstate cache entries and will be retrying the build.
Comment 4 Mark Hatle 2012-02-28 23:07:41 UTC
removing the natives caused everything in the system to be rebuilt, the sstate cached items were ignored.
Comment 5 Mark Hatle 2012-02-29 02:28:10 UTC
Further information.  The issue is -not- related to the sstate_mirror, it is more fundamental then that.

I am unable to share the sstate data in an edison build.

I created the sstate data in a build:

/home/yocto-admin/Desktop/poky/build/....

(uid yocto-admin)

I attempted to use the sstate data, via the sstate_mirror, or a local copy, under the userid "yocto1".  The build was attempted in:

/home/yocto1/Desktop/poky/build/....

The failure condition and logs are as attached before, the -native elements simply can't be shared from one user to the next or failures occur during the extraction of various packages.
Comment 6 Mark Hatle 2012-03-12 20:35:46 UTC
I attempted to reproduce this failure with the current Poky master.  I did NOT receive a failure following the steps that lead to one in Edison.  However, I got a different failure.  I don't believe it's related, but will include it and the steps here just in case it is.

Build as user "test1", in /home/test1/poky/build.  Run core-image-minimal... Store off the downloads and sstate-cache for use by another user -- remove the poky (and build) directories.

Log in as user "test2".  Using PREMIRRORS and SSTATE_MIRROR setup the new build to the copied downloads and sstate-cache location.  Run a core-image-minimal build -- (it will succeed, unlike edison).

Then run a "psplash" build, it will fail with:


configure:3038: ccache i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/test2/poky/build/tmp/sysroots/qemux86 -c -O2 -pipe -g -feliminate-unused-debug-types conftest.c >&5

cc1: error: /home/test1/poky/build/tmp/sysroots/qemux86/home/test1/poky/build/tmp/sysroots/qemux86/usr/include: Permission denied
cc1: error: /home/test1/poky/build/tmp/sysroots/qemux86/usr/include: Permission denied

----

The compiler is still looking into the older location(s) for items tat should only be coming from the new user code.
Comment 7 Mark Hatle 2012-03-12 20:37:21 UTC
master - compiler issue filed as bug 2074
Comment 8 Saul Wold 2012-04-05 20:48:09 UTC
Moved from 1.2 since this is against the stable release
Comment 9 Joshua Lock - Disabled 2012-05-08 22:49:37 UTC
Using my edison[1] branch with a *read-only* shared sstate directory I get:

"
Failed to create a file in SSTATE_DIR: Permission denied
"

With a *writeable* shared sstate directory my -native recipes fail with errors such as:

"
ERROR: Task 10 (/home/sstatetest/poky-edsion/meta/recipes-devtools/quilt/quilt-native_0.48.bb, do_populate_sysroot_setscene) failed with exit code '1'
"

Followed later by:

"
| ERROR: Error executing a python function in /home/sstatetest/poky-edsion/meta/recipes-devtools/quilt/quilt-native_0.48.bb:
| IOError: [Errno 13] Permission denied: '/srv/yocto/sstate-cache-edison/sstate-quilt-native-x86_64-linux-0.48-r0-x86_64-2-a8d5fafbb984e9267ddaa3433922fda2_populate-sysroot.tgz.siginfo'
"

because the sstate signature files are created -rw-r--r--, so the signatures cannot be overwritten when recreating the native sstate packages as the new user.

Having taken a look at the code I'm pretty surprised that this doesn't happen in master. There aren't many differences between meta/classes/sstate.bbclass and bitbake/lib/bb/siggen.py in master and josh/edison ...

1. http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=josh/edison
Comment 10 Joshua Lock - Disabled 2012-05-08 23:05:57 UTC
Note: things, unsurprisingly, go much smoother if I use my sstate-cache from another user as an SSTATE_MIRRORS rather than as an SSTATE_CACHE.

We could write an extra sanity test to make sure that sstate-cache and any contents are writeable? That could be a pretty heavy test, though...
Comment 11 Richard Purdie 2012-05-08 23:16:18 UTC
Checking if the directory is writable as a one time test is probably fine and we should write the files with group write IMO
Comment 12 Joshua Lock - Disabled 2012-05-08 23:30:30 UTC
OK, I'll write a patch series to check stat for user or group read/write and to change the write permissions of the sstate files.
Comment 13 Joshua Lock - Disabled 2012-05-12 00:54:12 UTC
I've reported the issue in comment #9 as a separate bug #2450
Comment 14 Joshua Lock - Disabled 2012-05-14 17:40:11 UTC
Part of a solution is in place, ensuring siginfo files have group R/W permissions.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=63ccc3f266496b909eec472a1671939498d6e5eb
Comment 15 Joshua Lock - Disabled 2012-05-18 00:38:23 UTC
Sanity test to check for R/W permissions to SSTATE_CACHE implemented:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c2df43b5dbeadc6fff26b8bc6e3bbc07f59b81fa

Change to ensure files are created with group R/W:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=441c1f8faa82a5ff410a395d9086578f6ac8a93b

In addition to the already mentioned change to ensure siginfo changes have group R/W:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=63ccc3f266496b909eec472a1671939498d6e5eb

I feel that this bug is done. I'm loath to merge it to Edison, though. Anyone have strong opinions there?
Comment 16 Joshua Lock - Disabled 2012-06-05 15:38:13 UTC
Fixed in master for 1.3 series