diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index d72a53dd76..e6dcc08b22 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -472,9 +472,7 @@ def regenerate(self, all_specs, roots): # recognize environment specs (which do store build deps), then # they need to be stripped if spec.concrete: # Do not link unconcretized roots - specs_for_view.append(spack.spec.Spec.from_dict( - spec.to_dict(all_deps=False) - )) + specs_for_view.append(spec.copy(deps=('link', 'run'))) if self.select: specs_for_view = list(filter(self.select_fn, specs_for_view))