From f7afc554f6dcde252923d2ad189a078443226b63 Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Sun, 9 Aug 2026 00:54:48 +0800 Subject: [PATCH] fix(desktop): restore windows deps and gate mac-only test imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding the SIGTERM handler had introduced the cfg(unix) dependency section above five cross-platform dependencies, silently making zip, memmap2, glam, dirs, and skia-safe unix-only — invisible on mac/linux gates, fatal on the windows runner. Only libc belongs in that section. The complex-script test file's shared imports and constant now carry the same macOS gate as every test in it, so linux clippy stops flagging them as dead. --- .../src/backend/skia/complex_script_tests.rs | 6 ++++++ crates/op-host-services/Cargo.toml | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/crates/op-host-native/src/backend/skia/complex_script_tests.rs b/crates/op-host-native/src/backend/skia/complex_script_tests.rs index a39a558b8..ba6e3c2b9 100644 --- a/crates/op-host-native/src/backend/skia/complex_script_tests.rs +++ b/crates/op-host-native/src/backend/skia/complex_script_tests.rs @@ -8,9 +8,15 @@ //! assert against system typefaces, and a bare Linux CI box has no Arabic //! face to resolve. +// Everything below is macOS-gated (see the module note), so the shared +// imports and constant must carry the same gate or non-mac builds flag +// them as unused under -D warnings. +#[cfg(target_os = "macos")] use super::*; +#[cfg(target_os = "macos")] use op_editor_ui::TextLayout; +#[cfg(target_os = "macos")] const SIZE: f32 = 40.0; /// Raw unshaped width — skia's default per-codepoint advances with no diff --git a/crates/op-host-services/Cargo.toml b/crates/op-host-services/Cargo.toml index 59e692dc4..83bdf3304 100644 --- a/crates/op-host-services/Cargo.toml +++ b/crates/op-host-services/Cargo.toml @@ -77,11 +77,6 @@ getrandom = "0.3" hmac = "0.12" sha2 = "0.10" -# Unix signal handling for the online daemon's controlled shutdown. Already in -# the dependency graph transitively; named here so the SIGTERM handler can use -# it directly. Unix-only — the online daemon is a container deployment. -[target.'cfg(unix)'.dependencies] -libc = "0.2" zip = "2" memmap2 = "0.9" glam = { version = "0.29", default-features = false, features = ["std"] } @@ -94,6 +89,12 @@ skia-safe = { version = "0.97.0", default-features = false, features = [ "pdf", ] } +# Unix signal handling for the online daemon's controlled shutdown. Already in +# the dependency graph transitively; named here so the SIGTERM handler can use +# it directly. Unix-only — the online daemon is a container deployment. +[target.'cfg(unix)'.dependencies] +libc = "0.2" + [dev-dependencies] # Controlled collaboration fixtures so the collab_state tests can drive the # real begin -> install -> reject/fail path instead of asserting on a