Skip to content

Commit

Permalink
directory_layout.py: remove dependency on global spack.store.STORE (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie authored Jan 8, 2025
1 parent 35963d7 commit c424611
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lib/spack/spack/directory_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import spack.hash_types as ht
import spack.projections
import spack.spec
import spack.store
import spack.util.spack_json as sjson
from spack.error import SpackError

Expand Down Expand Up @@ -91,7 +90,6 @@ def __init__(
hash_length: Optional[int] = None,
) -> None:
self.root = root
self.check_upstream = True
projections = projections or default_projections
self.projections = {key: projection.lower() for key, projection in projections.items()}

Expand Down Expand Up @@ -274,13 +272,6 @@ def path_for_spec(self, spec):

if spec.external:
return spec.external_path
if self.check_upstream:
upstream, record = spack.store.STORE.db.query_by_spec_hash(spec.dag_hash())
if upstream:
raise SpackError(
"Internal error: attempted to call path_for_spec on"
" upstream-installed package."
)

path = self.relative_path_for_spec(spec)
assert not path.startswith(self.root)
Expand Down

0 comments on commit c424611

Please sign in to comment.