From 445b1e905e056fde364e5054af12a891e6335036 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Thu, 7 Mar 2024 18:11:53 +0200 Subject: [PATCH] Switch back to fs2 due to macOS allocation bug --- Cargo.lock | 4 ++-- crates/subspace-farmer-components/Cargo.toml | 3 ++- crates/subspace-farmer-components/src/file_ext.rs | 2 +- crates/subspace-networking/Cargo.toml | 3 ++- .../subspace-networking/src/behavior/persistent_parameters.rs | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 814cc0706a..105e691440 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11656,7 +11656,7 @@ dependencies = [ "backoff", "bitvec", "criterion", - "fs4 0.8.0", + "fs2", "futures", "hex", "libc", @@ -11763,7 +11763,7 @@ dependencies = [ "derive_more", "either", "event-listener-primitives", - "fs4 0.8.0", + "fs2", "futures", "futures-timer", "hex", diff --git a/crates/subspace-farmer-components/Cargo.toml b/crates/subspace-farmer-components/Cargo.toml index 73aeac732d..5157473ded 100644 --- a/crates/subspace-farmer-components/Cargo.toml +++ b/crates/subspace-farmer-components/Cargo.toml @@ -20,7 +20,8 @@ async-lock = "3.3.0" async-trait = "0.1.77" backoff = { version = "0.4.0", features = ["futures", "tokio"] } bitvec = "1.0.1" -fs4 = "0.8.0" +# TODO: Switch to fs4 once https://github.com/al8n/fs4-rs/issues/15 is resolved +fs2 = "0.4.3" futures = "0.3.29" hex = "0.4.3" libc = "0.2.152" diff --git a/crates/subspace-farmer-components/src/file_ext.rs b/crates/subspace-farmer-components/src/file_ext.rs index 6124d0d4d0..b0ef51da72 100644 --- a/crates/subspace-farmer-components/src/file_ext.rs +++ b/crates/subspace-farmer-components/src/file_ext.rs @@ -109,7 +109,7 @@ impl FileExt for File { if self.size()? == len { return Ok(()); } - fs4::FileExt::allocate(self, len) + fs2::FileExt::allocate(self, len) } #[cfg(target_os = "linux")] diff --git a/crates/subspace-networking/Cargo.toml b/crates/subspace-networking/Cargo.toml index 58b72dccb6..e2a9084a83 100644 --- a/crates/subspace-networking/Cargo.toml +++ b/crates/subspace-networking/Cargo.toml @@ -24,7 +24,8 @@ clap = { version = "4.4.18", features = ["color", "derive"] } derive_more = "0.99.17" either = "1.8.1" event-listener-primitives = "2.0.1" -fs4 = "0.8.0" +# TODO: Switch to fs4 once https://github.com/al8n/fs4-rs/issues/15 is resolved +fs2 = "0.4.3" futures = "0.3.29" futures-timer = "3.0.2" hex = "0.4.3" diff --git a/crates/subspace-networking/src/behavior/persistent_parameters.rs b/crates/subspace-networking/src/behavior/persistent_parameters.rs index edda8e7fa0..5f4e62680b 100644 --- a/crates/subspace-networking/src/behavior/persistent_parameters.rs +++ b/crates/subspace-networking/src/behavior/persistent_parameters.rs @@ -1,7 +1,7 @@ use crate::utils::{AsyncJoinOnDrop, CollectionBatcher, Handler, HandlerFn, PeerAddress}; use async_trait::async_trait; use event_listener_primitives::HandlerId; -use fs4::FileExt; +use fs2::FileExt; use futures::future::{pending, Fuse}; use futures::FutureExt; use libp2p::multiaddr::Protocol;