From 39fd5e968be29fa0bb1524660add4cd04676f3e4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:41:44 +0000 Subject: [PATCH] chore(deps): update cargo dependencies (#8811) * test(draft): cover conflict wakeup and busy layer * chore(deps): update cargo dependencies --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 159 ++++++++++++++++-- Cargo.toml | 4 +- crates/clash-verge-draft/tests/test_me.rs | 61 ++++++- .../Cargo.toml | 2 +- src-tauri/Cargo.toml | 6 +- 5 files changed, 212 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 65fc3aa64..abb378523 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -469,9 +469,9 @@ dependencies = [ [[package]] name = "backon" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" +checksum = "aa51bf3329e243b4ceebb25fddaa797b3e2d225c733b215548ffd1fa99294d5d" dependencies = [ "fastrand", "gloo-timers", @@ -1202,9 +1202,9 @@ dependencies = [ "tristr", "warp", "webpki-roots", - "windows 0.62.2", + "windows 0.101.0", "windows-service", - "windows-sys 0.61.2", + "windows-sys 0.101.0", "winreg 0.56.0", "zip", ] @@ -3038,9 +3038,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +checksum = "a4460540da666acdb5722b2a62ac47d18f627fcfc0c728d04dc7226b3f6d40a7" dependencies = [ "futures-channel", "futures-core", @@ -6332,9 +6332,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.46" +version = "0.23.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" +checksum = "4ac0e747c10d93d873fd4c50b26ef47ad92d1bfb48f6922003bb514070f6e88c" dependencies = [ "aws-lc-rs", "log", @@ -7270,9 +7270,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.40.4" +version = "0.40.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e80749408e2d8bec0ffa303012cf4e1b3b355f4a09087b4fdf7473680f6a2de" +checksum = "0ebe31c61260d7bc4bfc204a2d096c428a4c9ef59ca48bfa693d17fec4f129ad" dependencies = [ "libc", "memchr", @@ -9457,6 +9457,20 @@ dependencies = [ "windows-numerics 0.3.1", ] +[[package]] +name = "windows" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa86febe1d5f623619e56067e9c6f84c368cf94f9f36df738875a0dc5affd752" +dependencies = [ + "windows-collections 0.101.0", + "windows-core 0.101.0", + "windows-future 0.101.0", + "windows-numerics 0.101.0", + "windows-reference", + "windows-time", +] + [[package]] name = "windows-collections" version = "0.2.0" @@ -9475,6 +9489,15 @@ dependencies = [ "windows-core 0.62.2", ] +[[package]] +name = "windows-collections" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c988c3f56b2a0cf740d2837950f25c43539ea6c004a5244085ce6749e1c61f29" +dependencies = [ + "windows-core 0.101.0", +] + [[package]] name = "windows-core" version = "0.61.2" @@ -9514,6 +9537,19 @@ dependencies = [ "windows-strings 0.100.0", ] +[[package]] +name = "windows-core" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27abecb0bac0f1602c4e0d0c885aca58e9a2a25d852135b96e4d0f9daf989aac" +dependencies = [ + "windows-implement 0.101.0", + "windows-interface 0.101.0", + "windows-link 0.101.0", + "windows-result 0.101.0", + "windows-strings 0.101.0", +] + [[package]] name = "windows-future" version = "0.2.1" @@ -9536,6 +9572,17 @@ dependencies = [ "windows-threading 0.2.1", ] +[[package]] +name = "windows-future" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c1de418ec955682054a08c9a2925719c76af9408397fd89fc7c2418bd3b2551" +dependencies = [ + "windows-core 0.101.0", + "windows-link 0.101.0", + "windows-threading 0.101.0", +] + [[package]] name = "windows-implement" version = "0.60.2" @@ -9558,6 +9605,17 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "windows-implement" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33a7f9008fbe08b219a4d9b2db1ceff71b9ed7f0e02472a3bf2046a2b258f933" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "windows-interface" version = "0.59.3" @@ -9580,6 +9638,17 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "windows-interface" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67d1b654cf5aa8120c8c796fe6c88f0e0407512c341e83ea7bb65b933b596474" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "windows-link" version = "0.1.3" @@ -9598,6 +9667,12 @@ version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b39de7c7fe78858b0144c50c3fc000bab3be17d5e9b85b1053871693c7f7415" +[[package]] +name = "windows-link" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e57b2aae53a240c62b65069a63eaf8d5fa747f5d0d8e670c5210a98847bce4" + [[package]] name = "windows-numerics" version = "0.2.0" @@ -9618,6 +9693,25 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "windows-numerics" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d54e417b9761be91da0ab663a5e393e9e54820e55fa9a1d902b978bda3a71ba" +dependencies = [ + "windows-core 0.101.0", +] + +[[package]] +name = "windows-reference" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a017bb8eab108f37103deaa4eaad24ce324c30c6f72628a59250be24c87466" +dependencies = [ + "windows-core 0.101.0", + "windows-time", +] + [[package]] name = "windows-registry" version = "0.6.1" @@ -9656,6 +9750,15 @@ dependencies = [ "windows-link 0.100.0", ] +[[package]] +name = "windows-result" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a02baed928b12dbc90e3a37d1504af179d275e13427510f6bcded0607c9251a7" +dependencies = [ + "windows-link 0.101.0", +] + [[package]] name = "windows-service" version = "0.8.1" @@ -9694,6 +9797,15 @@ dependencies = [ "windows-link 0.100.0", ] +[[package]] +name = "windows-strings" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3301e29c2a308301e0e84fe4242684b1310864f3e15aba65b4ae41f1a44f7f95" +dependencies = [ + "windows-link 0.101.0", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -9748,6 +9860,15 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "windows-sys" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed2df9f5f458664c87437f6758f0d93085b06433bf66b2b84c23c19f3d2012c" +dependencies = [ + "windows-link 0.101.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -9829,6 +9950,24 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "windows-threading" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e1e41d72a0564ebe2cbb9487ed918acfc71d541683b84816a424dc3c7939592" +dependencies = [ + "windows-link 0.101.0", +] + +[[package]] +name = "windows-time" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186ef23b1710095987bf5281bd19e3669934d4353946f24cbdcfd0ed4f2deff6" +dependencies = [ + "windows-core 0.101.0", +] + [[package]] name = "windows-version" version = "0.1.7" diff --git a/Cargo.toml b/Cargo.toml index dc750f7af..8fe876bf9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ tauri-plugin-clipboard-manager = "2.5.0" parking_lot = "0.13.0" anyhow = "1.0.105" futures = "0.3.34" -loom = "0.7" +loom = "0.7.3" proptest = "1.12.0" chrono = "0.4.45" criterion = { version = "0.8.2", features = ["async_tokio"] } @@ -97,7 +97,7 @@ socket2 = "0.6.5" # *** For Windows platform only *** deelevate = "0.2.0" -windows-sys = { version = "0.61.2", features = [ +windows-sys = { version = "0.101.0", features = [ "Win32_Foundation", "Win32_NetworkManagement_IpHelper", "Win32_Networking_WinSock", diff --git a/crates/clash-verge-draft/tests/test_me.rs b/crates/clash-verge-draft/tests/test_me.rs index af0e403ec..44c95c99e 100644 --- a/crates/clash-verge-draft/tests/test_me.rs +++ b/crates/clash-verge-draft/tests/test_me.rs @@ -1,7 +1,14 @@ -use std::sync::Arc; +use std::{ + pin::pin, + sync::{ + Arc, + atomic::{AtomicBool, Ordering}, + }, + task::{Context, Poll, Wake, Waker}, +}; use clash_verge_draft::{Draft, DraftTransaction}; -use tokio::sync::Notify; +use tokio::sync::{Notify, oneshot}; #[derive(Clone, Debug, Default, PartialEq)] struct Config { @@ -78,6 +85,47 @@ async fn async_update_rejects_a_changed_committed_value() -> anyhow::Result<()> Ok(()) } +#[test] +fn parked_async_update_is_woken_after_optimistic_conflict() { + #[derive(Default)] + struct WakeFlag(AtomicBool); + + impl Wake for WakeFlag { + fn wake(self: Arc) { + self.0.store(true, Ordering::Relaxed); + } + } + + let draft = Draft::new(1); + let (finish, finished) = oneshot::channel(); + let mut owner = pin!(draft.with_data_modify(|value| async move { + finished.await?; + Ok((value + 10, ())) + })); + let mut owner_context = Context::from_waker(Waker::noop()); + assert!(owner.as_mut().poll(&mut owner_context).is_pending()); + + let wake_flag = Arc::new(WakeFlag::default()); + let waker = Waker::from(Arc::clone(&wake_flag)); + let mut waiter_context = Context::from_waker(&waker); + let mut waiter = pin!(draft.with_data_modify(|value| async move { Ok((value + 1, value)) })); + + // The fast retry wakes once before the waiter parks on Notify. + assert!(waiter.as_mut().poll(&mut waiter_context).is_pending()); + assert!(wake_flag.0.swap(false, Ordering::Relaxed), "fast retry did not wake"); + assert!(waiter.as_mut().poll(&mut waiter_context).is_pending()); + assert!(!wake_flag.0.load(Ordering::Relaxed), "waiter did not park"); + + draft.edit_draft(|value| *value = 7); + draft.apply(); + assert!(finish.send(()).is_ok()); + assert!(matches!(owner.as_mut().poll(&mut owner_context), Poll::Ready(Err(_)))); + assert_eq!(**draft.data_arc(), 7); + assert!(wake_flag.0.load(Ordering::Relaxed), "parked waiter was not notified"); + assert!(matches!(waiter.as_mut().poll(&mut waiter_context), Poll::Ready(Ok(7)))); + assert_eq!(**draft.data_arc(), 8); +} + #[test] fn transaction_commits_every_layer() -> anyhow::Result<()> { let first = Draft::new(1_u8); @@ -112,10 +160,15 @@ fn dropped_transaction_rolls_every_layer_back() -> anyhow::Result<()> { #[test] fn transaction_claims_are_exclusive_and_release_partial_claims() -> anyhow::Result<()> { let first = Draft::new(1_u8); - let second = Draft::new(2_u8); + let second = Draft::new(2_u16); let held = DraftTransaction::begin(vec![&second])?; - assert!(DraftTransaction::begin(vec![&first, &second]).is_err()); + let busy = DraftTransaction::begin(vec![&first, &second]) + .err() + .ok_or_else(|| anyhow::anyhow!("transaction claimed an already-held layer"))?; + let layer = std::any::type_name::(); + assert_eq!(busy.layer, layer); + assert!(busy.to_string().contains(layer)); let available = DraftTransaction::begin(vec![&first])?; drop(available); diff --git a/crates/tauri-plugin-clash-verge-sysinfo/Cargo.toml b/crates/tauri-plugin-clash-verge-sysinfo/Cargo.toml index 883a6d951..e855a8842 100644 --- a/crates/tauri-plugin-clash-verge-sysinfo/Cargo.toml +++ b/crates/tauri-plugin-clash-verge-sysinfo/Cargo.toml @@ -12,7 +12,7 @@ parking_lot = { workspace = true } serde = { workspace = true, features = ["derive"] } # sysinfo 0.38.2 conflicts with dark-light # see https://github.com/GuillaumeGomez/sysinfo/issues/1623 -sysinfo = { version = "0.40.4", default-features = false, features = ["network", "system"] } +sysinfo = { version = "0.40.5", default-features = false, features = ["network", "system"] } [target.'cfg(not(windows))'.dependencies] libc = "0.2.191" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 87618160a..a5760618e 100755 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -86,7 +86,7 @@ getrandom = "0.4.3" futures = { workspace = true } gethostname = "1.1.0" tauri-plugin-notification = "2.8.1" -backon = { version = "1.6.0", features = ["tokio-sleep"] } +backon = { version = "1.7.0", features = ["tokio-sleep"] } tauri-plugin-http = "2.9.0" tracing = { workspace = true } tauri-plugin-devtools = { version = "2.2.3", optional = true } @@ -97,7 +97,7 @@ clash_verge_service_ipc = { git = "https://github.com/clash-verge-rev/clash-verg ] } arc-swap = "1.9.5" tokio-rustls = "0.26.6" -rustls = { version = "0.23.46", features = ["ring"] } +rustls = { version = "0.23.47", features = ["ring"] } webpki-roots = "1.0.12" dark-light = "3.0.0" bytes = "1.12.2" @@ -143,7 +143,7 @@ quick-xml = "0.42.0" runas = "=1.2.0" winreg = "0.56.0" windows-service = "0.8.1" -windows = { version = "0.62.2", features = [ +windows = { version = "0.101.0", features = [ "Win32_System_Com", "Win32_System_Ole", "Win32_System_TaskScheduler",