concretizer: try hard to obtain all needed variant_possible_value()'s (#20102)
Track all the variant values mentioned when emitting constraints, validate them and emit a fact that allows them as possible values. This modification ensures that open-ended variants (variants accepting any string or any integer) are projected to the finite set of values that are relevant for this concretization.
This commit is contained in:

committed by
Tamara Dahlgren

parent
30a9e6462f
commit
ab3f1b10db
@@ -0,0 +1,16 @@
|
||||
# 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 SinglevalueVariantDependentType(Package):
|
||||
"""Simple package with one dependency that has a single-valued
|
||||
variant with values=str"""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/archive-1.0.tar.gz"
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
depends_on('singlevalue-variant fum=nope')
|
@@ -0,0 +1,19 @@
|
||||
# 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 SinglevalueVariant(Package):
|
||||
homepage = "http://www.llnl.gov"
|
||||
url = "http://www.llnl.gov/mpileaks-1.0.tar.gz"
|
||||
|
||||
version(1.0, 'foobarbaz')
|
||||
|
||||
variant(
|
||||
'fum',
|
||||
description='Single-valued variant with type in values',
|
||||
default='bar',
|
||||
values=str,
|
||||
multi=False
|
||||
)
|
Reference in New Issue
Block a user