diff options
-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 1b59337a09..1546939f9f 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -1412,6 +1412,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: @@ -1421,10 +1428,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) @@ -1636,8 +1639,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() @@ -1648,8 +1652,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 |