concretizer: handle conflicts with compiler ranges correctly

As reported, conflicts with compiler ranges were not treated
correctly. This commit adds tests to verify the expected behavior
for the new concretizer.

The new rules to enforce a correct behavior involve:
- Adding a rule to prefer the compiler selected for
  the root package, if no other preference is set
- Give a strong negative weight to compiler preferences
  expressed in packages.yaml
- Maximize on compiler AND compiler version match
This commit is contained in:
Massimiliano Culpo
2020-10-27 23:37:34 +01:00
committed by Todd Gamblin
parent 0a56b7cfd6
commit d00e8394f8
5 changed files with 70 additions and 21 deletions

View File

@@ -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 Bowtie(Package):
"""Mock package to test conflicts on compiler ranges"""
homepage = "http://www.example.org"
url = "http://bowtie-1.2.2.tar.bz2"
version('1.3.0', '1c837ecd990bb022d07e7aab32b09847')
version('1.2.2', '1c837ecd990bb022d07e7aab32b09847')
version('1.2.0', '1c837ecd990bb022d07e7aab32b09847')
conflicts('%gcc@:4.5.0', when='@1.2.2')

View File

@@ -49,7 +49,7 @@ class Akantu(CMakePackage):
extends('python', when='+python')
conflicts('gcc@:5.3.99')
conflicts('%gcc@:5.3.99')
conflicts('@:3.0.99 external_solvers=petsc')
conflicts('@:3.0.99 +python')