wraps: on failure to apply a patch, delete the subproject directory

This code path is only called on initial download of a subproject, but
if we raise an error and abort while downloading/applying a patch
overlay we still have the upstream sources extracted... which appears to
be a subproject, then turns out to be broken due to missing meson.build

Partially implements #9688
pull/9704/head
Eli Schwartz 3 years ago committed by Jussi Pakkanen
parent 5c7f3b5bb8
commit 7deeb293b6
  1. 8
      mesonbuild/wrap/wrap.py

@ -32,7 +32,7 @@ import textwrap
from pathlib import Path
from . import WrapMode
from .. import coredata
from ..mesonlib import quiet_git, GIT, ProgressBar, MesonException
from ..mesonlib import quiet_git, GIT, ProgressBar, MesonException, windows_proof_rmtree
from ..interpreterbase import FeatureNew
from .. import mesonlib
@ -345,7 +345,11 @@ class Resolver:
self.get_svn()
else:
raise WrapException(f'Unknown wrap type {self.wrap.type!r}')
self.apply_patch()
try:
self.apply_patch()
except:
windows_proof_rmtree(self.dirname)
raise
# A meson.build or CMakeLists.txt file is required in the directory
if method == 'meson' and not os.path.exists(meson_file):

Loading…
Cancel
Save