init: initialize spack.store lazily

- spack.store was previously initialized at the spack.store module level,
  but this means the store has to be initialized on every spack call.

- this moves the state in spack.store to a singleton so that the store is
  only initialized when needed.
This commit is contained in:
Todd Gamblin
2018-05-10 11:45:44 -07:00
committed by scheibelp
parent c615d2be06
commit 6f2cac9565
36 changed files with 239 additions and 198 deletions

View File

@@ -197,7 +197,8 @@ def set_CrayLoginNode_cmakeOptions(self, spec, cmakeOptions):
# spec['cbtf'].prefix is the login node value for this build, as
# we only get here when building the login node components and
# that is all that is known to spack.
be_ck = spack.store.db.query_one('cbtf-krell arch=cray-CNL-haswell')
store = spack.store.store()
be_ck = store.db.query_one('cbtf-krell arch=cray-CNL-haswell')
# Equivalent to install-tool cmake arg:
# '-DCBTF_KRELL_CN_RUNTIME_DIR=%s'