path: root/meta/classes
diff options
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-14 09:52:18 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-14 19:50:10 -0700
commitd6f6101cd0ae92e8ad2dec0bcb6db5044726edf9 (patch)
treed1f5d4a18805fa2e37bbb4a283c9dff43adfdcbb /meta/classes
parent2d798f9f56fbd7cd20de4b797a476ad24c214ff3 (diff)
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@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 670efa9f05..1723364284 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -77,6 +77,11 @@ python uninative_event_fetchloader() {
except FileExistsError:
+ # 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 \
+ 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.")