diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-03-10 20:53:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 11:53:45 -0800 |
commit | 2cd5c0092352b5cfe14f5a47bdfa697a8f0a26e7 (patch) | |
tree | bcdaddee68a72ffda86721bc955fbeb8c4314250 /var | |
parent | 3d624d204f6f7170a02f3f7b1bc168c390791068 (diff) | |
download | spack-2cd5c0092352b5cfe14f5a47bdfa697a8f0a26e7.tar.gz spack-2cd5c0092352b5cfe14f5a47bdfa697a8f0a26e7.tar.bz2 spack-2cd5c0092352b5cfe14f5a47bdfa697a8f0a26e7.tar.xz spack-2cd5c0092352b5cfe14f5a47bdfa697a8f0a26e7.zip |
Allow for multiple dependencies/dependents from the same package (#28673)
Change the internal representation of `Spec` to allow for multiple dependencies or
dependents stemming from the same package. This change permits to represent cases
which are frequent in cross compiled environments or to bootstrap compilers.
Modifications:
- [x] Substitute `DependencyMap` with `_EdgeMap`. The main differences are that the
latter does not support direct item assignment and can be modified only through its
API. It also provides a `select_by` method to query items.
- [x] Reworked a few public APIs of `Spec` to get list of dependencies or related edges.
- [x] Added unit tests to prevent regression on #11983 and prove the synthetic construction
of specs with multiple deps from the same package.
Since #22845 went in first, this PR reuses that format and thus it should not change hashes.
The same package may be present multiple times in the list of dependencies with different
associated specs (each with its own hash).
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/petsc/package.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index e7ea1f08d0..f95f428cef 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -415,6 +415,7 @@ class Petsc(Package, CudaPackage, ROCmPackage): # default: 'gmp', => ('gmp', 'gmp', True, True) # any other combination needs a full tuple # if not (useinc || uselib): usedir - i.e (False, False) + direct_dependencies = [x.name for x in spec.dependencies()] for library in ( ('cuda', 'cuda', False, False), ('hip', 'hip', True, False), @@ -465,7 +466,7 @@ class Petsc(Package, CudaPackage, ROCmPackage): useinc = True uselib = True - library_requested = spacklibname.split(':')[0] in spec.dependencies_dict() + library_requested = spacklibname.split(':')[0] in direct_dependencies options.append( '--with-{library}={value}'.format( library=petsclibname, |