[oe-commits] [openembedded-core] 01/18: staging: Handle races between binaries and their libs

git at git.openembedded.org git at git.openembedded.org
Sat Feb 15 10:28:07 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 29d17fe23265bf0c7defa14ffc0f677af15c6818
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Feb 14 12:50:18 2020 +0000

    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.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/staging.bbclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 4dd2ed0..5dab427 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -470,6 +470,7 @@ python extend_recipe_sysroot() {
         elif os.path.lexists(depdir + "/" + c):
             os.unlink(depdir + "/" + c)
 
+    binfiles = {}
     # Now handle installs
     for dep in configuredeps:
         c = setscenedeps[dep][0]
@@ -562,7 +563,16 @@ python extend_recipe_sysroot() {
                     if l.endswith("/"):
                         staging_copydir(l, targetdir, dest, seendirs)
                         continue
-                    staging_copyfile(l, targetdir, dest, postinsts, seendirs)
+                    if "/bin/" in l or "/sbin/" in l:
+                        # defer /*bin/* files until last in case they need libs
+                        binfiles[l] = (targetdir, dest)
+                    else:
+                        staging_copyfile(l, targetdir, dest, postinsts, seendirs)
+
+    # Handle deferred binfiles
+    for l in binfiles:
+        (targetdir, dest) = binfiles[l]
+        staging_copyfile(l, targetdir, dest, postinsts, seendirs)
 
     bb.note("Installed into sysroot: %s" % str(msg_adding))
     bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list