Skip to content

ASP-based solver: external packages in environment scope are not considered during solve #22547

@alalazo

Description

@alalazo

This error has been reported by @bvanessen If the ASP-based solver is used to concretize a Spack environment, external packages that are declared in the environment scope are not taken into account (while scopes outside the environment instead are).

Steps to reproduce the issue

Using the following spack.yaml:

spack:
  specs:
  - openjpeg
  config:
    concretizer: clingo
  view: false
  packages:
    cmake:
      externals:
      - spec: cmake@3.19.5
        prefix: /usr

and ensuring that there is no external cmake declared in any other scope, one obtains:

$ spack -e . concretize -f
==> Concretized openjpeg
 -   atepy7l  openjpeg@2.3.1%gcc@10.1.0~ipo build_type=RelWithDebInfo arch=linux-ubuntu18.04-broadwell
 -   to7mk5p      ^cmake@3.19.7%gcc@10.1.0~doc+ncurses+openssl+ownlibs~qt build_type=Release patches=b48396c0e4f61756248156b6cebe9bc0d7a22228639b47b5aa77c9330588ce88 arch=linux-ubuntu18.04-broadwell
 -   m73bzjn          ^ncurses@6.2%gcc@10.1.0~symlinks+termlib arch=linux-ubuntu18.04-broadwell
 -   kzr452j              ^pkgconf@1.7.3%gcc@10.1.0 arch=linux-ubuntu18.04-broadwell
 -   7wm24a6          ^openssl@1.1.1j%gcc@10.1.0~docs+systemcerts arch=linux-ubuntu18.04-broadwell
 -   rdmotez              ^perl@5.32.1%gcc@10.1.0+cpanm+shared+threads arch=linux-ubuntu18.04-broadwell
 -   6madour                  ^berkeley-db@18.1.40%gcc@10.1.0~docs patches=b231fcc4d5cff05e5c3a4814f6a5af0e9a966428dc2176540d2c05aff41de522 arch=linux-ubuntu18.04-broadwell
 -   6p234pa                  ^gdbm@1.19%gcc@10.1.0 arch=linux-ubuntu18.04-broadwell
 -   nsh6fwm                      ^readline@8.0%gcc@10.1.0 arch=linux-ubuntu18.04-broadwell
 -   kepdmuv              ^zlib@1.2.11%gcc@10.1.0+optimize+pic+shared arch=linux-ubuntu18.04-broadwell

where externals are not taken into account. When the externals are declared outside of the environment, using their own packages.yaml:

packages:
  cmake:
    externals:
    - spec: cmake@3.19.5
      prefix: /usr

then they are suddenly taken into account:

$ spack -C . -e . concretize -f
==> Concretized openjpeg
 -   atepy7l  openjpeg@2.3.1%gcc@10.1.0~ipo build_type=RelWithDebInfo arch=linux-ubuntu18.04-broadwell
 -   jtt4geb      ^cmake@3.19.5%gcc@10.1.0~doc+ncurses+openssl+ownlibs~qt build_type=Release patches=b48396c0e4f61756248156b6cebe9bc0d7a22228639b47b5aa77c9330588ce88 arch=linux-ubuntu18.04-broadwell
 -   kepdmuv      ^zlib@1.2.11%gcc@10.1.0+optimize+pic+shared arch=linux-ubuntu18.04-broadwell

Error Message

No error message, just the unexpected behavior described above.

Information on your system

  • Spack: 0.16.1-1888-f5b9f86bdb
  • Python: 3.6.9
  • Platform: linux-ubuntu18.04-broadwell
  • Concretizer: clingo

Additional 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

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions