spack audit: account for % new semantic
Since % means "direct build dependency", we need to exclude it from the check in audits.
This commit is contained in:
parent
a8806e494b
commit
8a78eb8c28
@ -55,6 +55,7 @@ def _search_duplicate_compilers(error_cls):
|
||||
|
||||
import spack.builder
|
||||
import spack.config
|
||||
import spack.deptypes
|
||||
import spack.fetch_strategy
|
||||
import spack.patch
|
||||
import spack.repo
|
||||
@ -1014,7 +1015,14 @@ def _issues_in_depends_on_directive(pkgs, error_cls):
|
||||
# depends_on('foo+bar ^fee+baz')
|
||||
#
|
||||
# but we'd like to have two dependencies listed instead.
|
||||
nested_dependencies = dep.spec.dependencies()
|
||||
nested_dependencies = dep.spec.edges_to_dependencies()
|
||||
# Filter out pure build dependencies, like:
|
||||
#
|
||||
# depends_on('foo+bar%gcc')
|
||||
#
|
||||
nested_dependencies = [
|
||||
x for x in nested_dependencies if x.depflag != spack.deptypes.BUILD
|
||||
]
|
||||
if nested_dependencies:
|
||||
summary = f"{pkg_name}: nested dependency declaration '{dep.spec}'"
|
||||
ndir = len(nested_dependencies) + 1
|
||||
|
Loading…
Reference in New Issue
Block a user