From dfd257b97bd274272986e47a4152a11551de3b72 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 13 Apr 2022 02:56:34 +0200 Subject: pkgs/rustfmt: Fix patching in default config The patch file was relative to the rustfmt crate within the rustc source tree, so I added "-d src/tools/rustfmt" as patchFlags to apply the patch against that subdirectory. Unfortunately, patchFlags also applies to other patches as well and I didn't account for that. With current rustfmt from rustc 1.59.0 we have a patch in nixpkgs, which now fails to apply because of this: applying patch /nix/store/...-rustfmt-fix-self-tests.patch can't find file to patch at input line 3 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |--- a/src/tools/rustfmt/src/ignore_path.rs |+++ b/src/tools/rustfmt/src/ignore_path.rs -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored To fix this, I changed the paths in config.patch to be relative to the rustc tree rather than just the rustfmt crate, so the patch should now apply regardless of whether there are other patches. Signed-off-by: aszlig --- pkgs/aszlig/rustfmt/config.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkgs/aszlig/rustfmt/config.patch') diff --git a/pkgs/aszlig/rustfmt/config.patch b/pkgs/aszlig/rustfmt/config.patch index 0a49a585..6864b797 100644 --- a/pkgs/aszlig/rustfmt/config.patch +++ b/pkgs/aszlig/rustfmt/config.patch @@ -1,7 +1,7 @@ -diff --git a/src/config/mod.rs b/src/config/mod.rs +diff --git a/src/tools/rustfmt/src/config/mod.rs b/src/tools/rustfmt/src/config/mod.rs index cd90e090..a6db6da1 100644 ---- a/src/config/mod.rs -+++ b/src/config/mod.rs +--- a/src/tools/rustfmt/src/config/mod.rs ++++ b/src/tools/rustfmt/src/config/mod.rs @@ -282,7 +282,7 @@ impl Config { } } -- cgit 1.4.1