From c5d2299caca3f3ca9b8e568c6b6045aed2f00124 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 29 Apr 2020 01:34:56 +0300 Subject: Fix symlink deletion with --wipe option When wiping a build tree with --wipe, every entry in the build directory is removed with mesonlib.windows_proof_rmtree() for directories and mesonlib.windows_proof_rm() for other files. Symlinks to directories are considered directories, resulting in the former being called. This causes an exception to be raised, as the implementation calls shutil.rmtree(), which isn't allowed on symlinks. Fix this by using mesonlib.windows_proof_rm() for symlinks. Signed-off-by: Laurent Pinchart --- mesonbuild/msetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index 77d8377..2521511 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -86,7 +86,7 @@ class MesonApp: # will cause a crash for l in os.listdir(self.build_dir): l = os.path.join(self.build_dir, l) - if os.path.isdir(l): + if os.path.isdir(l) and not os.path.islink(l): mesonlib.windows_proof_rmtree(l) else: mesonlib.windows_proof_rm(l) -- cgit v1.1