spack: Spack depfile does not check if installed packages have changed leaving stale "markerfiles"

Steps to reproduce

spack env activate .
spack env depfile -o Makefile
make -j $(nproc)
spack config edit # change a dependency
spack env deactivate
spack uninstall --all --dependents $foo # you might have to do this to get the concretizer to resolve or you did this accidently
spack env activate .
spack concretize -f
spack env depfile -o Makefile
make -j $(nproc)

Error message

uninstalled dependency for $foo

because the generated make file does not introduce dependencies for all packages in the envionment on the spack.yaml, the spack.lock file, or some internal spack database file to force a recheck, means that make doesn’t work as expected if a dependency was uninstalled and make clean needs to be called before make will function as expected. In contrast, spack install works just fine.

Information on your system

  • Spack: 0.22.0.dev0 (83945f9c550722a4256c5e6ed66ad603a462f40c)
  • Python: 3.12.3
  • Platform: linux-fedora40-icelake
  • 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

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

Ok, I understand if this is a closed won’t fix, but could we at least improve the error message so that the user should probably run make clean? spack install will also run without errors, but this leaves a sharp edge for users.

That’s just how it works. Run make clean.