summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/concretize_preferences.py12
-rw-r--r--lib/spack/spack/test/data/config/packages.yaml2
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/spack/spack/test/concretize_preferences.py b/lib/spack/spack/test/concretize_preferences.py
index b5b631d6af..598e9d08fb 100644
--- a/lib/spack/spack/test/concretize_preferences.py
+++ b/lib/spack/spack/test/concretize_preferences.py
@@ -384,3 +384,15 @@ mpi:
assert '~external' in s['vdefault-or-external']
assert 'externaltool' not in s
+
+ @pytest.mark.regression('25585')
+ def test_dependencies_cant_make_version_parent_score_better(self):
+ """Test that a package can't select a worse version for a
+ dependent because doing so it can pull-in a dependency
+ that makes the overall version score even or better and maybe
+ has a better score in some lower priority criteria.
+ """
+ s = Spec('version-test-root').concretized()
+
+ assert s.satisfies('^version-test-pkg@2.4.6')
+ assert 'version-test-dependency-preferred' not in s
diff --git a/lib/spack/spack/test/data/config/packages.yaml b/lib/spack/spack/test/data/config/packages.yaml
index b2c3a33b42..84f470d208 100644
--- a/lib/spack/spack/test/data/config/packages.yaml
+++ b/lib/spack/spack/test/data/config/packages.yaml
@@ -47,3 +47,5 @@ packages:
externals:
- spec: external-non-default-variant@3.8.7~foo~bar
prefix: /usr
+ version-test-dependency-preferred:
+ version: ['5.2.5'] \ No newline at end of file