Skip to content

Commit

Permalink
Fix error message and allow missing meta directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Mar 23, 2022
1 parent 3505cce commit b33dd85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/spack/llnl/util/link_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LinkTree(object):
"""
def __init__(self, source_root):
if not os.path.exists(source_root):
raise IOError("No such file or directory: '%s'", source_root)
raise IOError("No such file or directory: '%s'" % source_root)

self._root = source_root

Expand Down
7 changes: 6 additions & 1 deletion lib/spack/spack/filesystem_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,12 @@ def link_meta_folder(self, spec):
src = spack.store.layout.metadata_path(spec)
tgt = self.get_path_meta_folder(spec)

tree = LinkTree(src)
try:
tree = LinkTree(src)
except IOError as e:
# Spack directory is missing, perhaps an ignorant user deleted it?
tty.warn(str(e))
return
# there should be no conflicts when linking the meta folder
tree.merge(tgt, link=self.link)

Expand Down

0 comments on commit b33dd85

Please sign in to comment.