Skip to content

Specifying un-needed dependency turns on default-False variant #51019

@hagertnl

Description

@hagertnl

Steps to reproduce

When we turn on +rocm for GPU-enabled packages, we historically have also specified the core components of ROCm as dependencies directly on the spec, ie:

Now, we are using spack develop branch (commit e464165) to test the rocprofiler-systems new Spackage, and we found that the +tau variant was getting turned on for some reason, even though it defaults to False and we didn't turn it on. After a lot of tracing, we found that rocprofiler-systems only depends on hip, so when we specify either ^hsa-rocr-dev or ^llvm-amdgpu, Spack turns on +tau, and Tau concretizes and uses hsa-rocr-dev and/or llvm-amdgpu. It seems that Spack changed variants in order to use all parts of the explicit spec.

Environment's spack.yaml is provided below. Uncomment the ^hsa-rocr-dev to reproduce. You also have to edit the rocprofiler-systems spackage with the following:

diff --git a/repos/spack_repo/builtin/packages/rocprofiler_systems/package.py b/repos/spack_repo/builtin/packages/rocprofiler_systems/package.py
index 1a9b5374ff..dad2b57e4b 100644
--- a/repos/spack_repo/builtin/packages/rocprofiler_systems/package.py
+++ b/repos/spack_repo/builtin/packages/rocprofiler_systems/package.py
@@ -115,7 +115,8 @@ class RocprofilerSystems(CMakePackage):

     # hard dependencies
     depends_on("[email protected]:", type="build")
-    depends_on("dyninst@:12")
+    #depends_on("dyninst@:12")
+    depends_on("dyninst")
     depends_on("m4")
     depends_on("texinfo")
     depends_on("libunwind", type=("build", "run"))

spack-rocprofiler-tau-bug.yaml.txt

Error message

Incorrect concretization, +tau is turned on, even though default is False (if we add ^[email protected] to root spec):

==> Concretized 1 spec:
 -   2sp3d6k  [email protected]~caliper~ipo+mpi+mpi_headers+ompt+papi~perfetto_tools+python+rocm~strip+tau build_system=cmake build_type=Release commit=2e945e4a08781e13a822f568814e2c434fd8858f generator=make arch=linux-sles15-zen3 %c,cxx,[email protected]
 -   gz7bqrz      ^[email protected] build_system=autotools arch=linux-sles15-zen3
 -   5pc76uw          ^[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=linux-sles15-zen3 %[email protected]
 -   d5rhy4q              ^[email protected]+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc arch=linux-sles15-zen3 %c,[email protected]
 -   hlwmwxi              ^[email protected]~debug~pic+shared build_system=generic arch=linux-sles15-zen3 %[email protected]
 -   geio37r              ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   4dwudvo                  ^[email protected] build_system=autotools patches:=1ea4349,24f587b,3d9885e,5911a5b,622ba38,6c8adf8,758e2ec,79572ee,a177edc,bbf97f1,c7b45ff,e0013d9,e065038 arch=linux-sles15-zen3 %[email protected]
 -   baetttc      ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   rqi3vdp      ^[email protected]~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release arch=linux-sles15-zen3 %c,[email protected]
 -   7a5uigz          ^[email protected]~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl arch=linux-sles15-zen3 %c,[email protected]
 -   hhxj5il              ^[email protected] build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   xah2mr3              ^[email protected]~docs+shared build_system=generic certs=mozilla arch=linux-sles15-zen3 %c,[email protected]
 -   ajp3zcw                  ^ca-certificates-mozilla@2025-05-20 build_system=generic arch=linux-sles15-zen3
 -   6b76ica              ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   7qlw5zh          ^[email protected]~symlinks+termlib abi=none build_system=autotools patches:=7a351bc arch=linux-sles15-zen3 %c,[email protected]
 -   4xoljzn          ^[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   6mqj3ia      ^[email protected] build_system=generic arch=linux-sles15-zen3
[e]  5txpqaw      ^[email protected]~cuda~rocm+wrappers build_system=generic arch=linux-sles15-zen3
 -   6zr2c2t      ^[email protected]~ipo+openmp~stat_dysect~static build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3 %c,[email protected]
 -   vyf6cij          ^[email protected]+atomic~charconv+chrono~clanglibcpp~cobalt+container~context~contract~coroutine+date_time~debug+exception~fiber+filesystem~graph~graph_parallel~icu~iostreams~json~locale~log~math~mpi~mqtt5+multithreaded~nowide~numpy~pic~program_options~python+random~regex~serialization+shared~signals2~singlethreaded~stacktrace+system~taggedlayout~test+thread+timer~type_erasure~url~versionedlayout~wave build_system=generic cxxstd=11 patches:=a440f96 visibility=hidden arch=linux-sles15-zen3 %c,[email protected]
 -   whd4yz2          ^[email protected]~debuginfod+exeprefix+nls build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   k477yrs              ^[email protected] build_system=autotools libs:=shared,static arch=linux-sles15-zen3 %[email protected]
 -   2pj7wvj              ^[email protected]~pic build_system=autotools libs:=shared,static arch=linux-sles15-zen3 %[email protected]
 -   wkufnnr              ^[email protected]+programs build_system=makefile compression:=none libs:=shared,static arch=linux-sles15-zen3 %c,[email protected]
 -   avj6je5          ^[email protected]~ipo+shared+tm build_system=cmake build_type=Release cxxstd=default generator=make arch=linux-sles15-zen3 %c,[email protected]
 -   rnnibme          ^[email protected]+pic build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
[e]  k7rk2oa      ^[email protected]~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' arch=linux-sles15-zen3
 -   6zmv3s6      ^[email protected] build_system=generic arch=linux-sles15-zen3
[e]  6hqoygt      ^[email protected] build_system=autotools arch=linux-sles15-zen3
 -   kj2clk7      ^[email protected]~guile build_system=generic arch=linux-sles15-zen3 %[email protected]
[e]  dn2oioe      ^[email protected]~asan~cuda+rocm build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3
 -   l4wxtzf      ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   672cjn6          ^[email protected] build_system=autotools patches:=440b954 arch=linux-sles15-zen3 %[email protected]
 -   ishtczr      ^[email protected]~block_signals~conservative_checks~cxx_exceptions~debug~debug_frame+docs~pic+tests+weak_backtrace~xz~zlib build_system=autotools components:=none libs:=shared,static arch=linux-sles15-zen3 %c,[email protected]
 -   5ha7co5      ^[email protected]+sigsegv build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   l25thiv          ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   v2a3htm          ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   3oiiqzu      ^[email protected]~cuda~debug+example~infiniband~lmsensors~nvml~powercap~rapl+rdpmc~rocm~rocm_smi~sde+shared~static_tools build_system=autotools patches:=48cb202 arch=linux-sles15-zen3 %c,cxx,[email protected]
[e]  hkpwrez      ^[email protected]+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches:=0d98e93,7d40923,ebdca64,f2fd060 arch=linux-sles15-zen3
 -   6oqwqdb      ^[email protected] build_system=generic arch=linux-sles15-zen3
[e]  cionnsz      ^[email protected]~asan+shared build_system=cmake build_type=Release generator=make patches:=62be726,9537cd7 arch=linux-sles15-zen3
[e]  dbkk6fc      ^[email protected] build_system=cmake build_type=Release generator=make patches:=9f49746 arch=linux-sles15-zen3
[e]  hvmzkwm      ^[email protected] build_system=cmake build_type=Release commit=e8e49fe76971000a42a5a177d9a727d16dd0ebcf generator=make arch=linux-sles15-zen3
[e]  rbcbcka      ^[email protected]~asan~rocm build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3
 -   smfr3sy      ^[email protected]~adios2+binutils~comm~craycnl~cuda~disable-no-pie~dyninst+elf+fortran~gasnet+io~level_zero+libdwarf+libunwind~mpi~ompt~opari~openacc~opencl~openmp+otf2+papi+pdt~phase~ppc64le~profileparam+pthreads~python+rocm+rocprofiler~rocprofiler-sdk~rocprofv2~roctracer~salt~scorep~shmem~sqlite~syscall~x86_64 build_system=generic arch=linux-sles15-zen3 %c,cxx,[email protected]
 -   famkxol          ^[email protected]~debuginfod~gas~gprofng+headers~interwork~ld+libiberty~lto~nls~pgo+plugins build_system=autotools compress_debug_sections=zlib libs:=shared,static arch=linux-sles15-zen3 %c,[email protected]
[e]  us244j4          ^[email protected]~asan+image+shared build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3
 -   chm7itn          ^[email protected]~cairo~cuda~gl~level_zero~libudev+libxml2~nvml~opencl+pci~rocm build_system=autotools libs:=shared,static arch=linux-sles15-zen3 %c,[email protected]
 -   rykf7ba              ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   377dwve                  ^[email protected] build_system=autotools arch=linux-sles15-zen3
 -   6atdrgp              ^[email protected]~http+pic~python+shared build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   jd5k3oa          ^[email protected]+decompression+dwarfdump~dwarfgen~examples~ipo+pic+shared build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3 %c,[email protected]
 -   2a3wkuy          ^[email protected]_9 build_system=generic certs=none arch=linux-sles15-zen3
 -   3lo5blc          ^[email protected] build_system=autotools patches:=7e56d93 arch=linux-sles15-zen3 %c,cxx,[email protected]
 -   tise6a4          ^[email protected]~pic build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
[e]  5haj2ih          ^[email protected]~asan build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3
 -   qyhecsn      ^[email protected] build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   u54ggcl          ^[email protected]+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   x26jali              ^[email protected] build_system=autotools zip=pigz arch=linux-sles15-zen3 %[email protected]
 -   rsmihow                  ^[email protected] build_system=makefile arch=linux-sles15-zen3 %[email protected]

Expected:

==> Concretized 1 spec:
 -   qpgcy6y  [email protected]~caliper~ipo+mpi+mpi_headers+ompt+papi~perfetto_tools+python+rocm~strip~tau build_system=cmake build_type=Release commit=2e945e4a08781e13a822f568814e2c434fd8858f generator=make arch=linux-sles15-zen3 %c,cxx,[email protected]
 -   gz7bqrz      ^[email protected] build_system=autotools arch=linux-sles15-zen3
 -   5pc76uw          ^[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=linux-sles15-zen3 %[email protected]
 -   d5rhy4q              ^[email protected]+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc arch=linux-sles15-zen3 %c,[email protected]
 -   hlwmwxi              ^[email protected]~debug~pic+shared build_system=generic arch=linux-sles15-zen3 %[email protected]
 -   geio37r              ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   4dwudvo                  ^[email protected] build_system=autotools patches:=1ea4349,24f587b,3d9885e,5911a5b,622ba38,6c8adf8,758e2ec,79572ee,a177edc,bbf97f1,c7b45ff,e0013d9,e065038 arch=linux-sles15-zen3 %[email protected]
 -   baetttc      ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   rqi3vdp      ^[email protected]~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release arch=linux-sles15-zen3 %c,[email protected]
 -   7a5uigz          ^[email protected]~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl arch=linux-sles15-zen3 %c,[email protected]
 -   hhxj5il              ^[email protected] build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   xah2mr3              ^[email protected]~docs+shared build_system=generic certs=mozilla arch=linux-sles15-zen3 %c,[email protected]
 -   ajp3zcw                  ^ca-certificates-mozilla@2025-05-20 build_system=generic arch=linux-sles15-zen3
 -   6b76ica              ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   7qlw5zh          ^[email protected]~symlinks+termlib abi=none build_system=autotools patches:=7a351bc arch=linux-sles15-zen3 %c,[email protected]
 -   4xoljzn          ^[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   6mqj3ia      ^[email protected] build_system=generic arch=linux-sles15-zen3
[e]  5txpqaw      ^[email protected]~cuda~rocm+wrappers build_system=generic arch=linux-sles15-zen3
 -   6zr2c2t      ^[email protected]~ipo+openmp~stat_dysect~static build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3 %c,[email protected]
 -   vyf6cij          ^[email protected]+atomic~charconv+chrono~clanglibcpp~cobalt+container~context~contract~coroutine+date_time~debug+exception~fiber+filesystem~graph~graph_parallel~icu~iostreams~json~locale~log~math~mpi~mqtt5+multithreaded~nowide~numpy~pic~program_options~python+random~regex~serialization+shared~signals2~singlethreaded~stacktrace+system~taggedlayout~test+thread+timer~type_erasure~url~versionedlayout~wave build_system=generic cxxstd=11 patches:=a440f96 visibility=hidden arch=linux-sles15-zen3 %c,[email protected]
 -   whd4yz2          ^[email protected]~debuginfod+exeprefix+nls build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   k477yrs              ^[email protected] build_system=autotools libs:=shared,static arch=linux-sles15-zen3 %[email protected]
 -   2pj7wvj              ^[email protected]~pic build_system=autotools libs:=shared,static arch=linux-sles15-zen3 %[email protected]
 -   wkufnnr              ^[email protected]+programs build_system=makefile compression:=none libs:=shared,static arch=linux-sles15-zen3 %c,[email protected]
 -   avj6je5          ^[email protected]~ipo+shared+tm build_system=cmake build_type=Release cxxstd=default generator=make arch=linux-sles15-zen3 %c,[email protected]
 -   chm7itn              ^[email protected]~cairo~cuda~gl~level_zero~libudev+libxml2~nvml~opencl+pci~rocm build_system=autotools libs:=shared,static arch=linux-sles15-zen3 %c,[email protected]
 -   rykf7ba                  ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   377dwve                      ^[email protected] build_system=autotools arch=linux-sles15-zen3
 -   rnnibme          ^[email protected]+pic build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
[e]  k7rk2oa      ^[email protected]~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' arch=linux-sles15-zen3
 -   6zmv3s6      ^[email protected] build_system=generic arch=linux-sles15-zen3
[e]  6hqoygt      ^[email protected] build_system=autotools arch=linux-sles15-zen3
 -   kj2clk7      ^[email protected]~guile build_system=generic arch=linux-sles15-zen3 %[email protected]
[e]  dn2oioe      ^[email protected]~asan~cuda+rocm build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3
 -   l4wxtzf      ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   672cjn6          ^[email protected] build_system=autotools patches:=440b954 arch=linux-sles15-zen3 %[email protected]
 -   ishtczr      ^[email protected]~block_signals~conservative_checks~cxx_exceptions~debug~debug_frame+docs~pic+tests+weak_backtrace~xz~zlib build_system=autotools components:=none libs:=shared,static arch=linux-sles15-zen3 %c,[email protected]
 -   5ha7co5      ^[email protected]+sigsegv build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   l25thiv          ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   v2a3htm          ^[email protected] build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   3oiiqzu      ^[email protected]~cuda~debug+example~infiniband~lmsensors~nvml~powercap~rapl+rdpmc~rocm~rocm_smi~sde+shared~static_tools build_system=autotools patches:=48cb202 arch=linux-sles15-zen3 %c,cxx,[email protected]
[e]  hkpwrez      ^[email protected]+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches:=0d98e93,7d40923,ebdca64,f2fd060 arch=linux-sles15-zen3
 -   6oqwqdb      ^[email protected] build_system=generic arch=linux-sles15-zen3
[e]  cionnsz      ^[email protected]~asan+shared build_system=cmake build_type=Release generator=make patches:=62be726,9537cd7 arch=linux-sles15-zen3
[e]  dbkk6fc      ^[email protected] build_system=cmake build_type=Release generator=make patches:=9f49746 arch=linux-sles15-zen3
[e]  hvmzkwm      ^[email protected] build_system=cmake build_type=Release commit=e8e49fe76971000a42a5a177d9a727d16dd0ebcf generator=make arch=linux-sles15-zen3
[e]  rbcbcka      ^[email protected]~asan~rocm build_system=cmake build_type=Release generator=make arch=linux-sles15-zen3
 -   qyhecsn      ^[email protected] build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   u54ggcl          ^[email protected]+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-sles15-zen3 %c,[email protected]
 -   6atdrgp              ^[email protected]~http+pic~python+shared build_system=autotools arch=linux-sles15-zen3 %[email protected]
 -   x26jali              ^[email protected] build_system=autotools zip=pigz arch=linux-sles15-zen3 %[email protected]
 -   rsmihow                  ^[email protected] build_system=makefile arch=linux-sles15-zen3 %[email protected]

Information on your system

$ spack debug report

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

No one assigned

    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