From ebf324e4644282e71a9d074028b212cf7537efb7 Mon Sep 17 00:00:00 2001 From: Manuel Frischknecht Date: Tue, 23 Jan 2024 22:48:00 +0100 Subject: [PATCH] stratisd: fix build due to unused imports With `rustc` 1.75, many rust project that use `#[deny(warnings)]` stopped building due to unused imports that didn't trigger build failures before for some reason. `stratisd` now also fails to build because of a couple of those, but they have already been fixed upstream in the following two commits: - https://github.com/stratis-storage/stratisd/commit/78440de6e6ed8eab5ddd25dbdfb7804d0698f2a2 - https://github.com/stratis-storage/stratisd/commit/0d1c67f71338d0ee6c1e6aa06f7fd6264ce9a4c5 In the meantime until a new version of `stratisd` is released, this change pulls in those two changes via `fetchpatch`. Co-authored-by: Nick Cao --- pkgs/tools/filesystems/stratisd/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/tools/filesystems/stratisd/default.nix b/pkgs/tools/filesystems/stratisd/default.nix index cd6ee0884637..84a066e838e5 100644 --- a/pkgs/tools/filesystems/stratisd/default.nix +++ b/pkgs/tools/filesystems/stratisd/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , rustPlatform , cargo , rustc @@ -43,6 +44,22 @@ stdenv.mkDerivation rec { }; }; + patches = [ + # Can be removed with the next release after v. 3.6.3 + (fetchpatch { + name = "remove-unused-imports.patch"; + url = "https://github.com/stratis-storage/stratisd/commit/78440de6e6ed8eab5ddd25dbdfb7804d0698f2a2.patch"; + hash = "sha256-RW2nyAWaoIbqrgbhCApQsMXkJWtWoOWL3VO7fIImJgY="; + }) + + # Can be removed with the next release after v. 3.6.3 + (fetchpatch { + name = "flag-import-not-used-in-build-as-test-only.patch"; + url = "https://github.com/stratis-storage/stratisd/commit/0d1c67f71338d0ee6c1e6aa06f7fd6264ce9a4c5.patch"; + hash = "sha256-6Nb8izUqYUirjy0dTFhITxoM/AKoChoc0w6Qm9K6+7I="; + }) + ]; + postPatch = '' substituteInPlace udev/61-stratisd.rules \ --replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \