Skip to content

Commit

Permalink
Make setup script generation work with newer versions of spack
Browse files Browse the repository at this point in the history
Necessary after spack/spack#38944
  • Loading branch information
tmadlener committed Jul 24, 2023
1 parent 32129dd commit fa76d4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/key4hep-stack/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
import spack.util.environment
from spack.util.environment import *
import spack.user_environment as uenv
import spack.store

try:
# https://github.com/spack/spack/pull/38944 renamed store -> STORE
from spack.store import STORE
except ImportError:
from spack.store import store as STORE

# TODO: can be removed when spack versions prior to v0.18.1 are no longer needed
try:
Expand Down Expand Up @@ -132,7 +137,7 @@ def install_setup_script(self, spec, prefix, env_var):
env_mod.prepend_path("PATH", os.path.dirname(self.compiler.cxx))

# now walk over the dependencies
with spack.store.db.read_transaction():
with STORE.db.read_transaction():
for dep in spec.traverse(order="post"):
env_mod.extend(uenv.environment_modifications_for_spec(dep))
env_mod.prepend_path(uenv.spack_loaded_hashes_var, dep.dag_hash())
Expand Down

0 comments on commit fa76d4b

Please sign in to comment.