mirror of https://gitlab.com/ita1024/waf.git
Fix deadlocks affecting generated Fortran files #2187
This commit is contained in:
parent
3e06a0b9a2
commit
3fc8c8c68a
|
@ -226,6 +226,10 @@ class Parallel(object):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if cond:
|
if cond:
|
||||||
|
# The most common reason is conflicting build order declaration
|
||||||
|
# for example: "X run_after Y" and "Y run_after X"
|
||||||
|
# Another can be changing "run_after" dependencies while the build is running
|
||||||
|
# for example: updating "tsk.run_after" in the "runnable_status" method
|
||||||
lst = []
|
lst = []
|
||||||
for tsk in self.postponed:
|
for tsk in self.postponed:
|
||||||
deps = [id(x) for x in tsk.run_after if not x.hasrun]
|
deps = [id(x) for x in tsk.run_after if not x.hasrun]
|
||||||
|
@ -298,6 +302,8 @@ class Parallel(object):
|
||||||
def mark_finished(self, tsk):
|
def mark_finished(self, tsk):
|
||||||
def try_unfreeze(x):
|
def try_unfreeze(x):
|
||||||
# DAG ancestors are likely to be in the incomplete set
|
# DAG ancestors are likely to be in the incomplete set
|
||||||
|
# This assumes that the run_after contents have not changed
|
||||||
|
# after the build starts, else a deadlock may occur
|
||||||
if x in self.incomplete:
|
if x in self.incomplete:
|
||||||
# TODO remove dependencies to free some memory?
|
# TODO remove dependencies to free some memory?
|
||||||
# x.run_after.remove(tsk)
|
# x.run_after.remove(tsk)
|
||||||
|
|
|
@ -590,6 +590,9 @@ class Task(evil):
|
||||||
"""
|
"""
|
||||||
Run this task only after the given *task*.
|
Run this task only after the given *task*.
|
||||||
|
|
||||||
|
Calling this method from :py:meth:`waflib.Task.Task.runnable_status` may cause
|
||||||
|
build deadlocks; see :py:meth:`waflib.Tools.fc.fc.runnable_status` for details.
|
||||||
|
|
||||||
:param task: task
|
:param task: task
|
||||||
:type task: :py:class:`waflib.Task.Task`
|
:type task: :py:class:`waflib.Task.Task`
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -121,6 +121,8 @@ class fc(Task.Task):
|
||||||
for k in ins.keys():
|
for k in ins.keys():
|
||||||
for a in ins[k]:
|
for a in ins[k]:
|
||||||
a.run_after.update(outs[k])
|
a.run_after.update(outs[k])
|
||||||
|
for x in outs[k]:
|
||||||
|
self.generator.bld.producer.revdeps[x].add(a)
|
||||||
|
|
||||||
# the scanner cannot output nodes, so we have to set them
|
# the scanner cannot output nodes, so we have to set them
|
||||||
# ourselves as task.dep_nodes (additional input nodes)
|
# ourselves as task.dep_nodes (additional input nodes)
|
||||||
|
|
Loading…
Reference in New Issue