summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-03-26 11:17:04 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2021-05-22 11:51:20 -0700
commit6e714808fa1c461d9c7e4be5502ffcb9cb2e9a66 (patch)
tree08f2e760b7db27bb60ced5cc3ea297f415dc72d3 /var
parent9f99e8ad6484165dd957857ec26c68654ba0b8f8 (diff)
downloadspack-6e714808fa1c461d9c7e4be5502ffcb9cb2e9a66.tar.gz
spack-6e714808fa1c461d9c7e4be5502ffcb9cb2e9a66.tar.bz2
spack-6e714808fa1c461d9c7e4be5502ffcb9cb2e9a66.tar.xz
spack-6e714808fa1c461d9c7e4be5502ffcb9cb2e9a66.zip
Enforce uniqueness of the version_weight atom per node
fixes #22565 This change enforces the uniqueness of the version_weight atom per node(Package) in the DAG. It does so by applying FTSE and adding an extra layer of indirection with the possible_version_weight/2 atom. Before this change it may have happened that for the same node two different version_weight/2 were in the answer set, each of which referred to a different spec with the same version, and their weights would sum up. This lead to unexpected result like preferring to build a new version of an external if the external version was older.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/old-external/package.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/old-external/package.py b/var/spack/repos/builtin.mock/packages/old-external/package.py
new file mode 100644
index 0000000000..cf414195a2
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/old-external/package.py
@@ -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)
+class OldExternal(Package):
+ """A package that has an old version declared in packages.yaml"""
+
+ homepage = "https://www.example.com"
+ url = "https://www.example.com/old-external.tar.gz"
+
+ version('1.2.0', '0123456789abcdef0123456789abcdef')
+ version('1.1.4', '0123456789abcdef0123456789abcdef')
+ version('1.1.3', '0123456789abcdef0123456789abcdef')
+ version('1.1.2', '0123456789abcdef0123456789abcdef')
+ version('1.1.1', '0123456789abcdef0123456789abcdef')
+ version('1.1.0', '0123456789abcdef0123456789abcdef')
+ version('1.0.0', '0123456789abcdef0123456789abcdef')