diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-11-25 22:03:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 22:03:42 +0100 |
commit | 983fb11dee5801ed74fdbcb78493c0d31e3872cb (patch) | |
tree | 50379d04a3135ff8d4fe3c1589bd091248c23aae /var | |
parent | b33969598aaa5ad59ed38f9fc8a17be2f57c1b9e (diff) | |
download | spack-983fb11dee5801ed74fdbcb78493c0d31e3872cb.tar.gz spack-983fb11dee5801ed74fdbcb78493c0d31e3872cb.tar.bz2 spack-983fb11dee5801ed74fdbcb78493c0d31e3872cb.tar.xz spack-983fb11dee5801ed74fdbcb78493c0d31e3872cb.zip |
concretizer: treat conditional providers correctly (#20086)
refers #20040
This modification emits rules like:
provides_virtual("netlib-lapack","blas") :- variant_value("netlib-lapack","external-blas","False").
for packages that provide virtual dependencies conditionally instead
of a fact that doesn't account for the condition.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/conditional-provider/package.py | 18 | ||||
-rw-r--r-- | var/spack/repos/builtin.mock/packages/v1-provider/package.py | 13 |
2 files changed, 31 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/conditional-provider/package.py b/var/spack/repos/builtin.mock/packages/conditional-provider/package.py new file mode 100644 index 0000000000..e95f2ad54c --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/conditional-provider/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +class ConditionalProvider(Package): + """Mimic the real netlib-lapack, that may be built on top of an + optimized blas. + """ + homepage = "https://dev.null" + + version('1.0') + + variant('disable-v1', default=False, description='nope') + + provides('v2') + provides('v1', when='~disable-v1') + + depends_on('v1', when='+disable-v1') diff --git a/var/spack/repos/builtin.mock/packages/v1-provider/package.py b/var/spack/repos/builtin.mock/packages/v1-provider/package.py new file mode 100644 index 0000000000..46b7a99ac9 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/v1-provider/package.py @@ -0,0 +1,13 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +class V1Provider(Package): + """Mimic the real netlib-lapack, that may be built on top of an + optimized blas. + """ + homepage = "https://dev.null" + + version('1.0') + + provides('v1') |