summaryrefslogtreecommitdiffstats
path: root/meta/classes/staging.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-14 12:50:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-15 10:26:42 +0000
commita819c88b875d2357751005df7594de290926ae64 (patch)
tree26c72213c33613673ff6fb984718046c5664ea9c /meta/classes/staging.bbclass
parent46e0391f611f6686ef3362b32f493ae74ec15d43 (diff)
downloadpoky-a819c88b875d2357751005df7594de290926ae64.tar.gz
staging: Handle races between binaries and their libs
There is a long standing issue where a binary could be installed into the sysroot before its library dependencies. We've always argued nothing should use the binary until it has been installed by a dependency but there are issues around binaries which conflict with the host system, for example patch, python3, gzip and more. With the recent patch changes we've seen issues like: ERROR: gdb-cross-canadian-powerpc-8.3.1-r0 do_patch: Command Error: 'quilt --quiltrc /home/pokybuild/yocto-worker/qemuppc/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gdb-cross-canadian-powerpc/8.3.1-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output: Applying patch 0009-Change-order-of-CFLAGS.patch patch: /lib64/libattr.so.1: version `ATTR_1.3' not found (required by patch) Patch 0009-Change-order-of-CFLAGS.patch does not apply (enforce with -f) which is a symptom of this issue (libattr-native is a dependency of patch-native). There are other ways to fix this such as disabling libattr in patch, installing patch to a subdirectory and requiring PATH manipulation and so on. We can simply fix the staging code to handle /bin/ after everything else so do that and avoid all these other complications. (From OE-Core rev: 29d17fe23265bf0c7defa14ffc0f677af15c6818) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/staging.bbclass')
-rw-r--r--meta/classes/staging.bbclass12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 4dd2ed0101..5dab42745f 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -470,6 +470,7 @@ python extend_recipe_sysroot() {
470 elif os.path.lexists(depdir + "/" + c): 470 elif os.path.lexists(depdir + "/" + c):
471 os.unlink(depdir + "/" + c) 471 os.unlink(depdir + "/" + c)
472 472
473 binfiles = {}
473 # Now handle installs 474 # Now handle installs
474 for dep in configuredeps: 475 for dep in configuredeps:
475 c = setscenedeps[dep][0] 476 c = setscenedeps[dep][0]
@@ -562,7 +563,16 @@ python extend_recipe_sysroot() {
562 if l.endswith("/"): 563 if l.endswith("/"):
563 staging_copydir(l, targetdir, dest, seendirs) 564 staging_copydir(l, targetdir, dest, seendirs)
564 continue 565 continue
565 staging_copyfile(l, targetdir, dest, postinsts, seendirs) 566 if "/bin/" in l or "/sbin/" in l:
567 # defer /*bin/* files until last in case they need libs
568 binfiles[l] = (targetdir, dest)
569 else:
570 staging_copyfile(l, targetdir, dest, postinsts, seendirs)
571
572 # Handle deferred binfiles
573 for l in binfiles:
574 (targetdir, dest) = binfiles[l]
575 staging_copyfile(l, targetdir, dest, postinsts, seendirs)
566 576
567 bb.note("Installed into sysroot: %s" % str(msg_adding)) 577 bb.note("Installed into sysroot: %s" % str(msg_adding))
568 bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists)) 578 bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists))