smanders / externpro

build external projects with cmake
MIT License
13 stars 12 forks source link

patches fail on Windows #295

Closed smanders closed 3 years ago

smanders commented 3 years ago

similar to the same issue seen with palam patches https://isrhub.usurf.usu.edu/smanders/internpro/issues/240 where Windows fails to move/rename a file

the apr patch https://github.com/apache/apr/compare/1.5.2...smanders:xp1.5.2 renames/moves test/sendfile.c to test/sendfiletest.c

on linux

patching file CMakeLists.txt
patching file configure.cmake
patching file include/apr_general.h
patching file include/arch/unix/apr_private.cmake.in
patching file test/sendfiletest.c (renamed from test/sendfile.c)
patching file test/testapp.c
patching file test/testdso.c
patching file test/testsockets.c

on windows

5>patching file CMakeLists.txt
5>patching file configure.cmake
5>patching file include/apr_general.h
5>patching file include/arch/unix/apr_private.cmake.in
5>patching file test/sendfile.c
5>patching file test/testapp.c
5>patching file test/testdso.c
5>patching file test/testsockets.c

and then the cmake (on Windows) fails:

7>CMake Error at CMakeLists.txt:488 (ADD_EXECUTABLE):
7>  Cannot find source file:
7>
7>    test/sendfiletest.c
smanders commented 3 years ago

revert commit https://github.com/apache/apr/commit/b355fff543cd0c1363b17b82fd21d2b07f7aa066 since the rename was to "prevent name clash on systems which have sendfile library (Solaris)" and Solaris is no longer a supported platform

smanders commented 3 years ago

completed with commits referenced above

smanders commented 3 years ago

the wirehair patch also fails https://github.com/catid/wirehair/compare/9e8923a200045c7bdb9e89b449692dbfed6b6de0...smanders:xp20.11.21

gf256.h is moved from the root to include/wirehair https://github.com/smanders/externpro/blob/afa67cbda54314f8d2cfe00ea25873d41cb74eac/patches/wirehair.patch#L905-L908

smanders commented 3 years ago

similar problem reported https://github.com/cweagans/composer-patches/issues/172#issuecomment-365736590 solution https://github.com/cweagans/composer-patches/issues/172#issuecomment-470999914

You need GNU Patch >= 2.7. From their News page (https://savannah.gnu.org/forum/forum.php?forum_id=7361) about 2.7:

Support for most features of the "diff --git" format, including renames and copies, permission changes, and symlink diffs. Binary diffs are not supported yet; patch will complain and skip them.

currently (20.10.1 release of externpro) patch binary is downloaded on Windows from sourceforge https://github.com/smanders/externpro/blob/20.10.1/projects/patch.cmake#L17 -- but the version 2.5.9-7 appears to be the latest available

patch version 2.7.6 is part of Git for Windows and the executable is found in "Program Files/Git/usr/bin" but also requires msys-2.0.dll -- so I've zipped these files up into patch-2.7.6-bin.zip and put it in the externpro releases (associated with externpro 20.10.1 release) https://github.com/smanders/externpro/releases/download/20.10.1/patch-2.7.6-bin.zip

smanders commented 3 years ago

completed with commits to dev branch referenced above