From 4bc4d50685c2d760cd9fb874938001c07ee48563 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 15 Jan 2026 16:30:27 +0000 Subject: [PATCH] rust: remove dead code the system custodian has been made unnecessary with the swift app - we can remove it ## testing everything still builds --- Cargo.lock | 19 -------- Cargo.toml | 2 - rust/parts.nix | 14 ------ rust/system_custodian/Cargo.toml | 47 ------------------ rust/system_custodian/src/bin/main.rs | 4 -- rust/system_custodian/src/lib.rs | 69 --------------------------- 6 files changed, 155 deletions(-) delete mode 100644 rust/system_custodian/Cargo.toml delete mode 100644 rust/system_custodian/src/bin/main.rs delete mode 100644 rust/system_custodian/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index c54f01d1c..301ee9357 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4340,25 +4340,6 @@ dependencies = [ "libc", ] -[[package]] -name = "system_custodian" -version = "0.0.1" -dependencies = [ - "delegate", - "derive_more", - "either", - "extend", - "futures", - "futures-timer", - "impl-trait-for-tuples", - "keccak-const", - "log", - "thiserror 2.0.17", - "tokio", - "tracing-subscriber", - "util", -] - [[package]] name = "tagptr" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index e16c7b677..34339ede2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,6 @@ resolver = "3" members = [ "rust/networking", "rust/exo_pyo3_bindings", - "rust/system_custodian", "rust/util", ] @@ -25,7 +24,6 @@ opt-level = 3 [workspace.dependencies] ## Crate members as common dependencies networking = { path = "rust/networking" } -system_custodian = { path = "rust/system_custodian" } util = { path = "rust/util" } # Proc-macro authoring tools diff --git a/rust/parts.nix b/rust/parts.nix index e00b27c63..f160da8e6 100644 --- a/rust/parts.nix +++ b/rust/parts.nix @@ -81,20 +81,6 @@ config = { packages = { - # The system_custodian binary - system_custodian = craneLib.buildPackage ( - commonArgs - // { - inherit cargoArtifacts; - cargoExtraArgs = "-p system_custodian"; - - meta = { - description = "System custodian daemon for exo"; - mainProgram = "system_custodian"; - }; - } - ); - # Python bindings wheel via maturin exo_pyo3_bindings = craneLib.buildPackage ( commonArgs diff --git a/rust/system_custodian/Cargo.toml b/rust/system_custodian/Cargo.toml deleted file mode 100644 index 46e530b1f..000000000 --- a/rust/system_custodian/Cargo.toml +++ /dev/null @@ -1,47 +0,0 @@ -[package] -name = "system_custodian" -version = { workspace = true } -edition = { workspace = true } -publish = false - -[lib] -doctest = false -name = "system_custodian" -path = "src/lib.rs" - -[[bin]] -path = "src/bin/main.rs" -name = "system_custodian" -doc = false - -[lints] -workspace = true - -[dependencies] -# datastructures -either = { workspace = true } - -# macro dependencies -extend = { workspace = true } -delegate = { workspace = true } -impl-trait-for-tuples = { workspace = true } -derive_more = { workspace = true } - -# async -tokio = { workspace = true, features = ["full"] } -futures = { workspace = true } -futures-timer = { workspace = true } - -# utility dependencies -util = { workspace = true } -thiserror = { workspace = true } -#internment = { workspace = true } -#recursion = { workspace = true } -#generativity = { workspace = true } -#itertools = { workspace = true } -tracing-subscriber = { version = "0.3.19", features = ["default", "env-filter"] } -keccak-const = { workspace = true } - -# tracing/logging -log = { workspace = true } - diff --git a/rust/system_custodian/src/bin/main.rs b/rust/system_custodian/src/bin/main.rs deleted file mode 100644 index 2345c633f..000000000 --- a/rust/system_custodian/src/bin/main.rs +++ /dev/null @@ -1,4 +0,0 @@ -//! TODO: documentation -//! - -fn main() {} diff --git a/rust/system_custodian/src/lib.rs b/rust/system_custodian/src/lib.rs deleted file mode 100644 index cf8562396..000000000 --- a/rust/system_custodian/src/lib.rs +++ /dev/null @@ -1,69 +0,0 @@ -//! This crate defines the logic of, and ways to interact with, Exo's **_System Custodian_** daemon. -//! -//! The **_System Custodian_** daemon is supposed to be a long-living process that precedes the -//! launch of the Exo application, and responsible for ensuring the system (configuration, settings, -//! etc.) is in an appropriate state to facilitate the running of Exo application. -//! The **_System Custodian_** daemon shall expose a [D-Bus](https://www.freedesktop.org/wiki/Software/dbus/) -//! service which Exo application use to _control & query_ it. -//! -//! # Lifecycle -//! When the Exo application starts, it will _wake_ the **_System Custodian_** daemon for the -//! duration of its lifetime, and after it has terminated the daemon will go back to sleep. When -//! the daemon wakes up, it will configure the system into a state suitable for the Exo Application; -//! When the daemon goes to sleep, it will revert those changes as much as it can in case they were -//! destructive to the user's pre-existing configurations. -//! -//! # Responsibilities -//! TODO: these are purely on MacOS, but change to be more broad -//! The **_System Custodian_** daemon is responsible for using System Configuration framework to -//! 1. duplicate the current network set -//! 2. modify existing services to turn on IPv6 if not there -//! 3. remove any bridge services & add any missing services that AREN'T bridge -//! TODO: In the future: -//! 1. run a dummy AWDL service to [allow for macOS peer-to-peer wireless networking](https://yggdrasil-network.github.io/2019/08/19/awdl.html) -//! 2. toggle some GPU/memory configurations to speed up GPU (ask Alex what those configurations are) -//! 3. if we ever decide to provide our **own network interfaces** that abstract over some userland -//! logic, this would be the place to spin that up. -//! -//! Then it will watch the SCDynamicStore for: -//! 1. all __actual__ network interfaces -> collect information on them e.g. their BSD name, MAC -//! address, MTU, IPv6 addresses, etc. -> and set up watchers/notifiers to inform the DBus -//! interface of any changes -//! 2. watch for any __undesirable__ changes to configuration and revert it -//! -//! It should somehow (probably through system sockets and/or BSD interface) trigger IPv6 NDP on -//! each of the interfaces & also listen to/query for any changes on the OS routing cache?? -//! Basically emulate the `ping6 ff02::1%enX` and `ndp -an` commands BUT BETTER!!! -//! 1. all that info should coalesce back to the overall state colleted -> should be queryable -//! over D-Bus -//! TODO: -//! 1. we might potentially add to this step a handshake of some kind...? To ensure that we can -//! ACTUALLY communicate with that machine over that link over e.g. TCP, UDP, etc. Will the -//! handshake require to know Node ID? Will the handshake require heartbeats? Who knows... -//! 2. if we ever decide to write proprietary L2/L3 protocols for quicker communication, -//! e.g. [AF_NDRV](https://www.zerotier.com/blog/how-zerotier-eliminated-kernel-extensions-on-macos/) -//! for raw ethernet frame communication, or even a [custom thunderbolt PCIe driver](https://developer.apple.com/documentation/pcidriverkit/creating-custom-pcie-drivers-for-thunderbolt-devices), -//! then this would be the place to carry out discovery and propper handshakes with devices -//! on the other end of the link. -//! - -// enable Rust-unstable features for convenience -#![feature(trait_alias)] -#![feature(stmt_expr_attributes)] -#![feature(type_alias_impl_trait)] -#![feature(specialization)] -#![feature(unboxed_closures)] -#![feature(const_trait_impl)] -#![feature(fn_traits)] - -pub(crate) mod private { - // sealed traits support - pub trait Sealed {} - impl Sealed for T {} -} - -/// Namespace for all the type/trait aliases used by this crate. -pub(crate) mod alias {} - -/// Namespace for crate-wide extension traits/methods -pub(crate) mod ext {}