Skip to content

Commit e06866a

Browse files
committed
wrap: Don't use patch.exe from Strawberry Perl
It barfs on patches from git-format-patch: ``` Applying diff file "orc-0.4.38\0001-meson-fix-symbols-leaking-from-static-library-on-Win.patch" patching file meson.build Assertation failed! Program: C:\Strawberry\c\bin\patch.EXE File: .\src\patch\2.5.9\patch-2.5.9-src\patch.c, Line 354 Expression: hunk ```
1 parent 12563f7 commit e06866a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mesonbuild/wrap/wrap.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@
5757

5858
ALL_TYPES = ['file', 'git', 'hg', 'svn', 'redirect']
5959

60-
PATCH = shutil.which('patch')
60+
if mesonlib.is_windows():
61+
from ..programs import ExternalProgram
62+
_patch = ExternalProgram('patch', exclude_paths=[r'C:\Strawberry\c\bin'])
63+
PATCH = _patch.get_path() if _patch.found() else None
64+
else:
65+
PATCH = shutil.which('patch')
66+
6167

6268
def whitelist_wrapdb(urlstr: str) -> urllib.parse.ParseResult:
6369
""" raises WrapException if not whitelisted subdomain """

0 commit comments

Comments
 (0)