diff options
author | Elizabeth Fischer <rpf2116@columbia.edu> | 2018-05-18 16:34:11 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-11-09 00:31:24 -0800 |
commit | 037457adc902fcd371efac310a8d5451aef3610f (patch) | |
tree | 022f6fc287139eb1778ffda95791f9b6899dbfed | |
parent | 7f224b616de2ecbf2df645dcdf58efd2a3a0be9a (diff) | |
download | spack-037457adc902fcd371efac310a8d5451aef3610f.tar.gz spack-037457adc902fcd371efac310a8d5451aef3610f.tar.bz2 spack-037457adc902fcd371efac310a8d5451aef3610f.tar.xz spack-037457adc902fcd371efac310a8d5451aef3610f.zip |
specs: save/restore concrete & patches when exporting/importing Specs
-rw-r--r-- | lib/spack/spack/spec.py | 20 |
1 files changed, 20 insertions, 0 deletions
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. |