Created attachment 2657 [details] results of nightly-arm build 428 Builder: nightly-arm Build: 428 Buildslave: fedora22.osl.yoctoproject.org Failed task: build images fails due to a strip error Branch: master-next Commit: 005a5b60f00a... URL: https://autobuilder.yoctoproject.org/main/builders/nightly-arm/builds/428/steps/BuildImages/logs/stdio/text See atttachment [1] Relevant log: ERROR: split_and_strip_files: 'file /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/x86_64-linux/libpcre-native/8.37-r0/sysroot-destdir/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots/x86_64-linux/usr/bin/pcre-config' failed
Created attachment 2665 [details] contents of the offending pcre-config
Unfortunately I don't believe the right log was attached here. What I'd like to understand was whether file-native was being installed at the time this failed. Unfortunately the autobuilder has recycled the logs :(. Does anyone have the right ones?
I found someone else seeing this issue and to quote their logs: NOTE: recipe file-native-5.24-r0: task do_install: Succeeded NOTE: Running task 925 of 3566 (ID: 181, virtual:native:/var/lib/jenkins/build/meta/recipes-devtools/file/file_5.24.bb, do_populate_sysroot) NOTE: recipe elfutils-native-0.163-r0: task do_install: Succeeded NOTE: Running task 926 of 3566 (ID: 1358, virtual:native:/var/lib/jenkins/build/meta/recipes-devtools/elfutils/elfutils_0.163.bb, do_populate_sysroot) NOTE: recipe sqlite3-native-3_3.8.10.2-r0: task do_configure: Succeeded NOTE: Running task 927 of 3566 (ID: 1121, virtual:native:/var/lib/jenkins/build/meta/recipes-support/sqlite/sqlite3_3.8.10.2.bb, do_compile) NOTE: recipe file-native-5.24-r0: task do_populate_sysroot: Started NOTE: recipe elfutils-native-0.163-r0: task do_populate_sysroot: Started NOTE: recipe sqlite3-native-3_3.8.10.2-r0: task do_compile: Started ERROR: split_and_strip_files: 'file /var/lib/jenkins/build/build/tmp-glibc/work/x86_64-linux/elfutils-native/0.163-r0/sysroot-destdir/var/lib/jenkins/build/build/tmp-glibc/sysroots/x86_64-linux/usr/lib/elfutils/libebl_sh-0.163.so' failed NOTE: recipe file-native-5.24-r0: task do_populate_sysroot: Succeeded NOTE: Running task 928 of 3566 (ID: 166, virtual:native:/var/lib/jenkins/build/meta/recipes-devtools/rpm/rpm_5.4.14.bb, do_unpack) NOTE: recipe rpm-native-5.4.14-r0: task do_unpack: Started NOTE: recipe elfutils-native-0.163-r0: task do_populate_sysroot: Succeeded NOTE: Running task 929 of 3566 (ID: 3362, virtual:native:/var/lib/j Note how file-native do_populate_sysroot is running when this error occurs. The issue is that file is being installed into the sysroot at the same time something is trying to run it. Its likely the binary gets installed, the file itself doesn't and then execution fails due to the missing lib.
After a bit of thought and discussion, I believe we should: a) add file-native to ASSUME_PROVIDED b) extend the sanity tests in sanity.bbclass to check for the file command c) change the file recipe to install file-native into a subdir (See NATIVE_PACKAGE_PATH_SUFFIX in tar recipe for example) d) make file look for file-native in the subdirectory e) may need to tweak file PROVIDES as the tar recipe does to add a file-replacement-native rather than DEPENDS on file-native which will no longer work)
Given (a) why do we need to do (d)?
And to answer my own question, because file needs an identical version of itself to build: v=$$(file --version | sed -e s/file-// -e q); \ if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ echo "Cannot use the installed version of file ($$v) to"; \ echo "cross-compile file ${PACKAGE_VERSION}"; \ echo "Please install file ${PACKAGE_VERSION} locally first"; \ exit 1; \ fi; \ Ignore me.
That said, (c) through to (e) is probably more effort than changing the file build so it can build a host file if cross-compiling and not need the build-twice dance.
f) Don't install libmagic in file-replacement-native as it introduces build races with the host libmagic (by making libmagic noinst for the native build, so it just installs the binary and data). Patch set incoming.
Patches sent.
The only case perhaps not covered by the patches is when not cross-compiling, and using the host's "file" (along with the host's libmagic although this shouldn't be relevant in this case) on hosts that aren't fully POSIX compliant. I ran some tests and I came up with these results: POSIX OK (file does not error out entirely when it fails to stat a file): fedora21 debian8 centos7 centos6 archlinux NON POSIX: ubuntu1204 opensuse131 debian7 Granted, this shouldn't be an issue when file itself is causing a race condition, but it would be an issue when the file that is being checked with file is.
Fixed in oe-core 656f09accfd7651f179e02c12f40f4d3bec0be0c.
Verified with 2.0 rc3 (jethro/fc45deac89ef63ca1c44e763c38ced7dfd72cbe1)