diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2018-11-03 00:23:06 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-11-09 00:31:24 -0800 |
commit | 13aca774e3af1040e916bc9c53f1f84c6a42cc44 (patch) | |
tree | eff37c0ef8b202311e6f5bcae189b58786b49a67 | |
parent | a41bce2148b185142052b237d73ab2e5e401f72d (diff) | |
download | spack-13aca774e3af1040e916bc9c53f1f84c6a42cc44.tar.gz spack-13aca774e3af1040e916bc9c53f1f84c6a42cc44.tar.bz2 spack-13aca774e3af1040e916bc9c53f1f84c6a42cc44.tar.xz spack-13aca774e3af1040e916bc9c53f1f84c6a42cc44.zip |
bugfix: preserve patch ordering when specs are copied
- The `Spec` class maintains a special `_patches_in_order_of_appearance`
attribute on patch variants, but it is was preserved when specs are
copied.
- This caused issues for some builds
- Add special logic to `Spec` to preserve this variant on copy
- TODO: in the long term we should get rid of the special variant and
make it the responsibility of one of the variant classes.
-rw-r--r-- | lib/spack/spack/spec.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 8b48da52e5..084b8176ec 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2709,6 +2709,15 @@ class Spec(object): self.compiler_flags = other.compiler_flags.copy() self.compiler_flags.spec = self self.variants = other.variants.copy() + + # FIXME: we manage _patches_in_order_of_appearance specially here + # to keep it from leaking out of spec.py, but we should figure + # out how to handle it more elegantly in the Variant classes. + for k, v in other.variants.items(): + patches = getattr(v, '_patches_in_order_of_appearance', None) + if patches: + self.variants[k]._patches_in_order_of_appearance = patches + self.variants.spec = self self.external_path = other.external_path self.external_module = other.external_module |