diff --git a/lib/spack/llnl/util/link_tree.py b/lib/spack/llnl/util/link_tree.py index 940526dd5ca..33a16d71a9b 100644 --- a/lib/spack/llnl/util/link_tree.py +++ b/lib/spack/llnl/util/link_tree.py @@ -64,7 +64,7 @@ def find_conflict(self, dest_root, **kwargs): return dest return None - def merge(self, dest_root, **kwargs): + def merge(self, dest_root, link=os.symlink, **kwargs): """Link all files in src into dest, creating directories if necessary. If ignore_conflicts is True, do not break when the target exists but @@ -95,7 +95,7 @@ def merge(self, dest_root, **kwargs): else: raise AssertionError("File already exists: %s" % dest) else: - os.symlink(src, dest) + link(src, dest) if ignore_conflicts: return existing