-
Notifications
You must be signed in to change notification settings - Fork 984
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
apply patches with patch files #19451
Conversation
b6324ce
to
82b7b89
Compare
Jenkins BuildsClick to see older builds (54)
|
@@ -4,16 +4,17 @@ | |||
|
|||
{ stdenv, deps, nodejs, patchMavenSources }: | |||
|
|||
let | |||
patchesDir = ./../../../patches; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if should I move patches
directory inside nodejs-patched
or keep it in root 🤔
In most projects patches remain in root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe $GITROOT
could be used to make this neater?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Nix paths have to be relative here. I don't mind them being at repo root, but they would also make sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by here do you mean instead of status-mobile/patches
we could store patches in status-mobile/nix/deps/nodejs-patched/patches
?
I don't mind actually, I'd be more than happy to get rid of the "./../../../" from the patchesDir
variable :D
ad15504
to
c5ac62d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, but it would be better if we had a script or at least a README.md
explaining how these patch files should be created.
@@ -4,16 +4,17 @@ | |||
|
|||
{ stdenv, deps, nodejs, patchMavenSources }: | |||
|
|||
let | |||
patchesDir = ./../../../patches; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Nix paths have to be relative here. I don't mind them being at repo root, but they would also make sense here.
Thanks! |
8c0765c
to
70b5564
Compare
af66bd6
to
4b4e499
Compare
fixes #19449 In this commit we change the way patches are applied. We no longer have to write patches in a patch phase like we used to, we can now place individual changes in a patch file inside the `patches` directory and they will be automatically applied. Because of this change we can get rid of forks and instead have those changes in patch files. To generate a patch file this make command can be used `make patch-file` This will open an interactive shell which will allow you to specify which file you want to patch and then wait till you make those changes and generate a patch for it. ``` make patch-file Configuring Nix shell for target 'default'... Enter the path of the file to patch: ./node_modules/is-glob/index.js File to patch: ./node_modules/is-glob/index.js Temporary directory created: /tmp/tmp-status-mobile-40bc588fa/tmp.xrXarXoTPZ Original file copied to temporary directory. Please make the necessary changes to the file: ./node_modules/is-glob/index.js Press any key when you are done with the changes... Generating patch file... Patch file created at /Users/siddarthkumar/code/status-im/PR/status-mobile/patches/index.js.patch Info: Please execute 'make run-clojure' to test if the patch file works as expected. ``` - Android - iOS
4b4e499
to
1a56dc2
Compare
fixes #19449
Summary
In this PR we change the way patches are applied.
We no longer have to write patches in a patch phase like we used to, we can now place individual changes in a patch file inside the
patches
directory and they will be automatically applied.Because of this change we can get rid of forks and instead have those changes in patch files.
To generate a patch file this make command can be used
make patch-file
This will open an interactive shell which will allow you to specify which file you want to patch and then wait till you make those changes and generate a patch for it.
Platforms
status: ready