summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2012-05-23 15:16:19 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-14 11:23:48 +0100
commitb30a243f3f9133b62a4003bc28374b0f931e6c41 (patch)
treedd74ea927f32e5f7083d1177aa9a66a0d7b6df1a /meta/classes/sanity.bbclass
parent20657c1fa0def36d48e1bbad6cc3c77470c715eb (diff)
downloadpoky-b30a243f3f9133b62a4003bc28374b0f931e6c41.tar.gz
sanity.bbclass: copy the data store and finalise before running checks
At the ConfigParsed event the datastore has yet to be finalised and thus appends and overrides have not been set. To ensure the sanity check is being run against the configuration values the user has set call finalize() on a copy of the datastore and pass that for all sanity checks. (From OE-Core rev: 527e26ea1e44f114fc9fcec1bc7d83156dba1a70) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass127
1 files changed, 68 insertions, 59 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 687ddebccf..0c2fa04bcc 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -112,8 +112,8 @@ def check_connectivity(d):
112 112
113 return retval 113 return retval
114 114
115def check_supported_distro(e): 115def check_supported_distro(sanity_data):
116 tested_distros = e.data.getVar('SANITY_TESTED_DISTROS', True) 116 tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS', True)
117 if not tested_distros: 117 if not tested_distros:
118 return 118 return
119 119
@@ -160,26 +160,26 @@ def check_supported_distro(e):
160 bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.') 160 bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.')
161 161
162# Checks we should only make if MACHINE is set correctly 162# Checks we should only make if MACHINE is set correctly
163def check_sanity_validmachine(e): 163def check_sanity_validmachine(sanity_data):
164 from bb import data 164 from bb import data
165 165
166 messages = "" 166 messages = ""
167 167
168 # Check TUNE_ARCH is set 168 # Check TUNE_ARCH is set
169 if data.getVar('TUNE_ARCH', e.data, True) == 'INVALID': 169 if data.getVar('TUNE_ARCH', sanity_data, True) == 'INVALID':
170 messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n' 170 messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n'
171 171
172 # Check TARGET_ARCH is set correctly 172 # Check TARGET_ARCH is set correctly
173 if data.getVar('TARGE_ARCH', e.data, False) == '${TUNE_ARCH}': 173 if data.getVar('TARGE_ARCH', sanity_data, False) == '${TUNE_ARCH}':
174 messages = messages + 'TARGET_ARCH is being overwritten, likely by your MACHINE configuration files.\nPlease use a valid tune configuration file which should set this correctly automatically\nand avoid setting this in the machine configuration. See the OE-Core mailing list for more information.\n' 174 messages = messages + 'TARGET_ARCH is being overwritten, likely by your MACHINE configuration files.\nPlease use a valid tune configuration file which should set this correctly automatically\nand avoid setting this in the machine configuration. See the OE-Core mailing list for more information.\n'
175 175
176 # Check TARGET_OS is set 176 # Check TARGET_OS is set
177 if data.getVar('TARGET_OS', e.data, True) == 'INVALID': 177 if data.getVar('TARGET_OS', sanity_data, True) == 'INVALID':
178 messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' 178 messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n'
179 179
180 # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS 180 # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS
181 pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True) 181 pkgarchs = data.getVar('PACKAGE_ARCHS', sanity_data, True)
182 tunepkg = data.getVar('TUNE_PKGARCH', e.data, True) 182 tunepkg = data.getVar('TUNE_PKGARCH', sanity_data, True)
183 tunefound = False 183 tunefound = False
184 seen = {} 184 seen = {}
185 dups = [] 185 dups = []
@@ -201,7 +201,7 @@ def check_sanity_validmachine(e):
201 return messages 201 return messages
202 202
203 203
204def check_sanity(e): 204def check_sanity(sanity_data):
205 from bb import note, error, data, __version__ 205 from bb import note, error, data, __version__
206 206
207 try: 207 try:
@@ -211,7 +211,7 @@ def check_sanity(e):
211 import commands 211 import commands
212 212
213 # Check the bitbake version meets minimum requirements 213 # Check the bitbake version meets minimum requirements
214 minversion = data.getVar('BB_MIN_VERSION', e.data , True) 214 minversion = data.getVar('BB_MIN_VERSION', sanity_data , True)
215 if not minversion: 215 if not minversion:
216 # Hack: BB_MIN_VERSION hasn't been parsed yet so return 216 # Hack: BB_MIN_VERSION hasn't been parsed yet so return
217 # and wait for the next call 217 # and wait for the next call
@@ -233,42 +233,42 @@ def check_sanity(e):
233 messages = messages + 'Bitbake version %s is required and version %s was found\n' % (minversion, __version__) 233 messages = messages + 'Bitbake version %s is required and version %s was found\n' % (minversion, __version__)
234 234
235 # Check that the MACHINE is valid, if it is set 235 # Check that the MACHINE is valid, if it is set
236 if data.getVar('MACHINE', e.data, True): 236 if data.getVar('MACHINE', sanity_data, True):
237 if not check_conf_exists("conf/machine/${MACHINE}.conf", e.data): 237 if not check_conf_exists("conf/machine/${MACHINE}.conf", sanity_data):
238 messages = messages + 'Please set a valid MACHINE in your local.conf or environment\n' 238 messages = messages + 'Please set a valid MACHINE in your local.conf or environment\n'
239 else: 239 else:
240 messages = messages + check_sanity_validmachine(e) 240 messages = messages + check_sanity_validmachine(sanity_data)
241 else: 241 else:
242 messages = messages + 'Please set a MACHINE in your local.conf or environment\n' 242 messages = messages + 'Please set a MACHINE in your local.conf or environment\n'
243 243
244 # Check we are using a valid lacal.conf 244 # Check we are using a valid lacal.conf
245 current_conf = data.getVar('CONF_VERSION', e.data, True) 245 current_conf = data.getVar('CONF_VERSION', sanity_data, True)
246 conf_version = data.getVar('LOCALCONF_VERSION', e.data, True) 246 conf_version = data.getVar('LOCALCONF_VERSION', sanity_data, True)
247 247
248 if current_conf != conf_version: 248 if current_conf != conf_version:
249 messages = messages + "Your version of local.conf was generated from an older version of local.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/local.conf conf/local.conf.sample\" is a good way to visualise the changes.\n" 249 messages = messages + "Your version of local.conf was generated from an older version of local.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/local.conf conf/local.conf.sample\" is a good way to visualise the changes.\n"
250 250
251 # Check bblayers.conf is valid 251 # Check bblayers.conf is valid
252 current_lconf = data.getVar('LCONF_VERSION', e.data, True) 252 current_lconf = data.getVar('LCONF_VERSION', sanity_data, True)
253 lconf_version = data.getVar('LAYER_CONF_VERSION', e.data, True) 253 lconf_version = data.getVar('LAYER_CONF_VERSION', sanity_data, True)
254 if current_lconf != lconf_version: 254 if current_lconf != lconf_version:
255 messages = messages + "Your version of bblayers.conf was generated from an older version of bblayers.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/bblayers.conf conf/bblayers.conf.sample\" is a good way to visualise the changes.\n" 255 messages = messages + "Your version of bblayers.conf was generated from an older version of bblayers.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/bblayers.conf conf/bblayers.conf.sample\" is a good way to visualise the changes.\n"
256 256
257 # If we have a site.conf, check it's valid 257 # If we have a site.conf, check it's valid
258 if check_conf_exists("conf/site.conf", e.data): 258 if check_conf_exists("conf/site.conf", sanity_data):
259 current_sconf = data.getVar('SCONF_VERSION', e.data, True) 259 current_sconf = data.getVar('SCONF_VERSION', sanity_data, True)
260 sconf_version = data.getVar('SITE_CONF_VERSION', e.data, True) 260 sconf_version = data.getVar('SITE_CONF_VERSION', sanity_data, True)
261 if current_sconf != sconf_version: 261 if current_sconf != sconf_version:
262 messages = messages + "Your version of site.conf was generated from an older version of site.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/site.conf conf/site.conf.sample\" is a good way to visualise the changes.\n" 262 messages = messages + "Your version of site.conf was generated from an older version of site.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/site.conf conf/site.conf.sample\" is a good way to visualise the changes.\n"
263 263
264 assume_provided = data.getVar('ASSUME_PROVIDED', e.data , True).split() 264 assume_provided = data.getVar('ASSUME_PROVIDED', sanity_data , True).split()
265 # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf 265 # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf
266 if "diffstat-native" not in assume_provided: 266 if "diffstat-native" not in assume_provided:
267 messages = messages + 'Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n' 267 messages = messages + 'Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n'
268 268
269 # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't 269 # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't
270 # set, since so much relies on it being set. 270 # set, since so much relies on it being set.
271 dldir = data.getVar('DL_DIR', e.data, True) 271 dldir = data.getVar('DL_DIR', sanity_data, True)
272 if not dldir: 272 if not dldir:
273 messages = messages + "DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n" 273 messages = messages + "DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n"
274 if os.path.exists(dldir) and not os.access(dldir, os.W_OK): 274 if os.path.exists(dldir) and not os.access(dldir, os.W_OK):
@@ -276,32 +276,32 @@ def check_sanity(e):
276 276
277 # Check that the DISTRO is valid, if set 277 # Check that the DISTRO is valid, if set
278 # need to take into account DISTRO renaming DISTRO 278 # need to take into account DISTRO renaming DISTRO
279 distro = data.getVar('DISTRO', e.data, True) 279 distro = data.getVar('DISTRO', sanity_data, True)
280 if distro: 280 if distro:
281 if not ( check_conf_exists("conf/distro/${DISTRO}.conf", e.data) or check_conf_exists("conf/distro/include/${DISTRO}.inc", e.data) ): 281 if not ( check_conf_exists("conf/distro/${DISTRO}.conf", sanity_data) or check_conf_exists("conf/distro/include/${DISTRO}.inc", sanity_data) ):
282 messages = messages + "DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % data.getVar("DISTRO", e.data, True ) 282 messages = messages + "DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % data.getVar("DISTRO", sanity_data, True )
283 283
284 missing = "" 284 missing = ""
285 285
286 if not check_app_exists("${MAKE}", e.data): 286 if not check_app_exists("${MAKE}", sanity_data):
287 missing = missing + "GNU make," 287 missing = missing + "GNU make,"
288 288
289 if not check_app_exists('${BUILD_PREFIX}gcc', e.data): 289 if not check_app_exists('${BUILD_PREFIX}gcc', sanity_data):
290 missing = missing + "C Compiler (%sgcc)," % data.getVar("BUILD_PREFIX", e.data, True) 290 missing = missing + "C Compiler (%sgcc)," % data.getVar("BUILD_PREFIX", sanity_data, True)
291 291
292 if not check_app_exists('${BUILD_PREFIX}g++', e.data): 292 if not check_app_exists('${BUILD_PREFIX}g++', sanity_data):
293 missing = missing + "C++ Compiler (%sg++)," % data.getVar("BUILD_PREFIX", e.data, True) 293 missing = missing + "C++ Compiler (%sg++)," % data.getVar("BUILD_PREFIX", sanity_data, True)
294 294
295 required_utilities = e.data.getVar('SANITY_REQUIRED_UTILITIES', True) 295 required_utilities = sanity_data.getVar('SANITY_REQUIRED_UTILITIES', True)
296 296
297 if "qemu-native" in assume_provided: 297 if "qemu-native" in assume_provided:
298 if not check_app_exists("qemu-arm", e.data): 298 if not check_app_exists("qemu-arm", sanity_data):
299 messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH" 299 messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH"
300 300
301 if "." in data.getVar('PATH', e.data, True).split(":"): 301 if "." in data.getVar('PATH', sanity_data, True).split(":"):
302 messages = messages + "PATH contains '.' which will break the build, please remove this" 302 messages = messages + "PATH contains '.' which will break the build, please remove this"
303 303
304 if data.getVar('TARGET_ARCH', e.data, True) == "arm": 304 if data.getVar('TARGET_ARCH', sanity_data, True) == "arm":
305 # This path is no longer user-readable in modern (very recent) Linux 305 # This path is no longer user-readable in modern (very recent) Linux
306 try: 306 try:
307 if os.path.exists("/proc/sys/vm/mmap_min_addr"): 307 if os.path.exists("/proc/sys/vm/mmap_min_addr"):
@@ -315,7 +315,7 @@ def check_sanity(e):
315 pass 315 pass
316 316
317 for util in required_utilities.split(): 317 for util in required_utilities.split():
318 if not check_app_exists( util, e.data ): 318 if not check_app_exists( util, sanity_data ):
319 missing = missing + "%s," % util 319 missing = missing + "%s," % util
320 320
321 if missing != "": 321 if missing != "":
@@ -326,10 +326,10 @@ def check_sanity(e):
326 if pseudo_msg != "": 326 if pseudo_msg != "":
327 messages = messages + pseudo_msg + '\n' 327 messages = messages + pseudo_msg + '\n'
328 328
329 check_supported_distro(e) 329 check_supported_distro(sanity_data)
330 330
331 # Check if DISPLAY is set if IMAGETEST is set 331 # Check if DISPLAY is set if IMAGETEST is set
332 if not data.getVar( 'DISPLAY', e.data, True ) and data.getVar( 'IMAGETEST', e.data, True ) == 'qemu': 332 if not data.getVar( 'DISPLAY', sanity_data, True ) and data.getVar( 'IMAGETEST', sanity_data, True ) == 'qemu':
333 messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n' 333 messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n'
334 334
335 omask = os.umask(022) 335 omask = os.umask(022)
@@ -337,11 +337,11 @@ def check_sanity(e):
337 messages = messages + "Please use a umask which allows a+rx and u+rwx\n" 337 messages = messages + "Please use a umask which allows a+rx and u+rwx\n"
338 os.umask(omask) 338 os.umask(omask)
339 339
340 oes_bb_conf = data.getVar( 'OES_BITBAKE_CONF', e.data, True ) 340 oes_bb_conf = data.getVar( 'OES_BITBAKE_CONF', sanity_data, True )
341 if not oes_bb_conf: 341 if not oes_bb_conf:
342 messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n' 342 messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n'
343 343
344 nolibs = data.getVar('NO32LIBS', e.data, True) 344 nolibs = data.getVar('NO32LIBS', sanity_data, True)
345 if not nolibs: 345 if not nolibs:
346 lib32path = '/lib' 346 lib32path = '/lib'
347 if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ): 347 if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ):
@@ -350,8 +350,8 @@ def check_sanity(e):
350 if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'): 350 if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'):
351 messages = messages + "You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n" 351 messages = messages + "You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n"
352 352
353 tmpdir = data.getVar('TMPDIR', e.data, True) 353 tmpdir = data.getVar('TMPDIR', sanity_data, True)
354 sstate_dir = data.getVar('SSTATE_DIR', e.data, True) 354 sstate_dir = data.getVar('SSTATE_DIR', sanity_data, True)
355 355
356 # Check saved sanity info 356 # Check saved sanity info
357 last_sanity_version = 0 357 last_sanity_version = 0
@@ -368,16 +368,16 @@ def check_sanity(e):
368 if line.startswith('SSTATE_DIR'): 368 if line.startswith('SSTATE_DIR'):
369 last_sstate_dir = line.split()[1] 369 last_sstate_dir = line.split()[1]
370 370
371 sanity_version = int(data.getVar('SANITY_VERSION', e.data, True) or 1) 371 sanity_version = int(data.getVar('SANITY_VERSION', sanity_data, True) or 1)
372 if last_sanity_version < sanity_version: 372 if last_sanity_version < sanity_version:
373 messages = messages + check_sanity_version_change(e.data) 373 messages = messages + check_sanity_version_change(sanity_data)
374 messages = messages + check_sanity_tmpdir_change(tmpdir, e.data) 374 messages = messages + check_sanity_tmpdir_change(tmpdir, sanity_data)
375 messages = messages + check_sanity_sstate_dir_change(sstate_dir, e.data) 375 messages = messages + check_sanity_sstate_dir_change(sstate_dir, sanity_data)
376 else: 376 else:
377 if last_tmpdir != tmpdir: 377 if last_tmpdir != tmpdir:
378 messages = messages + check_sanity_tmpdir_change(tmpdir, e.data) 378 messages = messages + check_sanity_tmpdir_change(tmpdir, sanity_data)
379 if last_sstate_dir != sstate_dir: 379 if last_sstate_dir != sstate_dir:
380 messages = messages + check_sanity_sstate_dir_change(sstate_dir, e.data) 380 messages = messages + check_sanity_sstate_dir_change(sstate_dir, sanity_data)
381 381
382 if os.path.exists("conf") and not messages: 382 if os.path.exists("conf") and not messages:
383 f = file(sanityverfile, 'w') 383 f = file(sanityverfile, 'w')
@@ -402,8 +402,8 @@ def check_sanity(e):
402 # 402 #
403 # Check the 'ABI' of TMPDIR 403 # Check the 'ABI' of TMPDIR
404 # 404 #
405 current_abi = data.getVar('OELAYOUT_ABI', e.data, True) 405 current_abi = data.getVar('OELAYOUT_ABI', sanity_data, True)
406 abifile = data.getVar('SANITY_ABIFILE', e.data, True) 406 abifile = data.getVar('SANITY_ABIFILE', sanity_data, True)
407 if os.path.exists(abifile): 407 if os.path.exists(abifile):
408 f = file(abifile, "r") 408 f = file(abifile, "r")
409 abi = f.read().strip() 409 abi = f.read().strip()
@@ -412,16 +412,16 @@ def check_sanity(e):
412 f.write(current_abi) 412 f.write(current_abi)
413 elif abi == "2" and current_abi == "3": 413 elif abi == "2" and current_abi == "3":
414 bb.note("Converting staging from layout version 2 to layout version 3") 414 bb.note("Converting staging from layout version 2 to layout version 3")
415 os.system(e.data.expand("mv ${TMPDIR}/staging ${TMPDIR}/sysroots")) 415 os.system(sanity_data.expand("mv ${TMPDIR}/staging ${TMPDIR}/sysroots"))
416 os.system(e.data.expand("ln -s sysroots ${TMPDIR}/staging")) 416 os.system(sanity_data.expand("ln -s sysroots ${TMPDIR}/staging"))
417 os.system(e.data.expand("cd ${TMPDIR}/stamps; for i in */*do_populate_staging; do new=`echo $i | sed -e 's/do_populate_staging/do_populate_sysroot/'`; mv $i $new; done")) 417 os.system(sanity_data.expand("cd ${TMPDIR}/stamps; for i in */*do_populate_staging; do new=`echo $i | sed -e 's/do_populate_staging/do_populate_sysroot/'`; mv $i $new; done"))
418 f = file(abifile, "w") 418 f = file(abifile, "w")
419 f.write(current_abi) 419 f.write(current_abi)
420 elif abi == "3" and current_abi == "4": 420 elif abi == "3" and current_abi == "4":
421 bb.note("Converting staging layout from version 3 to layout version 4") 421 bb.note("Converting staging layout from version 3 to layout version 4")
422 if os.path.exists(e.data.expand("${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}")): 422 if os.path.exists(sanity_data.expand("${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}")):
423 os.system(e.data.expand("mv ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS} ${STAGING_BINDIR_CROSS}")) 423 os.system(sanity_data.expand("mv ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS} ${STAGING_BINDIR_CROSS}"))
424 os.system(e.data.expand("ln -s ${STAGING_BINDIR_CROSS} ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}")) 424 os.system(sanity_data.expand("ln -s ${STAGING_BINDIR_CROSS} ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}"))
425 425
426 f = file(abifile, "w") 426 f = file(abifile, "w")
427 f.write(current_abi) 427 f.write(current_abi)
@@ -429,7 +429,7 @@ def check_sanity(e):
429 messages = messages + "Staging layout has changed. The cross directory has been deprecated and cross packages are now built under the native sysroot.\nThis requires a rebuild.\n" 429 messages = messages + "Staging layout has changed. The cross directory has been deprecated and cross packages are now built under the native sysroot.\nThis requires a rebuild.\n"
430 elif abi == "5" and current_abi == "6": 430 elif abi == "5" and current_abi == "6":
431 bb.note("Converting staging layout from version 5 to layout version 6") 431 bb.note("Converting staging layout from version 5 to layout version 6")
432 os.system(e.data.expand("mv ${TMPDIR}/pstagelogs ${SSTATE_MANIFESTS}")) 432 os.system(sanity_data.expand("mv ${TMPDIR}/pstagelogs ${SSTATE_MANIFESTS}"))
433 f = file(abifile, "w") 433 f = file(abifile, "w")
434 f.write(current_abi) 434 f.write(current_abi)
435 elif abi == "7" and current_abi == "8": 435 elif abi == "7" and current_abi == "8":
@@ -442,7 +442,7 @@ def check_sanity(e):
442 f.write(current_abi) 442 f.write(current_abi)
443 f.close() 443 f.close()
444 444
445 oeroot = data.getVar('COREBASE', e.data) 445 oeroot = data.getVar('COREBASE', sanity_data)
446 if oeroot.find ('+') != -1: 446 if oeroot.find ('+') != -1:
447 messages = messages + "Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include a +." 447 messages = messages + "Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include a +."
448 elif oeroot.find (' ') != -1: 448 elif oeroot.find (' ') != -1:
@@ -451,12 +451,21 @@ def check_sanity(e):
451 if messages != "": 451 if messages != "":
452 raise_sanity_error(messages) 452 raise_sanity_error(messages)
453 453
454# Create a copy of the datastore and finalise it to ensure appends and
455# overrides are set - the datastore has yet to be finalised at ConfigParsed
456def copy_data(e):
457 sanity_data = bb.data.createCopy(e.data)
458 sanity_data.finalize()
459 return sanity_data
460
454addhandler check_sanity_eventhandler 461addhandler check_sanity_eventhandler
455python check_sanity_eventhandler() { 462python check_sanity_eventhandler() {
456 if bb.event.getName(e) == "ConfigParsed" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1": 463 if bb.event.getName(e) == "ConfigParsed" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1":
457 check_sanity(e) 464 sanity_data = copy_data(e)
465 check_sanity(sanity_data)
458 elif bb.event.getName(e) == "SanityCheck": 466 elif bb.event.getName(e) == "SanityCheck":
459 check_sanity(e) 467 sanity_data = copy_data(e)
468 check_sanity(sanity_data)
460 bb.event.fire(bb.event.SanityCheckPassed(), e.data) 469 bb.event.fire(bb.event.SanityCheckPassed(), e.data)
461 470
462 return 471 return