Skip to content

libllvm dependency can break concretization in mixed compiler cases #51995

Closed

Description

@rbberger

Steps to reproduce

This was observed with an environment with a paraview dependency, which pulls in mesa and therefore depends on libllvm. The global preference was gcc, however, the root spec itself needed to be llvm.

The existence of the libllvm dependency and a llvm compiler dependency can cause llvm_amdgpu to get pulled in.

Similar behavior was observed with intel-oneapi-compilers instead of llvm.

@alalazo FYI

Steps to reproduce

1. Create two simple Spack packages

$ SPACK_PACKAGES_DIR=$(dirname $(spack location -p zlib))
$ mkdir -p $SPACK_PACKAGES_DIR/{foo,bar}

$ cat > $SPACK_PACKAGES_DIR/foo/package.py <<EOF
from spack_repo.builtin.build_systems.generic import Package
from spack.package import *

class Foo(Package):
    version("1.2.4")

    depends_on("cxx", type="build")
    depends_on("bar")
EOF

$ cat > $SPACK_PACKAGES_DIR/bar/package.py <<EOF
from spack_repo.builtin.build_systems.generic import Package
from spack.package import *

class Bar(Package):
    version("1.2.4")

    depends_on("cxx", type="build")
    depends_on("libllvm")
EOF

2. Create test environment (and adjust your compiler externals)

$ mkdir testenv
$ cat > testenv/spack.yaml <<EOF
spack:
  specs:
  - foo
  - bar
  view: true
  packages:
    c:
      prefer: [gcc]
    cxx:
      prefer: [gcc]
    fortran:
      prefer: [gcc]
    llvm:
      externals:
      - spec: [email protected]+clang+flang+lld+lldb
        prefix: /vast/projects/darwin_contrib/spack-builds/2025-07-21/rhel8/x86_64/llvm/20.1.8-gcc_13.2.0
        extra_attributes:
          compilers:
            c: /vast/projects/darwin_contrib/spack-builds/2025-07-21/rhel8/x86_64/llvm/20.1.8-gcc_13.2.0/bin/clang
            cxx: /vast/projects/darwin_contrib/spack-builds/2025-07-21/rhel8/x86_64/llvm/20.1.8-gcc_13.2.0/bin/clang++
            fortran: /vast/projects/darwin_contrib/spack-builds/2025-07-21/rhel8/x86_64/llvm/20.1.8-gcc_13.2.0/bin/flang
    gcc:
      externals:
      - spec: [email protected] languages:='c,c++,fortran'
        prefix: /projects/opt/rhel8/x86_64/gcc/13.2.0
        extra_attributes:
          compilers:
            c: /projects/opt/rhel8/x86_64/gcc/13.2.0/bin/gcc
            cxx: /projects/opt/rhel8/x86_64/gcc/13.2.0/bin/g++
            fortran: /projects/opt/rhel8/x86_64/gcc/13.2.0/bin/gfortran
  concretizer:
    unify: true
EOF

3. Activate and concretize the environment without compiler specifications in root specs

$ spack env activate -d testenv
$ spack concretize -f --fresh
==> Concretized 2 specs:
 -   boundu2  [email protected] build_system=generic platform=linux os=rhel8 target=haswell %[email protected]
 -   oopme4j      ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
[e]  l4jtwmf      ^[email protected]+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rhel8 target=x86_64
 -   ggitppj      ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
[e]  wklw66w      ^[email protected] build_system=autotools platform=linux os=rhel8 target=x86_64
[e]  xnkbabu      ^[email protected]+clang~cuda+flang~gold+libomptarget~libomptarget_debug~link_llvm_dylib+lld+lldb+llvm_dylib+lua~mlir+offload+polly~python~split_dwarf~utils~z3~zstd build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime shlib_symbol_version=none targets:=aarch64,amdgpu,nvptx,x86 version_suffix=none platform=linux os=rhel8 target=x86_64
 -   jtpr34r  [email protected] build_system=generic platform=linux os=rhel8 target=haswell %[email protected]

Notice that there is a single llvm node.

4. Add compiler constraints

Edit via spack config edit to:

specs:
 - foo %llvm
 - bar %cxx=gcc

Reconcretize and notice how llvm_amdgpu gets pulled in:

$ spack concretize -f --fresh
==> Concretized 2 specs:
 -   vi55htr  [email protected] build_system=generic platform=linux os=rhel8 target=haswell %[email protected]
 -   oopme4j      ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
[e]  l4jtwmf      ^[email protected]+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rhel8 target=x86_64
 -   ggitppj      ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
[e]  wklw66w      ^[email protected] build_system=autotools platform=linux os=rhel8 target=x86_64
 -   rjnv2qh      ^[email protected]~ipo~link_llvm_dylib~llvm_dylib+rocm-device-libs build_system=cmake build_type=Release generator=ninja patches:=74471ee,c831a57 platform=linux os=rhel8 target=haswell %c,cxx,[email protected]
 -   m5bokcv          ^[email protected]~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release platform=linux os=rhel8 target=haswell %c,[email protected]
 -   w6xn5ny              ^[email protected]~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl platform=linux os=rhel8 target=haswell %c,[email protected]
 -   64smp4n                  ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %c,[email protected]
 -   ykpplgs              ^[email protected]~guile build_system=generic platform=linux os=rhel8 target=haswell %[email protected]
 -   bjkdcqs          ^[email protected]~docs~strip build_system=meson buildtype=release default_library:=shared platform=linux os=rhel8 target=haswell %[email protected]
 -   ciwybln              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   bw4jhg7                  ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell
 -   cjh7ox2              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   b7a3gh2              ^[email protected] build_system=python_pip patches:=0f0b1bd platform=linux os=rhel8 target=haswell
 -   6s4brrs                  ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
 -   sivwlg3                  ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
 -   qwq52pp                  ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
 -   zjr242l                  ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
 -   eaelaah          ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   vdpxv5o          ^[email protected]+pic~python+shared build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   3pt3b5w              ^[email protected] build_system=autotools libs:=shared,static platform=linux os=rhel8 target=haswell %[email protected]
 -   yfljkmu              ^[email protected]~pic build_system=autotools libs:=shared,static platform=linux os=rhel8 target=haswell %[email protected]
 -   nvkndru          ^[email protected]~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=rhel8 target=haswell %c,[email protected]
 -   ywk5bgj          ^[email protected]+re2c build_system=generic platform=linux os=rhel8 target=haswell %c,[email protected]
 -   7hvbfsn              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %c,[email protected]
 -   qhgydub          ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   zew3424              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell
 -   3gvb2sh                  ^[email protected]+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=rhel8 target=haswell %[email protected]
 -   jay2kua                      ^[email protected]+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=rhel8 target=haswell %c,[email protected]
 -   knylcy6              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   ae64ce5              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   iqg5vrx                  ^[email protected] build_system=autotools patches:=440b954 platform=linux os=rhel8 target=haswell %[email protected]
 -   rttmnrb              ^[email protected]+sigsegv build_system=autotools platform=linux os=rhel8 target=haswell %c,[email protected]
 -   puccuji                  ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   d2gim4k                  ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   qg5kbb5          ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   khjph57          ^[email protected]+bz2+ctypes+dbm~debug~freethreading+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~static~tests~tkinter+uuid+zlib+zstd build_system=generic platform=linux os=rhel8 target=haswell %c,[email protected]
 -   4mczhaf              ^[email protected]~debug~pic+shared build_system=generic platform=linux os=rhel8 target=haswell %[email protected]
 -   sesai33              ^[email protected]+libbsd build_system=autotools platform=linux os=rhel8 target=haswell %c,[email protected]
 -   n6txqta                  ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   xqlqxbu                      ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   dwpgiot              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   wiqn43m              ^[email protected]+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=rhel8 target=haswell %c,[email protected]
 -   tmw3kv5                  ^[email protected] build_system=autotools zip=pigz platform=linux os=rhel8 target=haswell %[email protected]
 -   e3jx2nv                      ^[email protected] build_system=makefile platform=linux os=rhel8 target=haswell %[email protected]
 -   7waaqi2              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %c,[email protected]
 -   bz27ud4              ^[email protected]~docs+shared build_system=generic certs=mozilla platform=linux os=rhel8 target=haswell %c,[email protected]
 -   4bfptrw                  ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=rhel8 target=haswell
 -   gyuwmh5              ^[email protected] build_system=autotools patches:=21f0a03 platform=linux os=rhel8 target=haswell %[email protected]
 -   xuoknav              ^[email protected]+column_metadata+fts+rtree build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   gxm5edn              ^[email protected] build_system=autotools platform=linux os=rhel8 target=haswell %[email protected]
 -   43mntnv              ^[email protected]+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=rhel8 target=haswell %c,[email protected]
 -   uude4cj          ^[email protected] build_system=makefile platform=linux os=rhel8 target=haswell %c,[email protected]
 -   mn7t5xs          ^[email protected]~gmp~ipo~python build_system=cmake build_type=Release generator=make platform=linux os=rhel8 target=haswell %c,[email protected]
 -   uxmdlkt          ^[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=rhel8 target=haswell %c,[email protected]
 -   abehrmq  [email protected] build_system=generic platform=linux os=rhel8 target=haswell %[email protected]
[e]  xnkbabu      ^[email protected]+clang~cuda+flang~gold+libomptarget~libomptarget_debug~link_llvm_dylib+lld+lldb+llvm_dylib+lua~mlir+offload+polly~python~split_dwarf~utils~z3~zstd build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime shlib_symbol_version=none targets:=aarch64,amdgpu,nvptx,x86 version_suffix=none platform=linux os=rhel8 target=x86_64

Changing the root spec for bar to bar %cxx=gcc %libllvm=llvm then causes this error:

$ spack concretize -f --fresh
==> Error: failed to concretize `foo %clang`, `bar %cxx=gcc %libllvm=clang` for the following reasons:
     1. Cannot have multiple nodes for llvm in the same unification set ("build",1). You could consider setting `concretizer:unify` to `when_possible` or `false` to allow multiple versions of some packages.

Changing to unify: when_possible does help:

$ spack concretize -f --fresh
==> Concretized 2 specs:
 -   boundu2  [email protected] build_system=generic platform=linux os=rhel8 target=haswell %[email protected]
 -   oopme4j      ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
[e]  l4jtwmf      ^[email protected]+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rhel8 target=x86_64
 -   ggitppj      ^[email protected] build_system=generic platform=linux os=rhel8 target=haswell
[e]  wklw66w      ^[email protected] build_system=autotools platform=linux os=rhel8 target=x86_64
[e]  xnkbabu      ^[email protected]+clang~cuda+flang~gold+libomptarget~libomptarget_debug~link_llvm_dylib+lld+lldb+llvm_dylib+lua~mlir+offload+polly~python~split_dwarf~utils~z3~zstd build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime shlib_symbol_version=none targets:=aarch64,amdgpu,nvptx,x86 version_suffix=none platform=linux os=rhel8 target=x86_64
 -   ipooeyv  [email protected] build_system=generic platform=linux os=rhel8 target=haswell %[email protected]

Error message

$ spack --debug --stacktrace concretize -f --fresh
lib/spack/spack/cmd/__init__.py:126 ==> [2026-02-23-16:13:17.788296] Imported concretize from built-in commands
lib/spack/spack/cmd/__init__.py:126 ==> [2026-02-23-16:13:17.789226] Imported concretize from built-in commands
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:17.811177] Reading config from file /vast/home/rberger/projects/devops/bugs/concretizer_bug/testenv/spack.yaml
lib/spack/spack/environment/environment.py:263 ==> [2026-02-23-16:13:17.822806] Deactivated environment '/vast/home/rberger/projects/devops/bugs/concretizer_bug/testenv'
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:17.828562] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/repos.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:17.831917] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/repos.yaml
lib/spack/spack/environment/environment.py:236 ==> [2026-02-23-16:13:17.837123] Using environment '/vast/home/rberger/projects/devops/bugs/concretizer_bug/testenv'
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:17.838169] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/concretizer.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:17.862183] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:17.913403] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/packages.yaml
lib/spack/spack/database.py:611 ==> [2026-02-23-16:13:18.430563] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:179 ==> [2026-02-23-16:13:18.430842] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:18.445654] [spack.solver.input_analysis] apple-clang is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:18.452785] [spack.solver.input_analysis] msvc is not for this platform
lib/spack/spack/database.py:611 ==> [2026-02-23-16:13:18.463758] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:179 ==> [2026-02-23-16:13:18.464057] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.573407] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/environment/environment.py:263 ==> [2026-02-23-16:13:18.582864] Deactivated environment '/vast/home/rberger/projects/devops/bugs/concretizer_bug/testenv'
lib/spack/spack/bootstrap/config.py:126 ==> [2026-02-23-16:13:18.583469] [BOOTSTRAP CONFIG SCOPE] name=_builtin
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.584795] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/config.py:135 ==> [2026-02-23-16:13:18.592846] [BOOTSTRAP CONFIG SCOPE] name=defaults, path=/vast/home/rberger/projects/devops/spack/etc/spack/defaults
lib/spack/spack/bootstrap/config.py:135 ==> [2026-02-23-16:13:18.593113] [BOOTSTRAP CONFIG SCOPE] name=bootstrap, path=/vast/home/rberger/projects/devops/.spack/bootstrap/config
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.593791] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/include.yaml
lib/spack/spack/config.py:1098 ==> [2026-02-23-16:13:18.597117] Creating DirectoryConfigScope defaults:linux for '/vast/home/rberger/projects/devops/spack/etc/spack/defaults/linux'
lib/spack/spack/config.py:1098 ==> [2026-02-23-16:13:18.597634] Creating DirectoryConfigScope defaults:base for '/vast/home/rberger/projects/devops/spack/etc/spack/defaults/base'
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.599521] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/config.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.626617] Reading config from file /vast/home/rberger/projects/devops/.spack/bootstrap/config/config.yaml
lib/spack/spack/database.py:611 ==> [2026-02-23-16:13:18.641006] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:179 ==> [2026-02-23-16:13:18.641316] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/bootstrap/_common.py:239 ==> [2026-02-23-16:13:18.675928] [BOOTSTRAP ROOT SPEC] clingo-bootstrap@spack+python platform=linux target=x86_64
lib/spack/spack/bootstrap/core.py:358 ==> [2026-02-23-16:13:18.676199] [BOOTSTRAP MODULE clingo] Try importing from Python
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.677161] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/_common.py:97 ==> [2026-02-23-16:13:18.729448] [BOOTSTRAP MODULE clingo] The installed spec "clingo-bootstrap@spack+python platform=linux target=x86_64 ^[email protected]/rmz6nolo5afkeakgyc2eoc7n2ojhvf4v" provides the "clingo" Python module
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.731044] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/config.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.758520] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/repos.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.762167] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/repos.yaml
lib/spack/spack/environment/environment.py:236 ==> [2026-02-23-16:13:18.767632] Using environment '/vast/home/rberger/projects/devops/bugs/concretizer_bug/testenv'
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.786129] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:18.838640] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/packages.yaml
lib/spack/spack/config.py:1687 ==> [2026-02-23-16:13:19.048889] Reading config from file /vast/home/rberger/projects/devops/spack/etc/spack/defaults/base/concretizer.yaml
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.261524] [spack.solver.input_analysis] apple-libuuid is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.305047] [spack.solver.input_analysis] wgl is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.306657] [spack.solver.input_analysis] apple-gl is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.317575] [spack.solver.input_analysis] apple-libunwind is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.536363] [spack.solver.input_analysis] msmpi is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.669295] [spack.solver.input_analysis] veclibfort is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.677301] [spack.solver.input_analysis] nvpl-blas is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:19.690385] [spack.solver.input_analysis] nvpl-lapack is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:20.090621] [spack.solver.input_analysis] apple-clang is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2026-02-23-16:13:20.092331] [spack.solver.input_analysis] msvc is not for this platform
lib/spack/spack/solver/asp.py:1147 ==> [2026-02-23-16:13:25.003452] Starting concretizer
lib/spack/spack/main.py:1133 ==> [2026-02-23-16:13:33.892681] UnsatisfiableSpecError: failed to concretize `foo %clang`, `bar %cxx=gcc %libllvm=clang` for the following reasons:
     1. Cannot have multiple nodes for llvm in the same unification set ("build",1). You could consider setting `concretizer:unify` to `when_possible` or `false` to allow multiple versions of some packages.
lib/spack/spack/error.py:58 ==> [2026-02-23-16:13:33.893735] Error: failed to concretize `foo %clang`, `bar %cxx=gcc %libllvm=clang` for the following reasons:
     1. Cannot have multiple nodes for llvm in the same unification set ("build",1). You could consider setting `concretizer:unify` to `when_possible` or `false` to allow multiple versions of some packages.
Traceback (most recent call last):
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/main.py", line 1126, in main
    return _main(argv)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/main.py", line 1076, in _main
    return finish_parse_and_run(parser, cmd_name, args, env_format_error)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/main.py", line 1107, in finish_parse_and_run
    return _invoke_command(command, parser, args, unknown)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/main.py", line 650, in _invoke_command
    return_val = command(parser, args)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/cmd/concretize.py", line 44, in concretize
    concretized_specs = env.concretize(tests=tests)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/environment/environment.py", line 1562, in concretize
    return EnvironmentConcretizer(self).concretize(force=force, tests=tests)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/environment/environment.py", line 2396, in concretize
    return self._concretize_together(new_user_specs, kept_user_specs, tests=tests)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/environment/environment.py", line 2453, in _concretize_together
    concrete_pairs = spack.concretize.concretize_together(to_concretize, tests=tests)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/concretize.py", line 54, in concretize_together
    concrete_specs = _concretize_specs_together(to_concretize, tests=tests)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/concretize.py", line 37, in _concretize_specs_together
    result = Solver().solve(abstract_specs, tests=tests, allow_deprecated=allow_deprecated)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/solver/asp.py", line 3997, in solve
    result, _, _ = self.solve_with_stats(specs, **kwargs)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/solver/asp.py", line 3986, in solve_with_stats
    allow_deprecated=allow_deprecated,
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/solver/asp.py", line 1152, in solve
    result = self._run_clingo(specs, setup, problem_repr, control_file_paths, timer)
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/solver/asp.py", line 1029, in _run_clingo
    error_handler.raise_if_errors()
  File "/vast/home/rberger/projects/devops/spack/lib/spack/spack/solver/asp.py", line 913, in raise_if_errors
    raise UnsatisfiableSpecError(msg)
spack.solver.asp.UnsatisfiableSpecError: failed to concretize `foo %clang`, `bar %cxx=gcc %libllvm=clang` for the following reasons:
     1. Cannot have multiple nodes for llvm in the same unification set ("build",1). You could consider setting `concretizer:unify` to `when_possible` or `false` to allow multiple versions of some packages.

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

Activity

  1. added
    bugSomething isn't working
    triageThe issue needs to be prioritized
    on Feb 23, 2026
  2. rbberger commented on Feb 23, 2026

    @rbberger
    MemberAuthor

    Bisecting shows that ac68ada is what breaks this case. @haampie FYI

  3. alalazo commented on Feb 24, 2026

    @alalazo
    Member

    Hmm, I'll have a look. Very likely we have some wrong rule around virtuals in that case.

  4. alalazo commented on Feb 24, 2026

    @alalazo
    Member

    @rbberger By the way, I really appreciate your minimal reproducers in the issues! Thanks!

  5. added and removed
    triageThe issue needs to be prioritized
    on Feb 24, 2026
  6. added theissue type on Feb 24, 2026
  7. moved this from Todo to In Progress in Triaged bugson Feb 24, 2026
  8. alalazo commented on Feb 24, 2026

    @alalazo
    Member

    Reproduced

  9. alalazo commented on Feb 24, 2026

    @alalazo
    Member

    There is clearly one error:

    attr("hash",node(0,"llvm"),"mvw5fyjjjbg5ttcmiwe3nn3a5kseixgp")
    attr("hash",node(1,"llvm"),"mvw5fyjjjbg5ttcmiwe3nn3a5kseixgp")
    

    In the buggy case we select the same spec for two llvm nodes.

  10. alalazo commented on Feb 24, 2026

    @alalazo
    Member

    So, not sure what I can make of it, but I reduced our set of ASP rules to:

    problem.lp.txt

    Now I have understand what makes the problem unsat with max_dupes(llvm, 1).

  11. self-assigned this
    on Feb 24, 2026
  12. added 2 commits that reference this issue on Mar 2, 2026
    d63aaf4
    fa4722f
  13. added a commit that references this issue on Mar 3, 2026
    bf1345e
  14. moved this from In Progress to Done in Triaged bugson Mar 3, 2026
  15. added a commit that references this issue on Jun 24, 2026
    0a2c2f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions