]> code.ossystems Code Review - openembedded-core.git/commitdiff
uninative: Add compatiblity version check
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 14 Mar 2018 16:52:18 +0000 (09:52 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 15 Mar 2018 13:37:44 +0000 (06:37 -0700)
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@linuxfoundation.org>
meta/classes/uninative.bbclass
meta/conf/distro/include/yocto-uninative.inc

index 670efa9f0564f9cd6034843fa82d2b7db19c525a..172336428419fc61b6affa5740ba41af77fd4a68 100644 (file)
@@ -77,6 +77,11 @@ python uninative_event_fetchloader() {
                 except FileExistsError:
                     pass
 
+        # 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"), 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")))
+
         cmd = d.expand("\
 mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; \
 cd ${UNINATIVE_STAGING_DIR}-uninative; \
@@ -94,6 +99,8 @@ ${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py \
 
         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.")
index b3f8c247f55095ff456ab72202d76474b36aa0d6..cd5fc0bfe5ba8544a3a65ddb3e8239753ca3234d 100644 (file)
@@ -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"