From 1d65e2645d7426bdf04a0748744436c3a8f0c074 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 16 Aug 2024 09:21:41 -0700 Subject: [PATCH] cargo-outdated: fix build against Rust 1.80 due to outdated time dependency --- .../tools/rust/cargo-outdated/default.nix | 7 ++- .../tools/rust/cargo-outdated/time.patch | 55 +++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/rust/cargo-outdated/time.patch diff --git a/pkgs/development/tools/rust/cargo-outdated/default.nix b/pkgs/development/tools/rust/cargo-outdated/default.nix index c905825633175..64b7c4a77656c 100644 --- a/pkgs/development/tools/rust/cargo-outdated/default.nix +++ b/pkgs/development/tools/rust/cargo-outdated/default.nix @@ -20,7 +20,12 @@ rustPlatform.buildRustPackage rec { hash = "sha256-+GPP8Mdoc3LsR2puNu3/pzKg4Umvjd7CxivkHC8YxgM="; }; - cargoHash = "sha256-Lkl7F5ZVlYLBeL3tubdMQ4/KbHYd2dD5IJAX9FO0XUg="; + cargoHash = "sha256-8sW4d9qb7psoHuftQweChTPt4upKPEXdnjHSZAPpBHE="; + + # Note: bump `time` dependency to be able to build with rust 1.80, should be removed on the next + # release (see: https://github.com/NixOS/nixpkgs/issues/332957) + # Upstream PR: https://github.com/kbknapp/cargo-outdated/pull/398 + cargoPatches = [ ./time.patch ]; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/development/tools/rust/cargo-outdated/time.patch b/pkgs/development/tools/rust/cargo-outdated/time.patch new file mode 100644 index 0000000000000..6539343123ef6 --- /dev/null +++ b/pkgs/development/tools/rust/cargo-outdated/time.patch @@ -0,0 +1,55 @@ +commit 21e8b5005f62afd9ef804758323f36f3f470e7b0 +Author: Cole Helbling +Date: Fri Aug 16 08:59:30 2024 -0700 + + chore: update time dependency to fix builds against newer Rust versions + +diff --git a/Cargo.lock b/Cargo.lock +index 52014c7..a09df20 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1957,6 +1957,12 @@ dependencies = [ + "winapi", + ] + ++[[package]] ++name = "num-conv" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" ++ + [[package]] + name = "num-traits" + version = "0.2.17" +@@ -2781,13 +2787,14 @@ dependencies = [ + + [[package]] + name = "time" +-version = "0.3.30" ++version = "0.3.36" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" ++checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" + dependencies = [ + "deranged", + "itoa", + "libc", ++ "num-conv", + "num_threads", + "powerfmt", + "serde", +@@ -2803,10 +2810,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + + [[package]] + name = "time-macros" +-version = "0.2.15" ++version = "0.2.18" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" ++checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" + dependencies = [ ++ "num-conv", + "time-core", + ] + +