environment: match concrete specs only if they have the same build hash (#25575)
see #25563 When we have a concrete environment and we ask to install a concrete spec from a file, currently Spack returns a list of specs that are all the one that match the argument DAG hash. Instead we want to compare build hashes, which also account for build-only dependencies.
This commit is contained in:
parent
e2e7b0788f
commit
af2f07852c
@ -1602,7 +1602,22 @@ def matching_spec(self, spec):
|
|||||||
# Dependency-only specs will have value None
|
# Dependency-only specs will have value None
|
||||||
matches = {}
|
matches = {}
|
||||||
|
|
||||||
|
if not isinstance(spec, spack.spec.Spec):
|
||||||
|
spec = spack.spec.Spec(spec)
|
||||||
|
|
||||||
for user_spec, concretized_user_spec in self.concretized_specs():
|
for user_spec, concretized_user_spec in self.concretized_specs():
|
||||||
|
# Deal with concrete specs differently
|
||||||
|
if spec.concrete:
|
||||||
|
# Matching a concrete spec is more restrictive
|
||||||
|
# than just matching the dag hash
|
||||||
|
is_match = (
|
||||||
|
spec in concretized_user_spec and
|
||||||
|
concretized_user_spec[spec.name].build_hash() == spec.build_hash()
|
||||||
|
)
|
||||||
|
if is_match:
|
||||||
|
matches[spec] = spec
|
||||||
|
continue
|
||||||
|
|
||||||
if concretized_user_spec.satisfies(spec):
|
if concretized_user_spec.satisfies(spec):
|
||||||
matches[concretized_user_spec] = user_spec
|
matches[concretized_user_spec] = user_spec
|
||||||
for dep_spec in concretized_user_spec.traverse(root=False):
|
for dep_spec in concretized_user_spec.traverse(root=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user