Skip to content

solver: virtual preference with provider details not honored #51262

@alalazo

Description

@alalazo

Steps to reproduce

Reported by @haampie in DM

With a package config file like:

packages:
  c:
    prefer:
    - gcc@9
  gcc:
    externals:
    - spec: [email protected] languages:='c,c++,fortran'
      prefix: /usr
      extra_attributes:
        compilers:
          c: /usr/bin/gcc
          cxx: /usr/bin/g++
          fortran: /usr/bin/gfortran
    - spec: [email protected] languages:='c,c++,fortran'
      prefix: /usr
      extra_attributes:
        compilers:
          c: /usr/bin/gcc-10
          cxx: /usr/bin/g++-10
          fortran: /usr/bin/gfortran-10

the following spec does not concretize, while it should:

$ spack solve zlib %c=gcc@10

Error message

$ spack solve zlib %c=gcc@10
==> Error: failed to concretize `zlib %c=gcc@10` for the following reasons:
     1. Cannot satisfy 'gcc@9'
     2. Cannot satisfy 'gcc@9'
        required because gcc@9 is a requirement for package c 
          required because gcc available as external when satisfying gcc@=10.5.0 languages:='c,c++,fortran' 
          required because  is a requirement for package c 
     3. Cannot satisfy 'gcc@=10.5.0' and 'gcc@9'
        required because gcc@9 is a requirement for package c 
          required because gcc available as external when satisfying gcc@=10.5.0 languages:='c,c++,fortran' 
          required because  is a requirement for package c 
        required because gcc available as external when satisfying gcc@=10.5.0 languages:='c,c++,fortran' 
          required because gcc@9 is a requirement for package c 
            required because  is a requirement for package c

Information on your system

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions