summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/unsat-virtual-dependency/package.py
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-06-22 20:37:24 +0200
committerGitHub <noreply@github.com>2021-06-22 11:37:24 -0700
commitacc11f676dd55b13240674512bf7610334107768 (patch)
tree6703ad695b69c3f355c491a1ac9db3fd51af9b19 /var/spack/repos/builtin.mock/packages/unsat-virtual-dependency/package.py
parent02b92dbf1073fff435be9e5fb91d5188f25c8fc1 (diff)
downloadspack-acc11f676dd55b13240674512bf7610334107768.tar.gz
spack-acc11f676dd55b13240674512bf7610334107768.tar.bz2
spack-acc11f676dd55b13240674512bf7610334107768.tar.xz
spack-acc11f676dd55b13240674512bf7610334107768.zip
ASP-based solver: fix provider logic (#24351)
This commit fixes a subtle bug that may occur when a package is a "possible_provider" of a virtual but no "provides_virtual" can be deduced. In that case the cardinality constraint on "provides_virtual" may arbitrarily assign a package the role of provider even if the constraints for it to be one are not fulfilled. The fix reworks the logic around three concepts: - "possible_provider": a package may provide a virtual if some constraints are met - "provides_virtual": a package meet the constraints to provide a virtual - "provider": a package selected to provide a virtual
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/unsat-virtual-dependency/package.py')
-rw-r--r--var/spack/repos/builtin.mock/packages/unsat-virtual-dependency/package.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/unsat-virtual-dependency/package.py b/var/spack/repos/builtin.mock/packages/unsat-virtual-dependency/package.py
new file mode 100644
index 0000000000..0d3a688565
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/unsat-virtual-dependency/package.py
@@ -0,0 +1,12 @@
+# 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)
+class UnsatVirtualDependency(Package):
+ """This package has a dependency on a virtual that cannot be provided"""
+ homepage = "http://www.example.com"
+ url = "http://www.example.com/v1.0.tgz"
+
+ version('1.0', sha256='foobarbaz')
+
+ depends_on('unsatvdep')