-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
stdenv.mkDerivation: patches with renames fail to apply #370363
Comments
That’s |
I've tried with fetchpatch2 first but got wrong output
|
You need to update the hashes when you change fetcher. (I’m not 100% sure that |
I have. unrelated but I also edited the original post to add installPhase, etc. it was previously a broken derivation.
I haven't tried it with |
If you manually run the commands that fetchpatch2 runs (lsdiff and filterdiff), you can see that indeed pure renames without content changes are dropped by both commands. This is an upstream issue though. Solving this in nixpkgs would probably be hacky. This is also mentioned in #266556. |
I have used so it should not use lsdiff or filterdiff. (stdenv.mkDerivation uses the And I checked with from the above pr you linked
that seems like a solution # in current master first pr/patch is already merged
$ curl -L https://github.com/NixOS/nixpkgs/pull/370188.diff | patch -p1
...
$ curl -L https://github.com/kachick/nixpkgs/pull/3.diff | patch -p1
patching file pkgs/by-name/dp/dprint/plugins/default.nix
Hunk #1 FAILED at 15.
Hunk #2 FAILED at 32.
2 out of 2 hunks FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/default.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-biome.nix
Hunk #1 FAILED at 15.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-biome.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-dockerfile.nix
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-dockerfile.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-json.nix
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-json.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-jupyter.nix
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-jupyter.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-markdown.nix
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-markdown.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-ruff.nix
Hunk #1 FAILED at 11.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-ruff.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-toml.nix
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-toml.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/dprint-plugin-typescript.nix
Hunk #1 FAILED at 15.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/dprint-plugin-typescript.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/g-plane-malva.nix
Hunk #1 FAILED at 13.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/g-plane-malva.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/g-plane-markup_fmt.nix
Hunk #1 FAILED at 18.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/g-plane-markup_fmt.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/g-plane-pretty_graphql.nix
Hunk #1 FAILED at 11.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/g-plane-pretty_graphql.nix.rej
patching file pkgs/by-name/dp/dprint/plugins/g-plane-pretty_yaml.nix
Hunk #1 FAILED at 11.
1 out of 1 hunk FAILED -- saving rejects to file pkgs/by-name/dp/dprint/plugins/g-plane-pretty_yaml.nix.rej
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
Cannot rename file without two valid file names
patching file pkgs/by-name/dp/dprint/plugins/update-plugins.py |
Ah right, I misunderstood the issue. Weird though, because I apply many patches to nixpkgs in the same way and I'm not running into the same issue. |
I don't have the time to find the commits which produced this issue. (the pr got merged so the hashes changed) hope this is a one off and already covered in the known issues about fetchpatch, fetchpatch2 linked above. |
Describe the bug
stdenv.mkDerivation
patches fail to apply with the following caseSteps To Reproduce
Steps to reproduce the behavior:
See error:
I am trying fetchurl above because fetchpatch2 doesn't work for renames, it is a known issue. #32084
Additional context
the below does run successfully
Initially I was using
applyPatches
, which is just a mkDerivation call.Expected behavior
Expect patches with renames to be handled properly in stdenv.mkDerivation.
Metadata
Notify maintainers
@NixOS/stdenv
Apologies in advance if it is a known issue, In my search I couldn't find one
The text was updated successfully, but these errors were encountered: