Skip to content

Commit

Permalink
python: check whether a target still needs building after acquiring i…
Browse files Browse the repository at this point in the history
…ts build lock
  • Loading branch information
timbertson committed May 12, 2014
1 parent 070a4f0 commit 324d8d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/gup/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ def add_dependency(self, dep):

def perform_build(self, exe, do_build):
assert os.path.exists(exe)
def still_needs_build():
_log.trace("checking if %s still neeeds build after releasing lock" % self.path)
deps = self.deps()
return deps is None or (not deps.already_built())

with self._ensure_dep_lock().write():
if not still_needs_build():
return False

builder_dep = BuilderDependency(
path=os.path.relpath(exe, os.path.dirname(self.path)),
checksum=None,
Expand Down

0 comments on commit 324d8d1

Please sign in to comment.