From f1389c6db114cd863b9b017f9fe36c2bbd107391 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 10 Aug 2024 13:32:46 +0900 Subject: [PATCH] anki: fix for rust 1.80 rust 1.80 requires updating the 'time' crate to at least 0.3.35. That update is already in anki's master branch but it isn't anywhere close to time for a new release, so just bump time and only time manually for our tree. (This also fixes anki-sync-server which usese the same sources/Cargo deps, when removing the patch during the next update it will need to be removed from both files as written in comment) Link: https://github.com/NixOS/nixpkgs/issues/332957 --- pkgs/games/anki/Cargo.lock | 8 ++-- pkgs/games/anki/default.nix | 2 + ...Cargo.lock-update-time-for-rust-1.80.patch | 40 +++++++++++++++++++ pkgs/games/anki/sync-server.nix | 4 ++ 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 pkgs/games/anki/patches/Cargo.lock-update-time-for-rust-1.80.patch diff --git a/pkgs/games/anki/Cargo.lock b/pkgs/games/anki/Cargo.lock index 9219317f2cea..17fb6f4a894c 100644 --- a/pkgs/games/anki/Cargo.lock +++ b/pkgs/games/anki/Cargo.lock @@ -5581,9 +5581,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -5602,9 +5602,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index 5903ec1b5665..e7684b25e636 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -130,6 +130,8 @@ python3.pkgs.buildPythonApplication { ./patches/disable-auto-update.patch ./patches/remove-the-gl-library-workaround.patch ./patches/skip-formatting-python-code.patch + # Also remove from anki/sync-server.nix on next update + ./patches/Cargo.lock-update-time-for-rust-1.80.patch ]; inherit cargoDeps yarnOfflineCache; diff --git a/pkgs/games/anki/patches/Cargo.lock-update-time-for-rust-1.80.patch b/pkgs/games/anki/patches/Cargo.lock-update-time-for-rust-1.80.patch new file mode 100644 index 000000000000..58b6fc6f8d63 --- /dev/null +++ b/pkgs/games/anki/patches/Cargo.lock-update-time-for-rust-1.80.patch @@ -0,0 +1,40 @@ +From 66d9c405bfe7cb431cc52a7aec038068b364f034 Mon Sep 17 00:00:00 2001 +From: Dominique Martinet +Date: Sat, 10 Aug 2024 13:05:26 +0900 +Subject: [PATCH] Cargo.lock: update time for rust 1.80 + +--- + Cargo.lock | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 9219317f2cea..17fb6f4a894c 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -5581,9 +5581,9 @@ dependencies = [ + + [[package]] + name = "time" +-version = "0.3.34" ++version = "0.3.36" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" ++checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" + dependencies = [ + "deranged", + "itoa", +@@ -5602,9 +5602,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + + [[package]] + name = "time-macros" +-version = "0.2.17" ++version = "0.2.18" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" ++checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" + dependencies = [ + "num-conv", + "time-core", +-- +2.45.2 + diff --git a/pkgs/games/anki/sync-server.nix b/pkgs/games/anki/sync-server.nix index 248d3f34a06a..5900016c0b2b 100644 --- a/pkgs/games/anki/sync-server.nix +++ b/pkgs/games/anki/sync-server.nix @@ -13,6 +13,10 @@ rustPlatform.buildRustPackage { pname = "anki-sync-server"; inherit (anki) version src cargoLock; + patches = [ + ./patches/Cargo.lock-update-time-for-rust-1.80.patch + ]; + # only build sync server cargoBuildFlags = [ "--bin"