raiseRuntimeError('Tried to set unknown builtin option %s.'%optname)
defload(filename):
withopen(filename,'rb')asf:
obj=pickle.load(f)
load_fail_msg='Coredata file {!r} is corrupted. Try with a fresh build tree.'.format(filename)
try:
withopen(filename,'rb')asf:
obj=pickle.load(f)
exceptpickle.UnpicklingError:
raiseMesonException(load_fail_msg)
ifnotisinstance(obj,CoreData):
raiseRuntimeError('Core data file is corrupted.')
raiseMesonException(load_fail_msg)
ifobj.version!=version:
raiseRuntimeError('Build tree has been generated with Meson version %s, which is incompatible with current version %s.'%
raiseMesonException('Build directory has been generated with Meson version %s, which is incompatible with current version %s.\nPlease delete this build directory AND create a new one.'%
(obj.version,version))
returnobj
defsave(obj,filename):
ifobj.version!=version:
raiseRuntimeError('Fatal version mismatch corruption.')
raiseMesonException('Fatal version mismatch corruption.')