composer-patches: Requires GNU patch 2.7 for correct behavior, but `composer-patches` does not warn the user about this!
@cweagans holy shit, the need for
brew install gpatchtook me many hours to figure out, because for a particular project TravisCI builds were succeeding but local builds were failing. 😬 Can we makecweagans/composer-patchesdetect thepatchversion, and explicitly warn the user that any version below 2.7 may result in silent failures?
_Originally posted by @wimleers in https://github.com/cweagans/composer-patches/issues/172#issuecomment-674860594_
The solution:
brew install gpatch(you’ll need Homebrew installed for that to work (https://brew.sh))
_Originally posted by @cweagans in https://github.com/cweagans/composer-patches/issues/172#issuecomment-587147692_
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (5 by maintainers)
Links to this issue
Commits related to this issue
- Check if GNU patch is used fixes #326 — committed to alfredbez/composer-patches by alfredbez 2 years ago
This is still a problem. A colleague of mine wasted another hour on this.
To answer your question about detecting GNU patch:
(
/usr/bin/patchships with macOS,/usr/local/bin/patchwas installed bybrew install gpatch.)→ I am pretty sure that you could do something like
preg_match('/^GNU patch/', …)on the output ofpatch --version.