Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for dependent specs in view #468

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/spack/spack/environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,13 @@ def regenerate(self, concrete_roots: List[Spec]) -> None:
# Create a new view
try:
fs.mkdirp(new_root)
view.add_specs(*specs)

if self.link == "all" or self.link == "run":
withdeps = True
else:
withdeps = False

view.add_specs(*specs, with_dependencies=withdeps, exclude=self.exclude)

# create symlink from tmp_symlink_name to new_root
if os.path.exists(tmp_symlink_name):
Expand Down
10 changes: 9 additions & 1 deletion lib/spack/spack/filesystem_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,20 @@ def _sanity_check_view_projection(self, specs):
raise ConflictingSpecsError(current_spec, conflicting_spec)
seen[metadata_dir] = current_spec

def add_specs(self, *specs: spack.spec.Spec) -> None:
def add_specs(self, *specs: spack.spec.Spec, **kwargs) -> None:
"""Link a root-to-leaf topologically ordered list of specs into the view."""
assert all((s.concrete for s in specs))
if len(specs) == 0:
return

specs = set(specs)

if kwargs.get("with_dependencies", True):
specs.update(get_dependencies(specs))

if kwargs.get("exclude", None):
specs = set(filter_exclude(specs, kwargs["exclude"]))

# Drop externals
specs = [s for s in specs if not s.external]

Expand Down
Loading