-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fetchpatch: ignores file renames #32084
Comments
Proof that patch consideres that input: https://git.savannah.gnu.org/cgit/patch.git/commit/?h=v2.7&id=9e39d9c9950076e319d1dbbeeb7b8bd268b465f3 |
Example:
If in this patch, you strip everything before the In other words, it interprets the
and potentially other stuff; (I personally also thought that everything before |
The |
This should already be fixed upstream (twaugh/patchutils@14261ad), we just need to bump patchutils. |
Last time that was attempted, those new git-specific lines caused most existing fetchpatch hashes to change. |
@dezgeg: Okay, which is probably because of that very commit, because it left in other git-specific extensions. Regardless of that, I just checked to verify whether this is problem persists in 0.3.4 and even in master and it's still the case, because |
Okay, while trying to patch So what we practically need is just to turn the patch into a form that is deterministic in its results, which Maybe it makes sense to implement what we need for |
Yeah, I suppose writing a custom implementation is the best. After all, I think all it is doing now is stripping out any comments from the .patch files. |
We also use it to exclude files from patches and add prefixes/suffixes(?) |
@globin: Sure, that's no problem once we have a parser that uses proper data structures for the patches. On the other hand, however I was thinking about writing such an implementation in Haskell and parser combinators, but that would increase the closure size of So I'd like to amend my comment in a way that it's still probably better to patch edit: Rewriting the parser of |
I consider updating |
@orivej: Just updating |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
I hit this issue today. It would be nice to document this behaviour somehow .... I replaced fetchpatch() with fetchurl() and it did the trick for me. |
@arapov Using |
@jtojnar, why |
@arapov We would need a Edit: There is a long-standing issue open twaugh/patchutils#22, no-one probably found time to implement it yet. Nor implement a custom, more fitting tool as proposed above. |
I marked this as stale due to inactivity. → More info |
Still important (I think I just hit this issue, #140429 (comment)). |
Also just ran into this, while applying a patch from Github using |
Still important |
allows us to use the new features of patchutils without having to reset all fetchpatch hashes in nixpkgs NixOS#32084
#182250 $ diff /nix/store/namp0v9k05pjcax761h7nacpvh77205b-abc52460201bc5c7603505bb187138b0c59291aa.diff /nix/store/d2vkicv4b3xghlmaw4bnwnp01zhk7x6f-abc52460201bc5c7603505bb187138b0c59291aa.diff
0a1,2
> diff --git a/configure b/configure
> index b6c9b462f24..a86f2ceaa5b 100755
18a21,22
> diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
> index d16b77acb8e..4ba0a8eaa36 100644
28a33,37
> diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/common/clang-macx-desktop.conf
> similarity index 83%
> rename from mkspecs/macx-clang/qmake.conf
> rename to mkspecs/common/clang-macx-desktop.conf
> index 0cf1f31b60d..042319a2aa3 100644 |
Is |
Yep
If youre already using it then experiment with https://github.com/nixos/nixpkgs/blob/41877098f3ac00295a2a9d5e5846201b969a689b/pkgs/build-support/fetchpatch/default.nix#L39 and see if you can get it working If not, then it's a upstream issue |
I executed nix-shell -p patchutils_0_4_2 then inside the shell: wget 'https://github.com/teeworlds/teeworlds/commit/86d6687ef07f7f05457a7f67537b650656b13820.patch'
lsdiff e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch
|
For reference, #208826 is where I wanted to use this. |
#208918 also has fetchpatch2 failing on the first patch. |
|
Unfortunately, we can't use fetchpatch* here #32084 (comment)
If the patch renames a file, and contains:
Then using
patch -p1 < foobar.patch
works as expected, while using fetchpatch no rename happens.cc @vcunat @aszlig @copumpkin @fpletz @globin
The text was updated successfully, but these errors were encountered: