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:

committed by
Tamara Dahlgren

parent
ad84351c43
commit
8e1b5f734f
@@ -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')
|
13
var/spack/repos/builtin.mock/packages/v1-provider/package.py
Normal file
13
var/spack/repos/builtin.mock/packages/v1-provider/package.py
Normal 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')
|
Reference in New Issue
Block a user