Comments (32)
Here's the output of patch -p1 -i patches/react-native-ssdp+2.7.5.patch --verbose --dry-run
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/node_modules/react-native-ssdp/lib/client.js b/node_modules/react-native-ssdp/lib/client.js
|index 942b3f0..74c429d 100644
|--- a/node_modules/react-native-ssdp/lib/client.js
|+++ b/node_modules/react-native-ssdp/lib/client.js
--------------------------
Patching file node_modules/react-native-ssdp/lib/client.js using Plan A...
Hunk #1 succeeded at 50.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/node_modules/react-native-ssdp/lib/index.js b/node_modules/react-native-ssdp/lib/index.js
|index b90feb7..39905be 100644
|--- a/node_modules/react-native-ssdp/lib/index.js
|+++ b/node_modules/react-native-ssdp/lib/index.js
--------------------------
Patching file node_modules/react-native-ssdp/lib/index.js using Plan A...
Hunk #1 succeeded at 11.
Hunk #2 succeeded at 135.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/node_modules/react-native-ssdp/node_modules/react-native-udp/UdpSocket.js b/node_modules/react-native-ssdp/node_modules/react-native-udp/UdpSocket.js
|index 73dca9f..d30bcd1 100644
|--- a/node_modules/react-native-ssdp/node_modules/react-native-udp/UdpSocket.js
|+++ b/node_modules/react-native-ssdp/node_modules/react-native-udp/UdpSocket.js
--------------------------
Patching file node_modules/react-native-ssdp/node_modules/react-native-udp/UdpSocket.js using Plan A...
Hunk #1 succeeded at 83.
done
from patch-package.
Thanks for the report. Do you mind sharing your patch files so I can debug this?
EDIT
If you've landed here from google, try the v6 pre release branches patch-package@beta
from patch-package.
Sure. Attached the patch file.
from patch-package.
Cool thanks. I'm quite busy until Saturday but will try to make some time to look at this before then, it's a high priority for me.
from patch-package.
Looks like it might be related to patching nested dependencies.
@migzai can you run
patch -p1 -i patches/react-native-ssdp+2.7.5.patch --verbose --dry-run
on MacOS and paste the output here please?
from patch-package.
Thanks. Looks fine. Must be git-specific then. Any chance you could share your repo with me? Would make it a lot easier to debug.
from patch-package.
Attached a test case..
from patch-package.
Yes this happens if the project uses git and the .git folder isn't at the same level as the patches directory.
from patch-package.
Can confirm. Thanks.
This project was using the unix patch
command up until recently. We switched to git apply
for the windows support, but it seems that introduces its own problems. On initial inspection of git-apply
, there doesn't seem to be a cli option to work around this. Will have to look into some other option for windows.
As a temporary workaround, version 3.3.1 should work on windows with git bash.
from patch-package.
I think I've fixed this now in version 3.3.4, by using the --unsafe-paths option to git apply
Could you check it works on your end, @migzai ? I don't have Windows testing facilities.
from patch-package.
I can confirm that this doesn't work on Windows still. Git is 'Skipping patches'.
from patch-package.
π© I'll look in to this some more on saturday
from patch-package.
Hi. Any progress on this so far? Thanks
from patch-package.
Sorry I didn't make any useful progress on it on saturday. I'll have some time this evening to try again.
from patch-package.
Progress update: this is definitely an inconsistency in the way git apply
works on different platforms. Windows git ignores the facet of --unsafe-paths that says the files don't have to be in the index, and will silently skip them if it can't find them in the index. Apparently there is an undocumented --no-index flag, but that doesn't seem to help either, at least on the windows machine I'm using. I'm going to do two things:
- check for silently skipped files
- if files were silently skipped and we're running on windows and the git root folder is not the same as the package.json, make a copy of the patch file with the named file paths resolved relative to the root of the git repo, and apply that instead.
- otherwise throw an error
This should be a forwards-compatible workaround, in case windows git ever aligns its behaviour across platforms.
from patch-package.
π Now I'm seeing the same behaviour on MacOS so it must be that my testing env was not set up properly when I thought I'd fixed it last week. At least that means git is consistent :)
from patch-package.
@migzai Pretty sure this is fixed now. Tested on windows and everything! Do you mind confirming 3.3.5 solves your issue?
from patch-package.
Hi. Just tested 3.3.5 on Windows. Still getting the same behavior as before..
from patch-package.
π§ Even with the test repo you attached?
from patch-package.
Yes..
from patch-package.
My apologies. I'll double check my tests next time I have access to the windows laptop, which will be on Sunday. Sorry again for the inconvenience. Could have sworn this was working π
from patch-package.
Same issue here, works on node modules in the same folder as where the .git folder is but doesn't work for any sub-directories.
from patch-package.
Thanks @calvin337 β is that also for windows?
from patch-package.
Yeah also for Windows, it works fine on Mac.
from patch-package.
@migzai @calvin337 just released 3.3.6 - again pretty sure this fixes the issue. Third time's a charm π€ :D
from patch-package.
I can confirm that this now works on Windows. Thanks! There's an issue though on Linux when I attempt to run patch-package:
Patch was made for version 0.10.8
Meanwhile node_modules/react-native-fetch-blob is version 0.10.8
Something not logical going on and the patch-package fails with exit code 1.
patch-package.zip
from patch-package.
Thanks for the log. I'll take a look tonight.
from patch-package.
Can't reproduce this issue on ubuntu with the test repo. @migzai any chance you could zip and attach the patch file for react-native-fetch-blob?
from patch-package.
There you go.
react-native-fetch-blob+0.10.8.zip
from patch-package.
Thanks. Still can't reproduce the issue with your test repo, unfortunately. I added the patch file into the patches directory, upgraded patch-package, and added react-native-fetch-blob. The patch was applied as expected on Ubuntu 17.04 with Git 2.11.0
Which linux/git are you on? Did you try deleting node_modules and trying again? Any other help you could give to reproduce the issue would be most appreciated π
from patch-package.
@migzai Not sure if you're still suffering from this problem, but thanks to #21 we figured out that git can enforce particular whitespace rules for patch files, which should make them work across platforms seamlessly. π€
All you need to do is add one line in .gitattributes
, see the linked issue for details. Let me know if that solves your problem, or maybe you're not using patch-package anymore in which case feel free to ignore this and I'll close the issue due to inactivity in a few days.
Thanks for your help and collaboration!
from patch-package.
Closing due to inactivity, as discussed. Please re-open if you find the problem has not been solved.
from patch-package.
Related Issues (20)
- Is there a way to convert pnpm patches to patch-package patches? Or do they use the same format? HOT 2
- -
- Uniterpretable Error during makePatch HOT 11
- react-native-otp-verify+1.1.6.patch
- Confusing syntax error message when pointing to a package that does not exist
- Patch not applied after package upgrade
- inflight - Missing Release of Resource after Effective Lifetime HOT 2
- how get the post-install to run when installing cosmos (or storybook and the like)
- Patch cannot be applied when it simultaneously renames and modifies the file HOT 5
- npx patch-package [email protected] error HOT 1
- Not sure if I'm clear on how to re-apply updated patch...
- Can patch-package detect content changes in package.json? Let's say I changed a dependency versionοΌ HOT 3
- Failed to apply patch for package react-native at path node_modules/react-native HOT 1
- Failed to apply patch for package react-native-ui-lib at path node_modules/react-native-ui-lib
- Installing a dependency with its own local patches doesn't apply them HOT 1
- Support for yarn berry HOT 1
- ERROR with RN 0.74.x HOT 1
- Respect `copy from`/`copy to` extended headers
- How to exclude android\build folder?
- node_modules/@rbmweb/canvas This error was caused because patch-package cannot apply the following patch file: patches/@rbmweb+canvas+1.0.0.patch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patch-package.