redox/recipes/wip/net/onion-routing/arti/redox.patch
Niel Duysters 787ed7e503 Make Arti work on Redox
Several steps were required to get Arti to work on Redox:
- Disable harden feature to resolve secmem-proc issue
- Static link sqlite inside Arti
- Patch to resolve "try_lock() not supported"

With these changes Arti can be used on Redox. If it's called with argument `--disable-fs-permission-checks` since `/home` permissions do not restrict groups to write.

TODOs added to revisit later:
- Check if `redox.patch` is still required after planned Rust toolchain update.
- Instead of `static-sqlite` use our own linked `sqlite3` once that is fully functional.
2026-11-04 05:02:53 +01:00

39 lines
1.5 KiB
Diff

diff --git a/crates/fslock-guard/Cargo.toml b/crates/fslock-guard/Cargo.toml
index 9cbffb2c..2fd42d35 100644
--- a/crates/fslock-guard/Cargo.toml
+++ b/crates/fslock-guard/Cargo.toml
@@ -24,2 +24,2 @@
-[target.'cfg(target_os = "android")'.dependencies]
+[target.'cfg(any(target_os = "android", target_os = "redox"))'.dependencies]
libc = "0.2"
diff --git a/crates/fslock-guard/src/lib.rs b/crates/fslock-guard/src/lib.rs
index b5e938bb..7c32168c 100644
--- a/crates/fslock-guard/src/lib.rs
+++ b/crates/fslock-guard/src/lib.rs
@@ -177,7 +177,7 @@ impl Drop for LockFileGuard {
/// Try to lock `f`, blocking if need be.
///
/// On non-android, this just calls [`fs::File::lock`].
-#[cfg(not(target_os = "android"))]
+#[cfg(not(any(target_os = "android", target_os = "redox")))]
fn do_lock(f: &fs::File) -> std::io::Result<()> {
f.lock()
}
@@ -185,7 +185,7 @@ fn do_lock(f: &fs::File) -> std::io::Result<()> {
/// Try to lock `f`, without blocking.
///
/// On non-android, this just calls [`fs::File::try_lock`].
-#[cfg(not(target_os = "android"))]
+#[cfg(not(any(target_os = "android", target_os = "redox")))]
fn do_try_lock(f: &fs::File) -> Result<(), std::fs::TryLockError> {
f.try_lock()
}
@@ -207,2 +207,2 @@
-#[cfg(target_os = "android")]
+#[cfg(any(target_os = "android", target_os = "redox"))]
fn do_lock(f: &fs::File) -> std::io::Result<()> {
@@ -234,2 +234,2 @@
-#[cfg(target_os = "android")]
+#[cfg(any(target_os = "android", target_os = "redox"))]
fn do_try_lock(f: &fs::File) -> Result<(), std::fs::TryLockError> {