Skip to content

External packages appear installed even if they are not #8036

@alalazo

Description

@alalazo

If Spack is configured with a packages.yaml that includes external packages, these packages may appear installed even if they are not. The cause of that is how we compute the installed property:

@property
def installed(self):
return os.path.isdir(self.prefix)

which returns True if the prefix is there (without any check of the DB).

Expected Result

Starting with this packages.yaml:

packages:
  openssl:
    buildable: False
    paths:
      openssl@system: /usr/lib

and Spack at 231664e:

$ spack find
==> 0 installed packages.

I would expect the following:

$ spack-python
Spack version 0.11.2
Python 2.7.15rc1, Linux x86_64
>>> import spack.spec
>>> s = spack.spec.Spec('openssl')
>>> s.concretize()
>>> s.package.installed
False

Actual Result

What we obtain instead is that openssl appears to be installed:

$ spack-python
Spack version 0.11.2
Python 2.7.15rc1, Linux x86_64
>>> import spack.spec
>>> s = spack.spec.Spec('openssl')
>>> s.concretize()
>>> s.package.installed
True

Information on your system

The only relevant part should be the packages.yaml above

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions