environments: transactional concretization

This commit is contained in:
Gregory Becker 2023-05-23 20:23:54 +02:00
parent e1bcefd805
commit 0f1d36585e

View File

@ -1346,6 +1346,11 @@ def concretize(self, force=False, tests=False):
List of specs that have been concretized. Each entry is a tuple of
the user spec and the corresponding concretized spec.
"""
old_concretized_user_specs = self.concretized_user_specs[:]
old_concretized_order = self.concretized_order
old_specs_by_hash = self.specs_by_hash
try:
if force:
# Clear previously concretized specs
self.concretized_user_specs = []
@ -1364,6 +1369,10 @@ def concretize(self, force=False, tests=False):
msg = "concretization strategy not implemented [{0}]"
raise SpackEnvironmentError(msg.format(self.unify))
except Exception:
self.concretized_user_specs = old_concretized_user_specs
self.concretized_order = old_concretized_order
self.specs_by_hash = old_specs_by_hash
def _get_specs_to_concretize(
self,