From 38bb0e3e7d459fbb04d44368530eed1926c706b7 Mon Sep 17 00:00:00 2001 From: Levi Baber Date: Fri, 9 Mar 2018 14:40:57 -0600 Subject: [PATCH] resource: convert symlink to real path (#7417) Fixes #7130 shutil.move expects a source path like "/x/y/" to be a directory and fails if "/x/y" is a symlink. This invokes realpath on the source path to avoid the issue. --- 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 19eca53d1d..e708662253 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -566,7 +566,7 @@ def _add_to_root_stage(self): '{stage}\n\tdestination : {destination}'.format( stage=source_path, destination=destination_path )) - shutil.move(source_path, destination_path) + shutil.move(os.path.realpath(source_path), destination_path) @pattern.composite(method_list=[