-
-
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
Can't patch after update to MacOS Ventura #423
Comments
I have had this exact issue as well. I found by accident spamming the enter key while it runs works. So it seems like there is a user input that may be being suppressed. I have found that adding the -n (--no-interaction) flag allows patches to apply just fine. |
I also tried with the -v (--verbose) flag, and it didn't stall then either. As I was writing this, I decided to try a couple of things. I and trying to step through it with the enter key results like so: It seems like something has changed with perhaps the patch binary being used and currently rolled patches that is now causing an issue with it no longer being able to find the patch file locations in some cases. Example of a now-failing patch: https://www.drupal.org/files/issues/2022-07-24/2949017-99.patch For reference, I'm including a screenshot of the successful patch action during composer run, if useful. |
Last followup on this, this can be corrected fully by ensuring you are using the
Adding that corrected the stall, and correctly applied core and contrib patches. |
Seeing one patch fail on core on my host. Running in an alpine container remains fine.,
Patch is https://www.drupal.org/files/issues/2019-11-11/2831233-83.patch, it has about 40 other patches its applying with just for core. So could either be new conflict behaviour, maybe the patch is corrupt and cached?... |
In our case it happens with Magento. Spamming the enter key let's me finish too. The patch file can't be found in all the failing cases. |
Same here, after Ventura update composer asks for "File to path:" in -vvv mode and is stuck otherwise.
|
Maybe this information is of any help. My Big Sur patch version is 2.5.8 and on Ventura it's 2.0-12u11-Apple. |
On that note, what seemed to fix this for me with additional testing was installing the gnu patch via homebrew. (https://formulae.brew.sh/formula/gpatch) After which, no issues with patches applying, including the one that failed for @dpi |
@mikeohara solution from #423 (comment) is fixing the issue. Thank you! |
I can confirm that installing gpatch resolved this issue for me as well. |
For me, installing composer-patches/src/Plugin/Patches.php Line 111 in 55c4289
and added them like so:
Turns out, for me, Some projects, though, have quite some patches. So, it's simply not feasible to add them all via the
But it turns out, that the Ultimately, this SO answer had me use So, it works, because it does what we want:
But, simply adding
Any idea on how to proceed? Maybe the potential side-effects are negligible? After all, I'd expect developers to know what they are doing. |
Thanks @mikeohara for #423 (comment) it worked for me. |
I can't update all my project composer files just so they work on my local - I need them to work in a docker / CI environment as well. |
For me the |
I tried both solutions:
The first option works just fine, and it's quick, and for the second one I have to list all components that have to be patched |
Related: #262 |
Please review the PR @ #402 where we try to get the non-GNU version of patch working. I've successfully tested it on FreeBSD, but not MacOS, so it's possible some more logic is needed as far as looking at the PHP_OS_FAMILY constant. And since GNU patch could be installed on any operating system, perhaps it's better to check whether or not patch is GNU patch, rather than looking at operating system family. |
I've tried to create a version that sniffs the patch version PR #444 |
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. |
@danepowell without gpatch installed this seems to fail everytime on my mac and no problem inside ddev container (same version of composer 2.5.1)
I'm on Ventura 13.2, on an M1 MBP, and this is reproducible on an older intel MBP that my colleague has, and not on Windows WSL2 (because ubuntu) composer.json
|
Okay, here's a minimum failing example that I can confirm works in Ubuntu but errors in Ventura without gpatch:
Changing patchlevel to p1 causes the process to hang rather than erroring. Installing gpatch causes p2 to work and p1 to error immediately, as expected. |
We were curious if #444 fixes things for MacOS in addition to FreeBSD, can someone check? As possibly MacOS has a BSD version of patch (although maybe an older more dysfunctional version than FreeBSD..) |
@mfb I manually applied it to 1.x and it would work if the condition was |
It appears this is fixed in master, but I haven't been able to determine in precisely which commit. I wasn't able to replicate the problem in master using the test case above. So it seems like we either need to backport a fix or have a 2.x release. It looks like @cweagans is actively committing tonight, not sure if this is in the cards 😄 Edit: nevermind, see comment below... this is equally broken in 1.x and master, just obscured in master by Git patching. |
I'm inclined to just not support BSD patch, but not sure on that. 2.x is def not ready for release yet though. |
Ah... debugging reveals that the reason this works in master is because patching with Git succeeds, so it never even attempts to use the patch binary. Whereas Git patching fails in 1.x and it falls back to Hacking master to skip Git patching results in the exact same bug as in 1.x. So... ignore my comment above, this is equally broken in 1.x and master, though it might suggest a workaround if anyone wants to figure how to get Git patching working more reliably. |
re: FreeBSD support, #402 should be ready to commit, it's a minimal fix for bug in the existing BSD logic |
@cweagans There may be changes needed to get things working with main, I tried the MVC from #423 (comment) with
|
@joelpittet roger that. I'll take a look. |
I've been thinking: it might be better to just sidestep the entire issue and rely strongly on |
I ended up merging #472, so I'm going to close this again. In |
For me the brew install gpatch solved all patching errors after updating to macOS Ventura |
July 4 2023, and I still have issues when I try to patch a module. Some patches are asking me a file path when I run "composer install -vvv" |
Please try the 2.0.0 beta and see if it works for you. You can also install GNU patch (brew install gpatch). You're welcome to debug further and open a pull request if needed as well. Contributions are welcome. |
Thanks for your fast answer. Finally, it works! I used the URL to the patch (https://www.drupal.org/files/issues/2023-04-13/quick-node-clone-3352168-groups-v2_0.patch) Here my JSON: But when I was having issues, my JSON was this: Do you know why this doesn't work with local files? This is my composer version: This is my OS version: |
It definitely works with local files. The path is relative to the root of your project. So you'd need a |
|
👍 for |
Just to add to this, I just moved from a soon to be retired iMac that was stuck on Big Sur (with patch 2.5.8) to Sonoma (with patch 2.0-12u11-Apple) and when setting up a load of sites patches were not working. Initially I though it was because I'd moved from Valet to Herd so reinstalled valet but then found this issue report and |
For me the |
I'm having a problem with composer patches not being installed. Composer just stops. Running composer install -vvv outputs this: Downloading https://www.drupal.org/files/issues/2018-05-23/image-dimensions-block-changing-translations-2941092-3.patch I've tried installing gpatch and it didn't help. The composer.json and composer.patches.json do work on other computers. I'd appreciate any suggestions on how to fix this. |
Did you have gpatch installed? #423 (comment) |
Yes. I used |
If you write |
It is showing |
I was able to fix this by running |
I am not sure if this is actually an issue of this package or if it is caused somewhere else. Does anyone else has the problem, that while applying a patch (on MacOs Ventura) the process runs into a timeout? This happens only since the recent update.
After hanging on "File to patch" the following error is thrown:
The text was updated successfully, but these errors were encountered: