summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorBill Randle <william.c.randle@intel.com>2016-03-22 10:23:18 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-24 21:44:26 +0000
commite838b581397bbea9a0f4d74648fcc250073db1ae (patch)
tree3f67729cce9404735533af5899d53d1cb59fa787 /meta/classes/sanity.bbclass
parentc8ac9d483f6e1cfca82dad8cf3e0745935e96214 (diff)
downloadopenembedded-core-e838b581397bbea9a0f4d74648fcc250073db1ae.tar.gz
sanity.bbclass: check host tool dependencies on change in NATIVELSBSTRING
When a user upgrades their host distro, it may no longer have all the required tools installed, but this won't be caught by bitbake resulting in possible build errors. Rather than check for installed tools on every startup, use the NATIVELSBSTRING change as indicator to rescan for host tool dependencies. Store the NATIVELSBSTRING in the sanity_info file. [YOCTO #8585] Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass13
1 files changed, 10 insertions, 3 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 029c6e4fbe..900d97a33e 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -649,9 +649,9 @@ def check_sanity_sstate_dir_change(sstate_dir, data):
return testmsg
def check_sanity_version_change(status, d):
- # Sanity checks to be done when SANITY_VERSION changes
+ # Sanity checks to be done when SANITY_VERSION or NATIVELSBSTRING changes
# In other words, these tests run once in a given build directory and then
- # never again until the sanity version changes.
+ # never again until the sanity version or host distrubution id/version changes.
# Check the python install is complete. glib-2.0-natives requries
# xml.parsers.expat
@@ -945,6 +945,7 @@ def check_sanity(sanity_data):
last_sanity_version = 0
last_tmpdir = ""
last_sstate_dir = ""
+ last_nativelsbstr = ""
sanityverfile = sanity_data.expand("${TOPDIR}/conf/sanity_info")
if os.path.exists(sanityverfile):
with open(sanityverfile, 'r') as f:
@@ -955,12 +956,17 @@ def check_sanity(sanity_data):
last_tmpdir = line.split()[1]
if line.startswith('SSTATE_DIR'):
last_sstate_dir = line.split()[1]
+ if line.startswith('NATIVELSBSTRING'):
+ last_nativelsbstr = line.split()[1]
check_sanity_everybuild(status, sanity_data)
sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1)
network_error = False
- if last_sanity_version < sanity_version:
+ # NATIVELSBSTRING var may have been overridden with "universal", so
+ # get actual host distribution id and version
+ nativelsbstr = lsb_distro_identifier(sanity_data)
+ if last_sanity_version < sanity_version or last_nativelsbstr != nativelsbstr:
check_sanity_version_change(status, sanity_data)
status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data))
else:
@@ -972,6 +978,7 @@ def check_sanity(sanity_data):
f.write("SANITY_VERSION %s\n" % sanity_version)
f.write("TMPDIR %s\n" % tmpdir)
f.write("SSTATE_DIR %s\n" % sstate_dir)
+ f.write("NATIVELSBSTRING %s\n" % nativelsbstr)
sanity_handle_abichanges(status, sanity_data)