Skip to content

Spack v1.0: not choosing external package #51237

@harshula

Description

@harshula

Steps to reproduce

The behaviour between Spack v0.22.5 and v1.0 appears to have changed in terms of external packages.

packages.yaml:

packages:
  cmake:
    externals:
    - spec: [email protected]
      prefix: /apps/cmake/3.24.2
    - spec: [email protected]
      prefix: /apps/cmake/3.31.6
    buildable: false
$ spack env activate -p access-test
$ spack concretize -f
==> Fetching https://ghcr.io/v2/spack/bootstrap-buildcache-v1/blobs/sha256:232504c082b9badb4b1c2540f36f2e0c28f8f314f742262935e82aef0c049a0c
==> Fetching https://ghcr.io/v2/spack/bootstrap-buildcache-v1/blobs/sha256:90b7cf4dd98e26c58578ad8604738cc32dfbb228cfb981bdfe103c99d0e7b5dd
==> Installing "clingo-bootstrap@=spack~docs+ipo+optimized+python+static_libstdcpp build_system=cmake build_type=Release generator=make patches:=bebb819,ec99431 arch=linux-centos7-x86_64" from a buildcache
==> Warning: The default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.
==> Error: failed to concretize `[email protected]=2025.06.001` for the following reasons:
     1. cannot satisfy a requirement for package 'cmake'.

However, if I add:

$ git diff
diff --git a/spack.yaml b/spack.yaml
index cff8cfd..9e5e175 100644
--- a/spack.yaml
+++ b/spack.yaml
@@ -36,6 +36,9 @@ spack:
     gcc-runtime:
       require:
         - '%gcc'
+    cmake:
+      require:
+        - '@3.31.6'
     # When using multi-HPC builds, this spack.packages.all section can be commented out.
     all:
       require:
[access-test] $ spack concretize -f
==> Concretized 1 spec:
 -   tzsmekb  [email protected]=2025.06.001+mpi build_system=bundle commit=ad752e79c09641bf88a3eddf291a48a2c4f2c842 arch=linux-rocky8-x86_64 
 -   hh3me77      ^access-test-component@main~ipo+mpi build_system=cmake build_type=Release commit=a20fc23a548d3e712f4810f61d7c7501a494c022 generator=make arch=linux-rocky8-x86_64 %[email protected]
[e]  g7rjfeh          ^[email protected]~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release patches:=fdea723 arch=linux-rocky8-x86_64_v4 
 -   frteov3          ^[email protected] build_system=generic arch=linux-rocky8-x86_64 
[e]  2qfauaq          ^[email protected]~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' arch=linux-rocky8-x86_64 
 -   4udwuf4          ^[email protected] build_system=generic arch=linux-rocky8-x86_64 
[e]  vuczjrb          ^[email protected] build_system=autotools arch=linux-rocky8-x86_64 
 -   q3hqtxt          ^[email protected]~guile build_system=generic arch=linux-rocky8-x86_64 %[email protected]
[e]  hxuiquw              ^[email protected] build_system=generic arch=linux-rocky8-x86_64 
[e]  g5lm4ia          ^[email protected]+atomics~cuda~cxx~cxx_exceptions~debug+fortran~gpfs~internal-hwloc~internal-libevent~internal-pmix~ipv6~java~lustre~memchecker~openshmem~orterunprefix~rocm+romio+rsh~singularity~static~two_level_namespace+vt+wrapper-rpath build_system=autotools fabrics:=none romio-filesystem:=none schedulers:=none arch=linux-rocky8-x86_64 

Error message

$ spack --debug --stacktrace concretize -f
lib/spack/spack/cmd/__init__.py:125 ==> [2025-08-28-02:07:12.366603] Imported concretize from built-in commands
lib/spack/spack/cmd/__init__.py:125 ==> [2025-08-28-02:07:12.370023] Imported concretize from built-in commands
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:12.444456] Reading config from file /[...]/test-spack-v1.0-2/environments/access-test/spack.yaml
lib/spack/spack/environment/environment.py:249 ==> [2025-08-28-02:07:12.463439] Deactivated environment 'access-test'
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:12.500493] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/repos.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:12.509764] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/repos.yaml
lib/spack/spack/environment/environment.py:222 ==> [2025-08-28-02:07:12.525984] Using environment 'access-test'
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:12.526806] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/concretizer.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:12.545648] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/concretizer.yaml
lib/spack/spack/database.py:611 ==> [2025-08-28-02:07:12.637180] DATABASE LOCK TIMEOUT: 600s
lib/spack/spack/store.py:181 ==> [2025-08-28-02:07:12.637767] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:12.640202] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:12.700016] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/packages.yaml
lib/spack/spack/database.py:611 ==> [2025-08-28-02:07:18.690342] DATABASE LOCK TIMEOUT: 600s
lib/spack/spack/store.py:181 ==> [2025-08-28-02:07:18.690971] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/database.py:611 ==> [2025-08-28-02:07:18.700531] DATABASE LOCK TIMEOUT: 600s
lib/spack/spack/store.py:181 ==> [2025-08-28-02:07:18.701039] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:18.983581] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/mirrors.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.210026] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/environment/environment.py:249 ==> [2025-08-28-02:07:19.231552] Deactivated environment 'access-test'
lib/spack/spack/bootstrap/config.py:127 ==> [2025-08-28-02:07:19.235973] [BOOTSTRAP CONFIG SCOPE] name=_builtin
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.237190] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/config.py:136 ==> [2025-08-28-02:07:19.246529] [BOOTSTRAP CONFIG SCOPE] name=defaults, path=/[...]/test-spack-v1.0-2/spack/etc/spack/defaults
lib/spack/spack/bootstrap/config.py:136 ==> [2025-08-28-02:07:19.246748] [BOOTSTRAP CONFIG SCOPE] name=bootstrap, path=/[...]/test-spack-v1.0-2/bootstrap/config
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.247630] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/include.yaml
lib/spack/spack/config.py:866 ==> [2025-08-28-02:07:19.251064] Creating DirectoryConfigScope defaults:linux for '/[...]/test-spack-v1.0-2/spack/etc/spack/defaults/linux'
lib/spack/spack/config.py:866 ==> [2025-08-28-02:07:19.251438] Creating DirectoryConfigScope defaults:base for '/[...]/test-spack-v1.0-2/spack/etc/spack/defaults/base'
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.254513] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/config.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.276427] Reading config from file /[...]/test-spack-v1.0-2/bootstrap/config/config.yaml
lib/spack/spack/database.py:611 ==> [2025-08-28-02:07:19.289056] DATABASE LOCK TIMEOUT: 600s
lib/spack/spack/store.py:181 ==> [2025-08-28-02:07:19.289315] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.361651] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.422745] Reading config from file /[...]/test-spack-v1.0-2/bootstrap/config/packages.yaml
lib/spack/spack/bootstrap/_common.py:239 ==> [2025-08-28-02:07:19.507705] [BOOTSTRAP ROOT SPEC] clingo-bootstrap@spack+python platform=linux target=x86_64
lib/spack/spack/bootstrap/core.py:358 ==> [2025-08-28-02:07:19.508300] [BOOTSTRAP MODULE clingo] Try importing from Python
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.510070] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/_common.py:97 ==> [2025-08-28-02:07:19.563645] [BOOTSTRAP MODULE clingo] The installed spec "clingo-bootstrap@spack+python platform=linux target=x86_64 ^[email protected]/a4oyom2bc4go3floq7jlymc2l745w7vl" provides the "clingo" Python module
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.565069] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/config.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.587925] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/config.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.592952] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/repos.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.597120] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/repos.yaml
lib/spack/spack/environment/environment.py:222 ==> [2025-08-28-02:07:19.603350] Using environment 'access-test'
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.613826] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:19.699002] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/packages.yaml
lib/spack/spack/solver/asp.py:3598 ==> [2025-08-28-02:07:20.113208] the spec [email protected]/5z3r7zdqd4qm7dghzbkjuip6zh4xvpiy does not provide a C compiler.
lib/spack/spack/solver/asp.py:3598 ==> [2025-08-28-02:07:20.120459] the spec [email protected]/ywm7olzdrnskvmlzuz7egldvsmd2ammq does not provide a C compiler.
lib/spack/spack/solver/asp.py:3598 ==> [2025-08-28-02:07:20.127049] the spec [email protected]/wdnpbv6kshw6vchypxbnlfhqghbt73q6 does not provide a C compiler.
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:20.795166] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/defaults/concretizer.yaml
lib/spack/spack/config.py:1189 ==> [2025-08-28-02:07:20.828195] Reading config from file /[...]/test-spack-v1.0-2/spack/etc/spack/concretizer.yaml
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:21.227965] [spack.solver.input_analysis] msmpi is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:22.417128] [spack.solver.input_analysis] apple-libuuid is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:22.809900] [spack.solver.input_analysis] nvpl-blas is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:22.903454] [spack.solver.input_analysis] veclibfort is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:22.940576] [spack.solver.input_analysis] nvpl-lapack is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:23.570064] [spack.solver.input_analysis] wgl is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:23.576464] [spack.solver.input_analysis] apple-gl is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:24.910138] [spack.solver.input_analysis] apple-libunwind is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:26.165869] [spack.solver.input_analysis] apple-clang is not for this platform
lib/spack/spack/solver/input_analysis.py:94 ==> [2025-08-28-02:07:26.173517] [spack.solver.input_analysis] msvc is not for this platform
lib/spack/spack/solver/asp.py:2313 ==> [2025-08-28-02:07:29.341013] [spack.solver.asp]: not considering intel-oneapi-compilers-classic@=2021.13.1 as external, since it's a non-working compiler
lib/spack/spack/solver/asp.py:2313 ==> [2025-08-28-02:07:29.341401] [spack.solver.asp]: not considering intel-oneapi-compilers-classic@=2021.13.0 as external, since it's a non-working compiler
lib/spack/spack/solver/asp.py:2313 ==> [2025-08-28-02:07:29.341762] [spack.solver.asp]: not considering intel-oneapi-compilers-classic@=2021.11.1 as external, since it's a non-working compiler
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:29.425482] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package acfl
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:29.499507] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package aocc
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:30.036021] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package cce
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:30.163977] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package compiler-wrapper
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:30.727787] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package fj
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:30.974241] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package gcc
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:31.359556] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package glibc
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:32.376099] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package intel-oneapi-compilers
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:32.390365] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package intel-oneapi-compilers-classic
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:32.439358] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package intel-oneapi-runtime
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:34.517293] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package llvm
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:34.552188] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package llvm-amdgpu
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:35.165367] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package musl
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:35.479983] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package nag
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:35.902033] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package nvhpc
lib/spack/spack/solver/requirements.py:230 ==> [2025-08-28-02:07:39.997463] [spack.solver.requirements] Rejecting '%[email protected]' for compiler package xl
lib/spack/spack/main.py:1097 ==> [2025-08-28-02:08:03.227681] UnsatisfiableSpecError: failed to concretize `[email protected]=2025.06.001` for the following reasons:
     1. cannot satisfy a requirement for package 'cmake'.
lib/spack/spack/error.py:58 ==> [2025-08-28-02:08:03.543721] Error: failed to concretize `[email protected]=2025.06.001` for the following reasons:
     1. cannot satisfy a requirement for package 'cmake'.
Traceback (most recent call last):
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/main.py", line 1090, in main
    return _main(argv)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/main.py", line 1042, in _main
    return finish_parse_and_run(parser, cmd_name, args, env_format_error)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/main.py", line 1073, in finish_parse_and_run
    return _invoke_command(command, parser, args, unknown)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/main.py", line 591, in _invoke_command
    return_val = command(parser, args)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/cmd/concretize.py", line 44, in concretize
    concretized_specs = env.concretize(tests=tests)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/environment/environment.py", line 1470, in concretize
    return self._concretize_together(tests=tests)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/environment/environment.py", line 1576, in _concretize_together
    specs_to_concretize, tests=tests
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/concretize.py", line 54, in concretize_together
    concrete_specs = _concretize_specs_together(to_concretize, tests=tests)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/concretize.py", line 37, in _concretize_specs_together
    result = Solver().solve(abstract_specs, tests=tests, allow_deprecated=allow_deprecated)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/solver/asp.py", line 4899, in solve
    result, _, _ = self.solve_with_stats(specs, **kwargs)
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/solver/asp.py", line 4890, in solve_with_stats
    setup, specs, reuse=reusable_specs, output=output, allow_deprecated=allow_deprecated
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/solver/asp.py", line 1249, in solve
    error_handler.raise_if_errors()
  File "/[...]/test-spack-v1.0-2/spack/lib/spack/spack/solver/asp.py", line 1101, in raise_if_errors
    raise UnsatisfiableSpecError(msg)
spack.solver.asp.UnsatisfiableSpecError: failed to concretize `[email protected]=2025.06.001` for the following reasons:
     1. cannot satisfy a requirement for package 'cmake'.

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

bugSomething isn't workingtriageThe issue needs to be prioritized

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions