From 686ece1eb7b3169596f8e3bf70e34f69f88ebf76 Mon Sep 17 00:00:00 2001 From: Gregory Date: Wed, 5 Apr 2023 18:07:23 -0700 Subject: [PATCH] fixup --- lib/spack/spack/environment/environment.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py index ae6581bbf03..fe026ee0557 100644 --- a/lib/spack/spack/environment/environment.py +++ b/lib/spack/spack/environment/environment.py @@ -494,7 +494,7 @@ def _current_root(self): if not os.path.exists(self.root): return None - view = self.view(created_path=False) + view = self.view() orig_path = view.metadata.get("created_path", None) if orig_path: return orig_path @@ -537,7 +537,7 @@ def get_projection_for_spec(self, spec): view = self.view() return view.get_projection_for_spec(spec) - def view(self, new=None, created_path=True): + def view(self, new=None, created_path=False): """ Generate the FilesystemView object for this ViewDescriptor @@ -550,6 +550,10 @@ def view(self, new=None, created_path=True): new (str or None): If a string, create a FilesystemView rooted at that path. Default None. This should only be used to regenerate the view, and cannot be used to access specs. + created_path (bool): Pass metadata on the path the view was created in to the + underlying view implementation. Default False. This option should be enabled + when creating a view to add packages to, but not when creating a view object + to query an existing view. """ root = new if new else self.root @@ -708,7 +712,7 @@ def regenerate(self, concretized_root_specs, force=False): if specs: tty.msg("Updating view at {0}".format(self.root)) - view = self.view(new=new_root) + view = self.view(new=new_root, created_path=True) # Create a new view try: