From c424611010e9acde3c391441a3c8103b3d65ec1a Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 8 Jan 2025 17:44:32 +0100 Subject: [PATCH] directory_layout.py: remove dependency on global spack.store.STORE (#48460) --- lib/spack/spack/directory_layout.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index b9c29a2b0cb9bd..13643a8962b05f 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -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 @@ -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()} @@ -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)