summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-12-01 07:45:48 +0100
committerGitHub <noreply@github.com>2020-12-01 07:45:48 +0100
commit7fd777c3d93d7120c4d2ea3c13c1cd7e083181d2 (patch)
tree1f54b3af09f35475dfe6388a073099825638d5e8 /var
parent8edc831e43ef37ded67db700ac74d15d46039e4a (diff)
downloadspack-7fd777c3d93d7120c4d2ea3c13c1cd7e083181d2.tar.gz
spack-7fd777c3d93d7120c4d2ea3c13c1cd7e083181d2.tar.bz2
spack-7fd777c3d93d7120c4d2ea3c13c1cd7e083181d2.tar.xz
spack-7fd777c3d93d7120c4d2ea3c13c1cd7e083181d2.zip
concretizer: swap priority of selecting provider and default variant (#20182)
refers #20040 Before this PR optimization rules would have selected default providers at a higher priority than default variants. Here we swap this priority and we consider variants that are forced by any means (root spec or spec in depends_on clause) the same as if they were with a default value. This prevents the solver from avoiding expected configurations just because they contain directives like: depends_on('pkg+foo') and `+foo` is not the default variant value for pkg.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/conditional-constrained-dependencies/package.py16
-rw-r--r--var/spack/repos/builtin.mock/packages/dep-with-variants/package.py15
-rw-r--r--var/spack/repos/builtin.mock/packages/ecp-viz-sdk/package.py14
3 files changed, 45 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/conditional-constrained-dependencies/package.py b/var/spack/repos/builtin.mock/packages/conditional-constrained-dependencies/package.py
new file mode 100644
index 0000000000..68fee3e9c7
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/conditional-constrained-dependencies/package.py
@@ -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 ConditionalConstrainedDependencies(Package):
+ """Package that has a variant which adds a dependency forced to
+ use non default values.
+ """
+ homepage = "https://dev.null"
+
+ version('1.0')
+
+ # This variant is on by default and attaches a dependency
+ # with a lot of variants set at their non-default values
+ variant('dep', default=True, description='nope')
+ depends_on('dep-with-variants+foo+bar+baz', when='+dep')
diff --git a/var/spack/repos/builtin.mock/packages/dep-with-variants/package.py b/var/spack/repos/builtin.mock/packages/dep-with-variants/package.py
new file mode 100644
index 0000000000..d1b08cd5df
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/dep-with-variants/package.py
@@ -0,0 +1,15 @@
+# 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 DepWithVariants(Package):
+ """Package that has a variant which adds a dependency forced to
+ use non default values.
+ """
+ homepage = "https://dev.null"
+
+ version('1.0')
+
+ variant('foo', default=False, description='nope')
+ variant('bar', default=False, description='nope')
+ variant('baz', default=False, description='nope')
diff --git a/var/spack/repos/builtin.mock/packages/ecp-viz-sdk/package.py b/var/spack/repos/builtin.mock/packages/ecp-viz-sdk/package.py
new file mode 100644
index 0000000000..76e2718c6f
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/ecp-viz-sdk/package.py
@@ -0,0 +1,14 @@
+# 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 EcpVizSdk(Package):
+ """Package that has a dependency with a variant which
+ adds a transitive dependency forced to use non default
+ values.
+ """
+ homepage = "https://dev.null"
+
+ version('1.0')
+
+ depends_on('conditional-constrained-dependencies')