Skip to content

Spack adds external packages to the database (silently) with invalid PREFIX path #2208

@pramodk

Description

@pramodk

This is bit opposite to #2191 and I commented there about invalid path.

Here is long story...today I saw following error:

$ spack module refresh
....
  File "..../spack/var/spack/repos/builtin/packages/python/package.py", line 223, in setup_dependent_environment
    raise RuntimeError('Cannot locate python executable')
RuntimeError: Cannot locate python executable

Was wondering why python executable is suddenly an issue. Then realise @BarrySmith added logic to detect PYTHONHOME in #2173. That looks all good. My packages.yaml has always been like:

    python:
        paths:
            [email protected]: /System/Library/Frameworks/Python.framework/Versions/2.7

Looking at installed packages, I saw that the python package silently appears in the installed packages and with the prefix path that doesn't exist. (Note that this doesn't happen right away but I think when I install dependent packages and stuff....) :

 → spack find -p python
==> 2 installed packages.
-- darwin-elcapitan-x86_64 / [email protected] ------------------------
    [email protected]  xxx/spack/opt/spack/darwin-elcapitan-x86_64/clang-3.9.0/python-2.7.10-izyruuenr4wd7d4ssfeotod2tqz7g4kz
......

 → ll xxx/spack/opt/spack/darwin-elcapitan-x86_64/clang-3.9.0/python-2.7.10-izyruuenr4wd7d4ssfeotod2tqz7g4kz
ls: xxx/spack/opt/spack/darwin-elcapitan-x86_64/clang-3.9.0/python-2.7.10-izyruuenr4wd7d4ssfeotod2tqz7g4kz: No such file or directory

Now how to get around this issue? I tried to uninstall packages (which I never installed!), reindex, purge etc.. :

spack uninstall -af python
==> The following packages will be uninstalled :
....
==> Do you want to proceed ? [y/n]
y
==> Removed stale DB entry for [email protected]%[email protected]~tk~ucs4 arch=darwin-elcapitan-x86_64-izyruue
==> Removed stale DB entry for [email protected]%[email protected]~tk~ucs4 arch=darwin-elcapitan-x86_64-mdqov5t

spack reindex
spack purge -as

Is removing database safe option? or something else?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions