Skip to content
Permalink
Browse files

Do not render the coursier workunit unless it will run. (pantsbuild#7218

)

### Problem

Currently the `bootstrap-coursier` workunit is rendered repeatedly, although it only actually runs once.

### Solution

Only render the workunit if it will run.
  • Loading branch information...
stuhood committed Feb 6, 2019
1 parent b2f5a49 commit 121f98c30bcf2fccab786de1f4d9ce26dc1e3c6f
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/python/pants/backend/jvm/tasks/coursier/coursier_subsystem.py
@@ -77,9 +77,8 @@ def bootstrap_coursier(self, workunit_factory):

bootstrap_jar_path = os.path.join(coursier_bootstrap_dir, 'coursier.jar')

with workunit_factory(name='bootstrap-coursier', labels=[WorkUnitLabel.TOOL]) as workunit:

if not os.path.exists(bootstrap_jar_path):
if not os.path.exists(bootstrap_jar_path):
with workunit_factory(name='bootstrap-coursier', labels=[WorkUnitLabel.TOOL]) as workunit:
with safe_concurrent_creation(bootstrap_jar_path) as temp_path:
fetcher = Fetcher(get_buildroot())
checksummer = fetcher.ChecksumListener(digest=hashlib.sha1())
@@ -98,4 +97,4 @@ def bootstrap_coursier(self, workunit_factory):
else:
workunit.set_outcome(WorkUnit.SUCCESS)

return bootstrap_jar_path
return bootstrap_jar_path

0 comments on commit 121f98c

Please sign in to comment.
You can’t perform that action at this time.