From 037457adc902fcd371efac310a8d5451aef3610f Mon Sep 17 00:00:00 2001 From: Elizabeth Fischer Date: Fri, 18 May 2018 16:34:11 -0700 Subject: specs: save/restore concrete & patches when exporting/importing Specs --- lib/spack/spack/spec.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index de00a3dd5b..40d5fae28c 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1462,6 +1462,13 @@ class Spec(object): 'module': self.external_module } + d['concrete'] = self._concrete + + if 'patches' in self.variants: + variant = self.variants['patches'] + if hasattr(variant, '_patches_in_order_of_appearance'): + d['patches'] = variant._patches_in_order_of_appearance + # TODO: restore build dependencies here once we have less picky # TODO: concretization. if all_deps: @@ -1553,6 +1560,19 @@ class Spec(object): spec.external_path = None spec.external_module = None + if 'concrete' in node: + spec._concrete = node['concrete'] + + if 'patches' in node: + patches = node['patches'] + if len(patches) > 0: + mvar = spec.variants.setdefault( + 'patches', MultiValuedVariant('patches', ()) + ) + mvar.value = patches + # FIXME: Monkey patches mvar to store patches order + mvar._patches_in_order_of_appearance = patches + # Don't read dependencies here; from_node_dict() is used by # from_yaml() to read the root *and* each dependency spec. -- cgit v1.2.3-70-g09d2