ASP-based solver: decrease the priority of multi-valued variant optimization for root (#26677)
The ASP-based solver maximizes the number of values in multi-valued variants (if other higher order constraints are met), to avoid cases where only a subset of the values that have been specified on the command line or imposed by another constraint are selected. Here we swap the priority of this optimization target with the selection of the default providers, to avoid unexpected results like the one in #26598
This commit is contained in:

committed by
GitHub

parent
c2bf585d17
commit
551120ee0b
@@ -0,0 +1,22 @@
|
||||
# Copyright 2013-2021 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)
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
class SomeVirtualMv(Package):
|
||||
"""Package providing a virtual dependency and with a multivalued variant."""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/foo-1.0.tar.gz"
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
provides('somevirtual')
|
||||
|
||||
# This multi valued variant is needed to trigger an optimization
|
||||
# criteria for clingo
|
||||
variant('libs', default='shared,static', values=('shared', 'static'),
|
||||
multi=True, description='Build shared libs, static libs or both')
|
@@ -0,0 +1,17 @@
|
||||
# Copyright 2013-2021 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)
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
class SomeVirtualPreferred(Package):
|
||||
"""Package providing a virtual dependency with a preference in packages.yaml"""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/foo-1.0.tar.gz"
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
provides('somevirtual')
|
Reference in New Issue
Block a user