Steps to reproduce
First, blow away ~/.spack, clone a fresh copy of Spack, and check for external packages:
$ git clone https://github.com/spack/spack.git
$ . spack/share/spack/setup-env.sh
$ spack external find --not-buildable
This will register all external packages it finds on the system in packages.yaml. We'll focus on git since it's guaranteed to be found, but this affects all external packages.
Next, install git:
$ spack install git
[+] /usr (external git-2.32.1-lweosdwarje645t4pqta7becf7n5dwbc)
$ spack find -l git
==> 1 installed package
-- darwin-monterey-m1 / apple-clang@13.1.6 ----------------------
lweosdw git@2.32.1
[12:52:36] ajstewart@ajstewart-mbp:~
$ spack spec -Il --reuse git
Input spec
--------------------------------
- git
Concretized
--------------------------------
[+] lweosdw git@2.32.1%apple-clang@13.1.6+man+nls+perl+subtree~svn~tcltk arch=darwin-monterey-m1
Next, modify the git package. For example, add a new variable:
diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py
index 2d9a7a06f1..71d8d3e6c3 100644
--- a/var/spack/repos/builtin/packages/git/package.py
+++ b/var/spack/repos/builtin/packages/git/package.py
@@ -18,6 +18,7 @@ class Git(AutotoolsPackage):
homepage = "http://git-scm.com"
url = "https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.12.0.tar.gz"
maintainers = ['jennfshr']
+ foo = 'bar'
tags = ['build-tools']
Now, Spack will no longer be able to reuse the existing git installation:
$ spack spec -Il --reuse git
Input spec
--------------------------------
- git
Concretized
--------------------------------
- 634kih5 git@2.32.1%apple-clang@13.1.6+man+nls+perl+subtree~svn~tcltk arch=darwin-monterey-m1
$ spack install --reuse git
[+] /usr (external git-2.32.1-634kih5iv3oxsqem6mrsz75t3zkdwxml)
This introduces a lot of inconsistencies in the database. spack find claims to only find a single installation, but spack uninstall begs to differ:
$ spack find -l git
==> 1 installed package
-- darwin-monterey-m1 / apple-clang@13.1.6 ----------------------
lweosdw git@2.32.1
$ spack uninstall git
==> Error: git matches multiple packages:
-- darwin-monterey-m1 / apple-clang@13.1.6 ----------------------
lweosdw git@2.32.1 634kih5 git@2.32.1
==> Error: You can either:
a) use a more specific spec, or
b) specify the spec by its hash (e.g. `spack uninstall /hash`), or
c) use `spack uninstall --all` to uninstall ALL matching specs.
This also has a recursive effect. If a single package in the DAG is modifed and another package in the DAG is external, Spack will reinstall the modified package and anything that depends on it. Effectively, this means that --reuse no longer works if you use external packages and update Spack on occasion.
This is particularly problematic on macOS because many packages depend on unwind and uuid and Spack ships with a packages.yaml that registers these as external. Since Python depends on uuid, Spack reinstalls all of my Python libraries any time any file is modified, just like in the days before --reuse was added, but worse because we now use a full hash.
Error message
No response
Information on your system
- Spack: 0.19.0.dev0 (a12ce9f)
- Python: 3.9.12
- Platform: darwin-monterey-m1
- Concretizer: clingo
@tgamblin @alalazo
General information
Steps to reproduce
First, blow away
~/.spack, clone a fresh copy of Spack, and check for external packages:This will register all external packages it finds on the system in
packages.yaml. We'll focus on git since it's guaranteed to be found, but this affects all external packages.Next, install git:
Next, modify the git package. For example, add a new variable:
Now, Spack will no longer be able to reuse the existing git installation:
This introduces a lot of inconsistencies in the database.
spack findclaims to only find a single installation, butspack uninstallbegs to differ:This also has a recursive effect. If a single package in the DAG is modifed and another package in the DAG is external, Spack will reinstall the modified package and anything that depends on it. Effectively, this means that
--reuseno longer works if you use external packages and update Spack on occasion.This is particularly problematic on macOS because many packages depend on
unwindanduuidand Spack ships with apackages.yamlthat registers these as external. Since Python depends onuuid, Spack reinstalls all of my Python libraries any time any file is modified, just like in the days before--reusewas added, but worse because we now use a full hash.Error message
No response
Information on your system
@tgamblin @alalazo
General information
spack debug reportand reported the version of Spack/Python/Platform