Improve fast_partial compatibility #2240

This commit is contained in:
Thomas Nagy 2019-06-23 08:42:42 +02:00
parent 497b875a89
commit 9b3ab4b874
1 changed files with 12 additions and 5 deletions

View File

@ -18,6 +18,7 @@ Usage::
opt.load('fast_partial')
Assumptions:
* Start with a clean build (run "waf distclean" after enabling)
* Mostly for C/C++/Fortran targets with link tasks (object-only targets are not handled)
try it in the folder generated by utils/genbench.py
* For full project builds: no --targets and no pruning from subfolders
@ -131,12 +132,18 @@ class bld_proxy(object):
data[x] = getattr(self, x)
db = os.path.join(self.variant_dir, Context.DBFILE + self.store_key)
try:
waflib.Node.pickle_lock.acquire()
with waflib.Node.pickle_lock:
waflib.Node.Nod3 = self.node_class
x = Build.cPickle.dumps(data, Build.PROTOCOL)
finally:
waflib.Node.pickle_lock.release()
try:
x = Build.cPickle.dumps(data, Build.PROTOCOL)
except Build.cPickle.PicklingError:
root = data['root']
for node_deps in data['node_deps'].values():
for idx, node in enumerate(node_deps):
# there may be more cross-context Node objects to fix,
# but this should be the main source
node_deps[idx] = root.find_node(node.abspath())
x = Build.cPickle.dumps(data, Build.PROTOCOL)
Logs.debug('rev_use: storing %s', db)
Utils.writef(db + '.tmp', x, m='wb')