diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2020-12-13 17:20:47 -0800 |
---|---|---|
committer | Tamara Dahlgren <dahlgren1@llnl.gov> | 2021-02-17 17:07:28 -0800 |
commit | ea617f807ffd696f6c254317bc54c7cde2108c29 (patch) | |
tree | 2b65b3399cb3696a869d4986a7fc511ea3b7a07c | |
parent | d0dfd3cb821a996085a6701093c48fa56933579f (diff) | |
download | spack-ea617f807ffd696f6c254317bc54c7cde2108c29.tar.gz spack-ea617f807ffd696f6c254317bc54c7cde2108c29.tar.bz2 spack-ea617f807ffd696f6c254317bc54c7cde2108c29.tar.xz spack-ea617f807ffd696f6c254317bc54c7cde2108c29.zip |
concretizer: pull _develop_specs_from_env out of main setup loop
-rw-r--r-- | lib/spack/spack/solver/asp.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 87536570c6..c7a3dda21d 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -1413,6 +1413,13 @@ class SpackSolverSetup(object): self.preferred_targets(pkg) self.preferred_versions(pkg) + # Inject dev_path from environment + env = spack.environment.get_env(None, None) + if env: + for spec in sorted(specs): + for dep in spec.traverse(): + _develop_specs_from_env(dep, env) + self.gen.h1('Spec Constraints') for spec in sorted(specs): if not spec.virtual: @@ -1422,10 +1429,6 @@ class SpackSolverSetup(object): for dep in spec.traverse(): self.gen.h2('Spec: %s' % str(dep)) - - # Inject dev_path from environment - _develop_specs_from_env(dep) - if dep.virtual: for clause in self.virtual_spec_clauses(dep): self.gen.fact(clause) @@ -1637,8 +1640,9 @@ class SpecBuilder(object): for s in self._specs.values(): spack.spec.Spec.ensure_external_path_if_external(s) + env = spack.environment.get_env(None, None) for s in self._specs.values(): - _develop_specs_from_env(s) + _develop_specs_from_env(s, env) for s in self._specs.values(): s._mark_concrete() @@ -1649,8 +1653,7 @@ class SpecBuilder(object): return self._specs -def _develop_specs_from_env(spec): - env = spack.environment.get_env(None, None) +def _develop_specs_from_env(spec, env): dev_info = env.dev_specs.get(spec.name, {}) if env else {} if not dev_info: return |