When patching snappy for Firestore, add --binary flag to patch command. #9941
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Firestore's snappy patching in the firebase-cpp-sdk is broken on GitHub Actions runners after upgrading its firebase-ios-sdk dependency from 9.1.0 to 9.2.0 in firebase/firebase-cpp-sdk#1003:
https://github.com/firebase/firebase-cpp-sdk/runs/7023311255
Note that this PR has some special logic in firebase/firebase-cpp-sdk@77f3e70 to remove the patching of the "snappy" library.
The error from the build log is:
Originally, I was not able to reproduce this locally; however, I was able to reproduce it by doing the following:
patch.exe
from itsc\bin
subdirectory into an empty directory (e.g.c:\StrawberryPatch
).patch.exe
to thePATH
environment variable (e.g.set PATH=c:\StrawberryPatch;%PATH%
).cmake -S . -B build -DFIREBASE_CPP_BUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=external\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -A x64
)Watch the output from cmake closely, and you will see the error.
The problem appears to be that the GitHub Actions runners use the
patch
command that is bundled with Strawberry Perl, which cannot seem to handle the patch file format of cmake/external/firestore.patch.txt.Note that the
patch.exe
bundled with git (v2.7.6) does handles the patch just fine. The version of patch bundled with Strawberry Perl, and installed viachoco install patch
is 2.5.9, which appears to have some sort of bug.This PR fixes the issue by specifying
--binary
topatch.exe
, which is a no-op on posix systems.#no-changelog