don't remove patches variant

Patches variant needs to stay on the spec even if we also have resources.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
This commit is contained in:
Todd Gamblin 2024-08-15 00:05:35 -07:00
parent b8ecccbde9
commit d5f4c69076
No known key found for this signature in database
GPG Key ID: C16729F1AACF66C6

View File

@ -2173,10 +2173,7 @@ def to_node_dict(self, hash=ht.dag_hash):
if self.namespace: if self.namespace:
d["namespace"] = self.namespace d["namespace"] = self.namespace
# Get all variants *except* for patches. Patches are included in "artifacts" below. params = syaml.syaml_dict(sorted(v.yaml_entry() for _, v in self.variants.items()))
params = syaml.syaml_dict(
sorted(v.yaml_entry() for _, v in self.variants.items() if v.name != "patches")
)
# Only need the string compiler flag for yaml file # Only need the string compiler flag for yaml file
params.update( params.update(
@ -2201,6 +2198,11 @@ def to_node_dict(self, hash=ht.dag_hash):
if not self._concrete: if not self._concrete:
d["concrete"] = False d["concrete"] = False
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
if self._concrete and hash.package_hash: if self._concrete and hash.package_hash:
# We use the `_package_hash` attribute here instead of `self.package_hash()` # We use the `_package_hash` attribute here instead of `self.package_hash()`
# because `_package_hash` is *always* assigned at concretization time. If # because `_package_hash` is *always* assigned at concretization time. If