Compare commits

...

2 Commits

Author SHA1 Message Date
Gregory Becker
d82b537339 more thread safety 2022-07-11 14:00:20 -04:00
Gregory Becker
3d8d1fe924 update binary index before threading 2022-07-11 13:19:45 -04:00
2 changed files with 7 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
from llnl.util.lang import dedupe
from llnl.util.symlink import symlink
import spack.binary_distribution
import spack.bootstrap
import spack.compilers
import spack.concretize
@@ -1282,6 +1283,10 @@ def _concretize_separately(self, tests=False):
# processes try to write the config file in parallel
_ = spack.compilers.get_compiler_config()
# Ensure that buildcache index is updated if reuse is on
if spack.config.get('config:reuse', False):
spack.binary_distribution.binary_index.update()
# Early return if there is nothing to do
if len(arguments) == 0:
return []

View File

@@ -174,6 +174,8 @@ def remove(self, key):
try:
lock.acquire_write()
os.unlink(self.cache_path(key))
except FileNotFoundError:
pass # for thread safety when locks=False
finally:
lock.release_write()
lock.cleanup()