Skip to content
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 fails to patch #18441

Closed
danbst opened this issue Sep 8, 2016 · 1 comment
Closed

fetchpatch fails to patch #18441

danbst opened this issue Sep 8, 2016 · 1 comment

Comments

@danbst
Copy link
Contributor

danbst commented Sep 8, 2016

Issue description

I'm trying to apply patch https://github.com/NixOS/nixpkgs/pull/18419.patch to my local nixpkgs with fetchpatch.

It fails, because fetchpatch reorganises diffs in a wrong way. I have 1 commit that creates a default.nix file, and 1 that changes is. Patching using https://github.com/NixOS/nixpkgs/pull/18419.patch works because changes have same order. Patching using fetchpatch fails, because first diff is changing default.nix, and next is creating default.nix.

Not sure whether this is a bug or a normal condition, because comment explicitly says that

This is primarily useful for dynamically generated patches,
such as GitHub's

ping @vcunat

Steps to reproduce

let
  pkgsWithPatches = tarballURL: patches: parentPkgs: parentPkgs.stdenv.mkDerivation {
    name = "nixpkgs-patched";
    src = fetchTarball tarballURL;
    phases = [ "unpackPhase" "patchPhase" ];
    patches = map parentPkgs.fetchpatch patches;
    postPatch = ''
      mkdir $out && cp -r * $out/
      echo "16.09" > $out/.version
      echo "16.09pre.custom" > $out/.version-suffix
    '';
  };
  URL = "https://github.com/NixOS/nixpkgs-channels/archive/562027e6c211ab9287850aa9efeb8da8c894de8c.tar.gz"; # 28.08.2016
  patches = [
      { meta.description = "update tomcat";
        url = "https://github.com/NixOS/nixpkgs/pull/18419.patch";
        sha256 = "0mxf8csah6yx66q37va668wikibcnzclppf73aww7h9i3n7lx2zz";
      }
  ];
  repo = pkgsWithPatches URL patches (import (fetchTarball URL) {});
in repo
@danbst
Copy link
Contributor Author

danbst commented Sep 8, 2016

Crap, just after I've filled an issue, I found out that .diff works for me (instead of .patch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants