Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot concretize when specifying platform= in externals #43406

Closed
3 tasks done
fgava90 opened this issue Mar 27, 2024 · 6 comments · Fixed by #43758
Closed
3 tasks done

Cannot concretize when specifying platform= in externals #43406

fgava90 opened this issue Mar 27, 2024 · 6 comments · Fixed by #43758
Assignees
Labels
bug Something isn't working impact-low

Comments

@fgava90
Copy link
Contributor

fgava90 commented Mar 27, 2024

Steps to reproduce

This environment fails to concretize:

spack:
  specs:
  - hwloc
  view: false
  concretizer:
    unify: true
  packages:
    hwloc:
      externals:
      - spec: hwloc@2.2.0 platform=linux
        prefix: /usr
      buildable: False

The behavior regressed in #42253

Original report

I have a package.yaml defined like this (minimal reproducer):

packages:
  hwloc:
    externals:
      - spec: hwloc@2.2.0 # arch=None-None-None works as well
        prefix: /usr
    buildable: False

If i concretize:

$ spack spec hwloc
Input spec
--------------------------------
 -   hwloc

Concretized
--------------------------------
[e]  hwloc@2.2.0%gcc@12.3.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools libs=shared,static arch=linux-rocky8-zen2

All good.
Now if I add anything specific to the arch= spec, like this for example:

packages:
  hwloc:
    externals:
      - spec: hwloc@2.2.0 arch=linux-None-None # added platform
        prefix: /usr
    buildable: False

And try to concretize:

$ spack spec hwloc
==> Error: concretization failed for the following reasons:

   1. Attempted to use external for 'hwloc' which does not satisfy any configured external spec version
   2. Attempted to use external for 'hwloc' which does not satisfy any configured external spec
   3. Attempted to build package hwloc which is not buildable and does not have a satisfying external
        attr('node_version_satisfies', 'hwloc', '=2.2.0') is an external constraint for hwloc which was not satisfied

The error message complains about the version but it's actually fake, as if i add more specific constraints it will complain about something else:

packages:
  hwloc:
    externals:
      - spec: hwloc@2.2.0 arch=linux-rocky8-None # added OS
        prefix: /usr
    buildable: False
$ spack spec hwloc
==> Error: concretization failed for the following reasons:

   1. Cannot select a single "node_os" for package "hwloc"
   2. Attempted to use external for 'hwloc' which does not satisfy any configured external spec
   3. Attempted to build package hwloc which is not buildable and does not have a satisfying external
        attr('node_os', 'hwloc', 'rocky8') is an external constraint for hwloc which was not satisfied

Specifying variants works fine.

I'm executing this with the latest develop branch but this error is present also in 0.21.2.
0.21.1 works fine.

Error message

==> Error: concretization failed for the following reasons:

   1. Attempted to use external for 'hwloc' which does not satisfy any configured external spec version
   2. Attempted to use external for 'hwloc' which does not satisfy any configured external spec
   3. Attempted to build package hwloc which is not buildable and does not have a satisfying external
        attr('node_version_satisfies', 'hwloc', '=2.2.0') is an external constraint for hwloc which was not satisfied

Information on your system

  • Spack: 0.22.0.dev0 (32deca2)
  • Python: 3.6.8
  • Platform: linux-rocky8-zen2
  • Concretizer: clingo

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
@fgava90 fgava90 added bug Something isn't working triage The issue needs to be prioritized labels Mar 27, 2024
@fgava90
Copy link
Contributor Author

fgava90 commented Mar 28, 2024

@becker33 @alalazo could it be this commit here?
9963e2a

@bvanessen
Copy link
Contributor

@becker33 @scheibelp @alalazo
I believe that this is the same bug that I am hitting.

@alalazo
Copy link
Member

alalazo commented Apr 20, 2024

The issue is specific to platform= specification. Minimal reproducer is:

spack:
  specs:
  - hwloc
  view: false
  concretizer:
    unify: true
  packages:
    hwloc:
      externals:
      - spec: hwloc@2.2.0 platform=linux
        prefix: /usr
      buildable: False

@alalazo alalazo changed the title External packages can no longer concretize if arch is specified (since v0.21.2) Cannot concretize when specifying platform= in externals Apr 20, 2024
@alalazo alalazo self-assigned this Apr 20, 2024
@alalazo alalazo added impact-low and removed triage The issue needs to be prioritized labels Apr 20, 2024
@alalazo
Copy link
Member

alalazo commented Apr 20, 2024

While I look for a fix, note that the issue comes from the least useful part of the arch= (at least for an external). I would suggest, as a workaround and as a best practice, to always use the disjoint form and write os= and target= explicitly.

@alalazo
Copy link
Member

alalazo commented Apr 20, 2024

Bisection says this regressed in #42253

@alalazo
Copy link
Member

alalazo commented Apr 20, 2024

Edited the description, kept the original report in a <details> section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact-low
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants