Skip to content

Compiler constraints not respected for external packages #8082

@alalazo

Description

@alalazo

External packages are always concretized using the latest compiler available, regardless of the initial request.

Expected Result

$ spack compiler list
==> Available compilers
-- gcc ubuntu18.04-x86_64 ---------------------------------------
gcc@8  gcc@7.3.0

$ spack spec -Il openssl %gcc@7.3.0
Input spec
--------------------------------
     openssl%gcc@7.3.0

Concretized
--------------------------------
     dobj3bn  openssl@1.0.2n%gcc@7.3.0+systemcerts arch=linux-ubuntu18.04-x86_64 

Actual Result

$ spack spec -Il openssl %gcc@7.3.0
Input spec
--------------------------------
     openssl%gcc@7.3.0

Concretized
--------------------------------
     dobj3bn  openssl@1.0.2n%gcc@8+systemcerts arch=linux-ubuntu18.04-x86_64 

Note the %gcc@8 instead of %gcc%7.3.0 as requested.

Steps to reproduce the issue

Configure Spack with the following packages.yaml:

packages:
  openssl:
    buildable: False
    paths:
      openssl@1.0.2n: /usr

and the following compilers.yaml:

compilers:
- compiler:
    environment: {}
    extra_rpaths: []
    flags: {}
    modules: []
    operating_system: ubuntu18.04
    paths:
      cc: /usr/bin/gcc-8
      cxx: /usr/bin/g++-8
      f77: /usr/bin/gfortran-8
      fc: /usr/bin/gfortran-8
    spec: gcc@8
    target: x86_64
- compiler:
    environment: {}
    extra_rpaths: []
    flags: {}
    modules: []
    operating_system: ubuntu18.04
    paths:
      cc: /usr/bin/gcc
      cxx: /usr/bin/g++
      f77: /usr/bin/gfortran
      fc: /usr/bin/gfortran
    spec: gcc@7.3.0
    target: x86_64

Information on your system

The only relevant part should be the two configuration files above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions