From fbfd56d07e16fa877ca1cc199b44b9564d37cf45 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Mon, 10 Jan 2022 10:10:49 -0800 Subject: [PATCH] stage.steal_source: preserve symlinks This avoids dangling symlink errors. ignore_dangling_symlinks option would be more-targeted but is only available for Python >= 3.2 (#28318) --- lib/spack/spack/stage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index bffd06ab738..df1f6761ace 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -533,7 +533,7 @@ def steal_source(self, dest): for entry in hidden_entries + entries: if os.path.isdir(entry): d = os.path.join(dest, os.path.basename(entry)) - shutil.copytree(entry, d) + shutil.copytree(entry, d, symlinks=True) else: shutil.copy2(entry, dest)