spack: Cannot uninstall package by hash

I have several versions of a package installed that differ only by their hash:

$ spack find -p cactusext
==> 3 installed packages.
-- linux-redhat7-x86_64 / gcc@6.1.0-spack -----------------------
    cactusext@master  /home/eschnett/src/spack/opt/spack/linux-redhat7-x86_64/gcc-6.1.0-spack/cactusext-master-oi3cpui7hrd5j6wuilp2dmxbkv2tlo3q
    cactusext@master  /home/eschnett/src/spack/opt/spack/linux-redhat7-x86_64/gcc-6.1.0-spack/cactusext-master-iwpmzszzi47ge2s5rikzzmchqo33qg65
    cactusext@master  /home/eschnett/src/spack/opt/spack/linux-redhat7-x86_64/gcc-6.1.0-spack/cactusext-master-ppvk4aqxve274wlhcb2pyzqrlrozps5o

When I try to uninstall by hash, Spack wants to uninstall all of them:

$ spack uninstall cactusext/oi3cpui
==> Error: cactusext matches multiple packages:

-- linux-redhat7-x86_64 / gcc@6.1.0-spack -----------------------
oi3cpui cactusext@master%gcc+funhpc+julia+llvm+simulationio

iwpmzsz cactusext@master%gcc+funhpc+julia+llvm+simulationio

ppvk4aq cactusext@master%gcc+funhpc+julia+llvm+simulationio


==> Error: You can either:
    a) Use a more specific spec, or
    b) use spack uninstall -a to uninstall ALL matching specs.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 27 (27 by maintainers)

Commits related to this issue

Most upvoted comments

thanks @becker33 ! p.s. i edited your comment to correct the link to the issue.

Spack is supposed to cache the old hash of the package once the package is concrete, specifically to avoid this issue. While looking into https://github.com/LLNL/spack/issues/2520 I’ve discovered that this caching is getting blown away at some point in the install process. I’m assuming that a similar problem is occurring with uninstall.

I don’t have an answer to this problem at the moment, all I can say is that I’m working on isolating it.

In this case I also want a --reinstall option to install that first uninstalls and then re-installs a package.