[oe-commits] [openembedded-core] 11/11: uninative: Add compatiblity version check

git at git.openembedded.org git at git.openembedded.org
Thu Mar 15 03:05:09 UTC 2018


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

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

commit 62c8fabacd373fdec34a918be46152f72d0c483b
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Mar 14 09:52:18 2018 -0700

    uninative: Add compatiblity version check
    
    If glibc is newer on the host than in uninative, the failure mode is
    pretty nasty for clusters where the sstate is shared, including the Yocto
    Project autobuilder.
    
    This check aborts the use of uninative in such scenarios where a newer
    glibc version appears and avoids corruption of sstate caches.
    
    We use ldd to check the glibc version since that is included in libc-bin
    (or equivalent) which locales use so it should always be present.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/uninative.bbclass               | 7 +++++++
 meta/conf/distro/include/yocto-uninative.inc | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 241ca74..62a29a1 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -59,6 +59,11 @@ python uninative_event_fetchloader() {
             if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath):
                     os.symlink(localpath, tarballpath)
 
+        # ldd output is "ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23", extract last option from first line
+        glibcver = subprocess.check_output(["ldd", "--version"]).decode('utf-8').split('\n')[0].split()[-1]
+        if bb.utils.vercmp_string(d.getVar("UNINATIVE_MAXGLIBCVERSION", True), glibcver) < 0:
+            raise RuntimeError("Your host glibc verson (%s) is newer than that in uninative (%s). Disabling uninative so that sstate is not corrupted." % (glibcver, d.getVar("UNINATIVE_MAXGLIBCVERSION", True)))
+
         cmd = d.expand("mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; cd ${UNINATIVE_STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; ${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum)
         subprocess.check_call(cmd, shell=True)
 
@@ -67,6 +72,8 @@ python uninative_event_fetchloader() {
 
         enable_uninative(d)
 
+    except RuntimeError as e:
+        bb.warn(str(e))
     except bb.fetch2.BBFetchException as exc:
         bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc))
         bb.warn("To build your own uninative loader, please bitbake uninative-tarball and set UNINATIVE_TARBALL appropriately.")
diff --git a/meta/conf/distro/include/yocto-uninative.inc b/meta/conf/distro/include/yocto-uninative.inc
index b3f8c24..cd5fc0b 100644
--- a/meta/conf/distro/include/yocto-uninative.inc
+++ b/meta/conf/distro/include/yocto-uninative.inc
@@ -6,6 +6,8 @@
 # to the distro running on the build machine.
 #
 
+UNINATIVE_MAXGLIBCVERSION = "2.27"
+
 UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/1.8/"
 UNINATIVE_CHECKSUM[i686] ?= "427ce522ec97f65c75fd89587d90ef789e8cbca4a617abc4b5822abb01c2d0ae"
 UNINATIVE_CHECKSUM[x86_64] ?= "de4947e98e09e1432d069311cc2093974ecb9138a714fd5466f73524de66a693"

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


More information about the Openembedded-commits mailing list