From 9aab03a552fae24cf8d82166f27f16e5cdc75df6 Mon Sep 17 00:00:00 2001 From: micbou Date: Thu, 28 Jan 2016 04:48:24 +0100 Subject: [PATCH] Ignore errors on CI when removing build folder On AppVeyor, the following error may occur when removing the temporary ycmd build folder: WindowsError: [Error 145] The directory is not empty It probably happens because the ycm_core_tests executable is still locked by some process while removing the folder. --- build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 7d33f9f0c7..90714843ec 100755 --- a/build.py +++ b/build.py @@ -38,6 +38,10 @@ def OnWindows(): return platform.system() == 'Windows' +def OnTravisOrAppVeyor(): + return 'CI' in os.environ + + # On Windows, distutils.spawn.find_executable only works for .exe files # but .bat and .cmd files are also executables, so we use our own # implementation. @@ -266,7 +270,7 @@ def BuildYcmdLibs( args ): RunYcmdTests( build_dir ) finally: os.chdir( DIR_OF_THIS_SCRIPT ) - rmtree( build_dir ) + rmtree( build_dir, ignore_errors = OnTravisOrAppVeyor() ) def BuildOmniSharp():