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.
This commit is contained in:
Massimiliano Culpo
2020-11-25 22:03:42 +01:00
committed by Tamara Dahlgren
parent ad84351c43
commit 8e1b5f734f
4 changed files with 49 additions and 1 deletions

View File

@@ -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')

View File

@@ -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')