about summary refs log tree commit diff
path: root/pkgs/aszlig/rustfmt/config.patch
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2022-04-13 02:56:34 +0200
committeraszlig <aszlig@nix.build>2022-04-13 03:02:34 +0200
commitdfd257b97bd274272986e47a4152a11551de3b72 (patch)
tree6ca8856d493ab993e677769f6cdf17b0b098891f /pkgs/aszlig/rustfmt/config.patch
parentd67ea99bd92956385b8e9d1ff2342dae7c44f9ef (diff)
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 <aszlig@nix.build>
Diffstat (limited to 'pkgs/aszlig/rustfmt/config.patch')
-rw-r--r--pkgs/aszlig/rustfmt/config.patch6
1 files changed, 3 insertions, 3 deletions
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 {
                  }
              }