From bc18df47b749e44fdf9b8874ee52ae448b65a9c0 Mon Sep 17 00:00:00 2001 From: Igor Cota Date: Mon, 22 Jan 2024 09:58:34 +0100 Subject: [PATCH 1/3] Do not compile nofile_limit util functions on Windows --- rust/src/util.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/src/util.rs b/rust/src/util.rs index c2f73a7..9aad3bb 100644 --- a/rust/src/util.rs +++ b/rust/src/util.rs @@ -4,12 +4,14 @@ use crate::error::update_last_error; #[no_mangle] +#[cfg(not(target_os = "windows"))] pub unsafe extern "C" fn tor_get_nofile_limit() -> u64 { let nofile_limit = unwrap_or_return!(rlimit::getrlimit(rlimit::Resource::NOFILE), 0); nofile_limit.0 } #[no_mangle] +#[cfg(not(target_os = "windows"))] pub unsafe extern "C" fn tor_set_nofile_limit(limit: u64) -> u64 { unwrap_or_return!(rlimit::increase_nofile_limit(limit), 0) } From b8dcfeffbafa29fa63afd2313646ec8af7701374 Mon Sep 17 00:00:00 2001 From: Igor Cota Date: Mon, 22 Jan 2024 21:22:36 +0100 Subject: [PATCH 2/3] lib.rs: do not import nofile_limit util functions on Windows --- rust/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 017a0a6..a495c62 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -15,7 +15,9 @@ use tor_rtcompat::tokio::TokioNativeTlsRuntime; use tor_rtcompat::BlockOn; pub use crate::error::tor_last_error_message; +#[cfg(not(target_os = "windows"))] pub use crate::util::tor_get_nofile_limit; +#[cfg(not(target_os = "windows"))] pub use crate::util::tor_set_nofile_limit; #[macro_use] From 7c17b059aabbcca0f8378eb8423f916f543bdc15 Mon Sep 17 00:00:00 2001 From: Igor Cota Date: Mon, 22 Jan 2024 21:33:28 +0100 Subject: [PATCH 3/3] Bump to 0.0.2 --- CHANGELOG.md | 6 +++++- pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41cc7d8..2e4f8ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2 + +* Fixed the Windows build. + ## 0.0.1 -* TODO: Describe initial release. +* Initial release. diff --git a/pubspec.yaml b/pubspec.yaml index 3a0faaf..292f264 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: tor description: A multi-platform Flutter plugin for managing a Tor proxy. Based on arti. -version: 0.0.1 +version: 0.0.2 homepage: https://github.com/Foundation-Devices/tor platforms: