diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-04-29 16:24:18 +0530 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-04-29 08:35:51 -0400 |
commit | f71c9aebfbceb8623756b981392b6d6d2b4e7c22 (patch) | |
tree | c5f6ba64c2d0febe0f1ec969225d397406a2a755 | |
parent | 6def03c787407fc4ff95595abab15083e757275e (diff) | |
download | meson-f71c9aebfbceb8623756b981392b6d6d2b4e7c22.zip meson-f71c9aebfbceb8623756b981392b6d6d2b4e7c22.tar.gz meson-f71c9aebfbceb8623756b981392b6d6d2b4e7c22.tar.bz2 |
wrap: Always pass posix paths to patch
patch on Windows is provided by MSYS, which only understands POSIX
paths, with `/`. Using Windows paths with `\` results in a "file not
found" error.
We got a little lucky here because the path is relative, so the drive
letter difference doesn't affect us.
-rw-r--r-- | mesonbuild/wrap/wrap.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index d1ed312..b63d7a4 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -794,7 +794,8 @@ class Resolver: raise WrapException(f'Diff file "{path}" does not exist') relpath = os.path.relpath(str(path), self.dirname) if PATCH: - cmd = [PATCH, '-f', '-p1', '-i', relpath] + # Always pass a POSIX path to patch, because on Windows it's MSYS + cmd = [PATCH, '-f', '-p1', '-i', str(Path(relpath).as_posix())] elif GIT: # If the `patch` command is not available, fall back to `git # apply`. The `--work-tree` is necessary in case we're inside a |