-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requires GNU patch 2.7 for correct behavior, but composer-patches
does not warn the user about this!
#326
Comments
Warning could lead to faq wiki page instead of patch build detection |
Definitely not opposed to a warning here if there's a reliable way to detect GNU Patch vs whatever macOS ships with. |
This is still a problem. A colleague of mine wasted another hour on this. To answer your question about detecting GNU patch:
( → I am pretty sure that you could do something like |
Some colleagues are using brew ( I use Ubuntu mostly ) Here's the easy solution for Macintosh brewers that need an upgraded version of gpatch/patch to allow advanced patch capabilities and prevent composer failures:
Then restart terminal or reboot, try again, patch version should show up as 2.7.6 This resolves the 'Only garbage found' when applying certain types of patches specifically ones that move files around. |
Related: #262 |
Please review the PR @ #402 where we try to get the non-GNU version of patch working |
Can someone please provide a minimum failing example for this issue (i.e. a composer.json with failing patch)? I use the stock patch utility with Ventura and have not had any problems applying patches. I only see problems if I specify the wrong patch level, which is to be expected. |
Let's just close this. #447 has explicit support and detection for different versions of patch. The behavior in 2.x is going to be pretty different: the goal is to get the patch applied, and the mechanism for actually performing that work doesn't matter as much. As long as there is a usable mechanism for applying a patch, the patch should be applied. |
What I've noticed is colleagues using MacintApples are using brew and on the MacintApple the version of patch is an older version that has problems applying patches that move files around. Test this by writing a patch that moves the same file from one folder to another. Example:
include this patch with your project and ask a MacintApple person to run the composer install. Unless they upgrade to use gpatch version 1.7.6 their system will fail to execute a move file(s) patch . |
before patch version: output might look something like To fix MacintApple brew environments use the following commands:
after upgrading the command This version of patch has no problem moving files around. |
In that scenario (even in 1.x), Git should be able to apply the patch properly before it ever gets to |
cweagans, yes that is likely true that git apply could be a better cross platform option but I'm not sure how to make git behave like patch , where patch applies to the current folder but git applies to the root respository which is not predictable. Not only that, composer can include some git repos and other projects that are not git repos. |
Do you have One other idea that I've been kicking around is to distribute a version of patch compiled like this so that there is a valid patcher no matter what. That might not be 2.0.0 though (and may not even be in the core plugin). |
@cweagans no I don't have that entry I have this instead:
|
ok I'll add that config option and try it out. We're using cweagans version 1.x
|
After adding it will look like this.
|
@cweagans wow facinating link you shared https://justine.lol/ape.html this would be really cool to have a single executable do everything cross platform. With that said, windows filesystems have a real tough time with Linux/BSD-like symlinks but most things would work. It'd be good to actually fix the MacintApple brew problem this way though. |
Preferred-install should be one level up (a sibling of allow-plugins). |
Just got bitten by this. Thanks for posting the brew solution |
|
Originally posted by @wimleers in #172 (comment)
The solution:
Originally posted by @cweagans in #172 (comment)
The text was updated successfully, but these errors were encountered: