From 1e106d5155b8426ee669539fd2951e3ae4f86d5d Mon Sep 17 00:00:00 2001 From: Niel Duysters Date: Tue, 27 Oct 2026 02:54:57 +0100 Subject: [PATCH] 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. --- config/x86_64/ci.toml | 1 + recipes/wip/archives/7zip/recipe.toml | 2 +- .../wip/net/onion-routing/arti/recipe.toml | 10 ++++- .../wip/net/onion-routing/arti/redox.patch | 38 +++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 recipes/wip/net/onion-routing/arti/redox.patch diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index e129c7432..a06aa9087 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -29,6 +29,7 @@ xfce4-full = {} acid = {} adwaita-icon-theme = {} +arti = {} atk = {} autoconf = {} automake = {} diff --git a/recipes/wip/archives/7zip/recipe.toml b/recipes/wip/archives/7zip/recipe.toml index 1bab446bf..a11ee01a6 100644 --- a/recipes/wip/archives/7zip/recipe.toml +++ b/recipes/wip/archives/7zip/recipe.toml @@ -1,5 +1,5 @@ #TODO add script for gnu make: https://github.com/ip7z/7zip/blob/main/DOC/readme.txt#L110 [source] -tar = "https://7-zip.org/a/7z2605-src.tar.xz" +tar = "https://github.com/ip7z/7zip/releases/download/26.05/7z2605-src.tar.xz" [build] template = "cmake" diff --git a/recipes/wip/net/onion-routing/arti/recipe.toml b/recipes/wip/net/onion-routing/arti/recipe.toml index 4135fd70d..de1decac9 100644 --- a/recipes/wip/net/onion-routing/arti/recipe.toml +++ b/recipes/wip/net/onion-routing/arti/recipe.toml @@ -1,9 +1,17 @@ -#TODO fix secmem-proc crate [source] git = "https://gitlab.torproject.org/tpo/core/arti" +rev = "arti-v2.7.0" shallow_clone = true +# TODO: Check if this patch is still necessary after +# we've updated our Rust toolchains on Redox. +patches = ["redox.patch"] [build] template = "cargo" +# TODO: Remove `static-sqlite` feature once Redox' sqlite3-package is fully functional. +cargoflags = [ + "--no-default-features", + "--features=default-runtime,dns-proxy,compression,bridge-client,pt-client,onion-service-client,vanguards,flowctl-cc,static-sqlite", +] cargopackages = ["arti"] dependencies = [ "openssl3", diff --git a/recipes/wip/net/onion-routing/arti/redox.patch b/recipes/wip/net/onion-routing/arti/redox.patch new file mode 100644 index 000000000..0ad0ca567 --- /dev/null +++ b/recipes/wip/net/onion-routing/arti/redox.patch @@ -0,0 +1,38 @@ +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> {