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-25 10:29:16 +0000
commite33124f828d0cd2dd600fff3f6ad3dc98d2723a1 (patch)
tree128ebe4fdc9f3e8542c66a7e7dac13fefd46de71 /meta/classes/sanity.bbclass
parent4fe64d79a08cc08f3322546136e35a080aa5458b (diff)
downloadpoky-e33124f828d0cd2dd600fff3f6ad3dc98d2723a1.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] (From OE-Core rev: e838b581397bbea9a0f4d74648fcc250073db1ae) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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):
649 return testmsg 649 return testmsg
650 650
651def check_sanity_version_change(status, d): 651def check_sanity_version_change(status, d):
652 # Sanity checks to be done when SANITY_VERSION changes 652 # Sanity checks to be done when SANITY_VERSION or NATIVELSBSTRING changes
653 # In other words, these tests run once in a given build directory and then 653 # In other words, these tests run once in a given build directory and then
654 # never again until the sanity version changes. 654 # never again until the sanity version or host distrubution id/version changes.
655 655
656 # Check the python install is complete. glib-2.0-natives requries 656 # Check the python install is complete. glib-2.0-natives requries
657 # xml.parsers.expat 657 # xml.parsers.expat
@@ -945,6 +945,7 @@ def check_sanity(sanity_data):
945 last_sanity_version = 0 945 last_sanity_version = 0
946 last_tmpdir = "" 946 last_tmpdir = ""
947 last_sstate_dir = "" 947 last_sstate_dir = ""
948 last_nativelsbstr = ""
948 sanityverfile = sanity_data.expand("${TOPDIR}/conf/sanity_info") 949 sanityverfile = sanity_data.expand("${TOPDIR}/conf/sanity_info")
949 if os.path.exists(sanityverfile): 950 if os.path.exists(sanityverfile):
950 with open(sanityverfile, 'r') as f: 951 with open(sanityverfile, 'r') as f:
@@ -955,12 +956,17 @@ def check_sanity(sanity_data):
955 last_tmpdir = line.split()[1] 956 last_tmpdir = line.split()[1]
956 if line.startswith('SSTATE_DIR'): 957 if line.startswith('SSTATE_DIR'):
957 last_sstate_dir = line.split()[1] 958 last_sstate_dir = line.split()[1]
959 if line.startswith('NATIVELSBSTRING'):
960 last_nativelsbstr = line.split()[1]
958 961
959 check_sanity_everybuild(status, sanity_data) 962 check_sanity_everybuild(status, sanity_data)
960 963
961 sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1) 964 sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1)
962 network_error = False 965 network_error = False
963 if last_sanity_version < sanity_version: 966 # NATIVELSBSTRING var may have been overridden with "universal", so
967 # get actual host distribution id and version
968 nativelsbstr = lsb_distro_identifier(sanity_data)
969 if last_sanity_version < sanity_version or last_nativelsbstr != nativelsbstr:
964 check_sanity_version_change(status, sanity_data) 970 check_sanity_version_change(status, sanity_data)
965 status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data)) 971 status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data))
966 else: 972 else:
@@ -972,6 +978,7 @@ def check_sanity(sanity_data):
972 f.write("SANITY_VERSION %s\n" % sanity_version) 978 f.write("SANITY_VERSION %s\n" % sanity_version)
973 f.write("TMPDIR %s\n" % tmpdir) 979 f.write("TMPDIR %s\n" % tmpdir)
974 f.write("SSTATE_DIR %s\n" % sstate_dir) 980 f.write("SSTATE_DIR %s\n" % sstate_dir)
981 f.write("NATIVELSBSTRING %s\n" % nativelsbstr)
975 982
976 sanity_handle_abichanges(status, sanity_data) 983 sanity_handle_abichanges(status, sanity_data)
977 984