From 84f82fbadfe65f1bdacd01ce76b16fc9862af3a1 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Fri, 13 Mar 2026 12:52:19 +0100 Subject: [PATCH] fix(shell): gate servo-embed-only modules --- crates/weft-app-shell/src/main.rs | 18 ++++++++++-------- crates/weft-servo-shell/src/main.rs | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/crates/weft-app-shell/src/main.rs b/crates/weft-app-shell/src/main.rs index 0b80ff3..df6c191 100644 --- a/crates/weft-app-shell/src/main.rs +++ b/crates/weft-app-shell/src/main.rs @@ -1,4 +1,6 @@ +#[cfg(feature = "servo-embed")] mod protocols; +#[cfg(feature = "servo-embed")] mod shell_client; #[cfg(feature = "servo-embed")] @@ -34,17 +36,17 @@ fn main() -> anyhow::Result<()> { fn appd_ws_port() -> u16 { if let Ok(runtime_dir) = std::env::var("XDG_RUNTIME_DIR") { let port_file = std::path::PathBuf::from(runtime_dir).join("weft/appd.wsport"); - if let Ok(s) = std::fs::read_to_string(port_file) { - if let Ok(n) = s.trim().parse() { - return n; - } - } - } - if let Ok(s) = std::env::var("WEFT_APPD_WS_PORT") { - if let Ok(n) = s.parse() { + if let Ok(s) = std::fs::read_to_string(port_file) + && let Ok(n) = s.trim().parse() + { return n; } } + if let Ok(s) = std::env::var("WEFT_APPD_WS_PORT") + && let Ok(n) = s.parse() + { + return n; + } 7410 } diff --git a/crates/weft-servo-shell/src/main.rs b/crates/weft-servo-shell/src/main.rs index 5776840..d659cb1 100644 --- a/crates/weft-servo-shell/src/main.rs +++ b/crates/weft-servo-shell/src/main.rs @@ -6,7 +6,9 @@ use anyhow::Context; mod embedder; #[cfg(feature = "servo-embed")] mod keyutils; +#[cfg(feature = "servo-embed")] mod protocols; +#[cfg(feature = "servo-embed")] mod shell_client; fn main() -> anyhow::Result<()> {