mapbox / windows-builds

DEPRECATED! build scripts for mapnik dependencies, mapnik, node-mapnik, node, libosmiom, osmium-tool
38 stars 22 forks source link

patching breaks the build #21

Closed stefda closed 9 years ago

stefda commented 9 years ago

I've recently attempted to build the dependencies and found that some of the build scripts break on the patch command when the file has already been patched:

patch -N -p1 < %PATCHES%/png.diff || %SKIP_FAILED_PATCH%
IF ERRORLEVEL 1 GOTO ERROR

It appears that the patch utility returns ERRORLEVEL 1 when the files are already patched:

C:\dev\projects\mapnik-dependencies\scripts>build_libpng.bat
------ libpng -----
"checking for libpng-1.6.14.tar.gz"
"using cached libpng-1.6.14.tar.gz"
found extracted sources
patching file `projects/vstudio/libpng/libpng.vcxproj'
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to projects/vstudio/libpng/libpng.vcxproj.rej
patching file `projects/vstudio/zlib/zlib.vcxproj'
Reversed (or previously applied) patch detected!  Skipping patch.
2 out of 2 hunks ignored -- saving rejects to projects/vstudio/zlib/zlib.vcxproj.rej
patching file `projects/vstudio/zlib.props'
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to projects/vstudio/zlib.props.rej
======== ERROR libpng =======

I solved the problem by manually inspecting the patches and commenting-out the patch command when it was not needed. But because I'm quite new to all this, my observation may be wrong and I don't know what implications this might have for the whole build.

wilhelmberg commented 9 years ago

@stefda you can do SET SKIP_FAILED_PATCH=true, then it will go past already applied batches.

Please use carefully.

The intention of stopping the build is to get notified when patching fails, e.g. a dependency has been upgraded and the patch is not valid anymore.

wilhelmberg commented 9 years ago

@stefda I changed the scripts, so that the patches get only applied once after the package has been extracted. No need to use SET SKIP_FAILED_PATCH=true anymore.