From 1ef31a5586fb26ee3be328c41724c48b58f50504 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Wed, 19 Oct 2022 10:09:16 +0800 Subject: [PATCH 1/2] stratisd: 3.2.2 -> 3.3.0 --- pkgs/tools/filesystems/stratisd/default.nix | 19 ++++------ pkgs/tools/filesystems/stratisd/paths.patch | 42 --------------------- 2 files changed, 8 insertions(+), 53 deletions(-) delete mode 100644 pkgs/tools/filesystems/stratisd/paths.patch diff --git a/pkgs/tools/filesystems/stratisd/default.nix b/pkgs/tools/filesystems/stratisd/default.nix index b37c46c4e2d8..68023a1265e7 100644 --- a/pkgs/tools/filesystems/stratisd/default.nix +++ b/pkgs/tools/filesystems/stratisd/default.nix @@ -4,6 +4,7 @@ , rustPlatform , pkg-config , asciidoc +, ncurses , dbus , cryptsetup , util-linux @@ -23,25 +24,20 @@ stdenv.mkDerivation rec { pname = "stratisd"; - version = "3.2.2"; + version = "3.3.0"; src = fetchFromGitHub { owner = "stratis-storage"; repo = pname; rev = "v${version}"; - hash = "sha256-dNbbKGRLSYVnPdKfxlLIwXNEf7P6EvGbOp8sfpaw38g="; + hash = "sha256-6CCSs359gPwUMQ2SFpxaWHXCjqqgIbvCaPL2zLuYRKg="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; - hash = "sha256-tJT0GKLpZtiQ/AZACkNeC3zgso54k/L03dFI0m1Jbls="; + hash = "sha256-9nE/SFGv1tYyGDdemCahxHlRnLms3eK0r4XQMhQBjSQ="; }; - patches = [ - # Allow overriding BINARIES_PATHS with environment variable at compile time - ./paths.patch - ]; - postPatch = '' substituteInPlace udev/61-stratisd.rules \ --replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \ @@ -61,6 +57,7 @@ stdenv.mkDerivation rec { rust.rustc pkg-config asciidoc + ncurses # tput ]; buildInputs = [ @@ -70,7 +67,7 @@ stdenv.mkDerivation rec { udev ]; - BINARIES_PATHS = lib.makeBinPath ([ + EXECUTABLES_PATHS = lib.makeBinPath ([ xfsprogs thin-provisioning-tools udev @@ -84,8 +81,8 @@ stdenv.mkDerivation rec { coreutils ]); - makeFlags = [ "PREFIX=${placeholder "out"}" ]; - buildFlags = [ "release" "release-min" "docs/stratisd.8" ]; + makeFlags = [ "PREFIX=${placeholder "out"}" "INSTALL=install" ]; + buildFlags = [ "build" "build-min" "docs/stratisd.8" ]; doCheck = true; checkTarget = "test"; diff --git a/pkgs/tools/filesystems/stratisd/paths.patch b/pkgs/tools/filesystems/stratisd/paths.patch deleted file mode 100644 index c63c9eb4a22c..000000000000 --- a/pkgs/tools/filesystems/stratisd/paths.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/src/engine/strat_engine/cmd.rs b/src/engine/strat_engine/cmd.rs -index daaff70f..ed528f7f 100644 ---- a/src/engine/strat_engine/cmd.rs -+++ b/src/engine/strat_engine/cmd.rs -@@ -39,8 +39,6 @@ use crate::{ - // The maximum allowable size of the thinpool metadata device - const MAX_META_SIZE: MetaBlocks = MetaBlocks(255 * ((1 << 14) - 64)); - --const BINARIES_PATHS: [&str; 4] = ["/usr/sbin", "/sbin", "/usr/bin", "/bin"]; -- - /// Find the binary with the given name by looking in likely locations. - /// Return None if no binary was found. - /// Search an explicit list of directories rather than the user's PATH -@@ -49,7 +47,7 @@ const BINARIES_PATHS: [&str; 4] = ["/usr/sbin", "/sbin", "/usr/bin", "/bin"]; - fn find_binary(name: &str) -> Option { - BINARIES_PATHS - .iter() -- .map(|pre| [pre, name].iter().collect::()) -+ .map(|pre| [pre, &name.into()].iter().collect::()) - .find(|path| path.exists()) - } - -@@ -147,6 +145,10 @@ lazy_static! { - .and_then(|mut hm| hm - .remove(CLEVIS) - .and_then(|c| hm.remove(JOSE).map(|j| (c, j)))); -+ static ref BINARIES_PATHS: Vec = match std::option_env!("BINARIES_PATHS") { -+ Some(paths) => std::env::split_paths(paths).collect(), -+ None => ["/usr/sbin", "/sbin", "/usr/bin", "/bin"].iter().map(|p| p.into()).collect(), -+ }; - } - - /// Verify that all binaries that the engine might invoke are available at some -@@ -160,7 +162,7 @@ pub fn verify_binaries() -> StratisResult<()> { - name, - BINARIES_PATHS - .iter() -- .map(|p| format!("\"{}\"", p)) -+ .map(|p| format!("\"{}\"", p.display())) - .collect::>() - .join(", "), - ))), From 36948f3c65496d39c99cb8ef0e84c12265754a6c Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 18 Oct 2022 22:00:12 +0000 Subject: [PATCH 2/2] stratis-cli: 3.2.0 -> 3.3.0 --- pkgs/tools/filesystems/stratis-cli/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/filesystems/stratis-cli/default.nix b/pkgs/tools/filesystems/stratis-cli/default.nix index 145d570b6a8c..066bc0b0d1d7 100644 --- a/pkgs/tools/filesystems/stratis-cli/default.nix +++ b/pkgs/tools/filesystems/stratis-cli/default.nix @@ -6,13 +6,13 @@ python3Packages.buildPythonApplication rec { pname = "stratis-cli"; - version = "3.2.0"; + version = "3.3.0"; src = fetchFromGitHub { owner = "stratis-storage"; repo = pname; - rev = "v${version}"; - hash = "sha256-JQXTzvm4l/pl2T4djZ3HEdDQJdFE+I9doe8Iv5q34kw="; + rev = "refs/tags/v${version}"; + hash = "sha256-tS9kjXE7wn5j13PO8c3C98MpFbgmR4le/PNKoXKPKQg="; }; propagatedBuildInputs = with python3Packages; [