concretizer: restrict maximizing variant values to MV variants (#20194)
This commit is contained in:
parent
b4f79f3cb7
commit
a6d433b937
4 changed files with 33 additions and 2 deletions
|
@ -508,7 +508,9 @@ root(Dependency, 1) :- not root(Dependency), node(Dependency).
|
||||||
% need to maximize their number below to ensure they're all set
|
% need to maximize their number below to ensure they're all set
|
||||||
#maximize {
|
#maximize {
|
||||||
1@13,Package,Variant,Value
|
1@13,Package,Variant,Value
|
||||||
: variant_not_default(Package, Variant, Value, Weight), root(Package)
|
: variant_not_default(Package, Variant, Value, Weight),
|
||||||
|
not variant_single_value(Package, Variant),
|
||||||
|
root(Package)
|
||||||
}.
|
}.
|
||||||
#minimize{
|
#minimize{
|
||||||
Weight@13,Provider
|
Weight@13,Provider
|
||||||
|
@ -531,7 +533,9 @@ root(Dependency, 1) :- not root(Dependency), node(Dependency).
|
||||||
% need to maximize their number below to ensure they're all set
|
% need to maximize their number below to ensure they're all set
|
||||||
#maximize {
|
#maximize {
|
||||||
1@8,Package,Variant,Value
|
1@8,Package,Variant,Value
|
||||||
: variant_not_default(Package, Variant, Value, Weight), not root(Package)
|
: variant_not_default(Package, Variant, Value, Weight),
|
||||||
|
not variant_single_value(Package, Variant),
|
||||||
|
not root(Package)
|
||||||
}.
|
}.
|
||||||
|
|
||||||
% Try to maximize the number of compiler matches in the DAG,
|
% Try to maximize the number of compiler matches in the DAG,
|
||||||
|
|
|
@ -975,3 +975,7 @@ def test_all_patches_applied(self):
|
||||||
spec.concretize()
|
spec.concretize()
|
||||||
assert ((uuidpatch, localpatch) ==
|
assert ((uuidpatch, localpatch) ==
|
||||||
spec['libelf'].variants['patches'].value)
|
spec['libelf'].variants['patches'].value)
|
||||||
|
|
||||||
|
def test_dont_select_version_that_brings_more_variants_in(self):
|
||||||
|
s = Spec('dep-with-variants-if-develop-root').concretized()
|
||||||
|
assert s['dep-with-variants-if-develop'].satisfies('@1.0')
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
# 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 DepWithVariantsIfDevelopRoot(Package):
|
||||||
|
"""Package that adds a dependency with many variants only at @develop"""
|
||||||
|
homepage = "https://dev.null"
|
||||||
|
|
||||||
|
version('1.0')
|
||||||
|
|
||||||
|
depends_on('dep-with-variants-if-develop')
|
|
@ -0,0 +1,12 @@
|
||||||
|
# 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 DepWithVariantsIfDevelop(Package):
|
||||||
|
"""Package that adds a dependency with many variants only at @develop"""
|
||||||
|
homepage = "https://dev.null"
|
||||||
|
|
||||||
|
version('develop')
|
||||||
|
version('1.0')
|
||||||
|
|
||||||
|
depends_on('dep-with-variants', when='@develop')
|
Loading…
Reference in a new issue