Bug 8581

Summary: Install permission error after sourcing 32 bit buildtools-tarball.
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: devtools / tool chainAssignee: Juro Bystricky <juro.bystricky>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher
Version: 1.7.3   
Target Milestone: 2.1 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
do_install.log none

Description Juro Bystricky 2015-10-26 21:10:39 UTC
Created attachment 2829 [details]
do_install.log

Install a 32 bit  buildtools-tarball such as poky-glibc-i686-buildtools-tarball-i586-buildtools-nativesdk-standalone-xxxx.sh on a 64-bit distro. (Tested with Ubuntu 14/15 only).

source the environment-setup-i686-pokysdk-linux script

source the oe-init-build-env script

Run bitbake command "bitbake core-image-minimal"
After a while the the build breaks with multitude of permission errors:

| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/Chile': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/Japan': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/Factory': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/GMT0': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/Jamaica': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/Iceland': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/CET': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix/Egypt': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/posix': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/Factory': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/GMT0': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/Jamaica': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/Iceland': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/CET': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo/Egypt': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share/zoneinfo': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr/share': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image/usr': Operation not permitted
| chown: changing ownership of '/data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/image': Operation not permitted
| ERROR: Function failed: do_install (log file is located at /data/dizzy/poky/build-test-pseudo/tmp/work/all-poky-linux/tzdata/2015d-r0/temp/log.do_install.27073)
ERROR: Task 1449 (/data/dizzy/poky/meta/recipes-extended/tzdata/tzdata_2015d.bb, do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1112 tasks of which 0 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:



The same was observed with dizzy, fido and master.
Comment 1 Juro Bystricky 2015-10-28 15:41:26 UTC
The problem is not observed on a 32 bit host.
Comment 2 Juro Bystricky 2015-10-28 15:55:21 UTC
Please see https://bugzilla.yoctoproject.org/show_bug.cgi?id=8582
This bug seems to the consequence of "pseudo" not loaded.
Comment 3 Juro Bystricky 2015-11-30 20:28:23 UTC
Placing 
NO32LIBS = "0"

in local.conf will fix the problem. This will result in building 32 bit libpseudo.so on 64 bit hosts, see meta/recipes-devtools/pseudo/pseudo.inc.
Comment 4 Juro Bystricky 2015-12-02 01:19:30 UTC
The problem is that "pseudo" does not build 32 bit library by default on 64 bit host, it should build it 32 bit library when using 32 bit development tools (buildtools-tarball) running on 64 bit host. This condition is not easy to detect. However, "pseudo" recipe honours the environment variable NO32LIBS. 

So one clean solution would be modify the "environment-setup-i686-pokysdk-linux"
for buildtools-tarball to also contain (iff the SDKMACHINE=i686):

export BB_ENV_EXTRAWHITE="NO32LIBS $BB_ENV_EXTRAWHITE"
export NO32LIBS="0"

This would work for the initialization sequence in this order:

$ source the oe-init-build-env script
$ source the environment-setup-i686-pokysdk-linux
$ bitbake core-image-minimal

If we insist on supporting any order, i.e. this order as well:

$ source the environment-setup-i686-pokysdk-linux
$ source the oe-init-build-env script
$ bitbake core-image-minimal

we need to modify the poky/scripts/oe-buildenv-internal to preserve any existing BB_ENV_EXTRAWHITE values:

export BB_ENV_EXTRAWHITE="MACHINE DISTRO TCMODE TCLIBC <...> $BB_ENV_EXTRAWHITE"

Alternatively, we could add explicitly NO32LIBS:

export BB_ENV_EXTRAWHITE="MACHINE DISTRO TCMODE TCLIBC <...> NO32LIBS"
Comment 5 Juro Bystricky 2015-12-09 18:33:31 UTC
Patches submitted to the mailing list