From ef894ae6b8ce44c5f6ffd62ba23f22a5acc4f206 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 28 Oct 2026 00:14:57 +0000 Subject: [PATCH] Fix platform-gated imports for Windows and wasm builds --- crates/automation/src/dispatch.rs | 3 +++ crates/js/src/formcalc/access.rs | 6 ++++-- crates/render/src/raster/pool.rs | 8 +++++--- crates/ui-egui/src/app/input.rs | 4 +++- crates/ui-egui/src/workflows/combine_ui/parts.rs | 4 +++- crates/ui-egui/src/workflows/combine_ui/session.rs | 4 +++- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/crates/automation/src/dispatch.rs b/crates/automation/src/dispatch.rs index 9ccd18c558..8d8d139d74 100644 --- a/crates/automation/src/dispatch.rs +++ b/crates/automation/src/dispatch.rs @@ -1,6 +1,9 @@ use super::error::{Result, ToolError, failed}; use super::json::{Args, document_attachment_keys, info, one_based, parse_style_ranges, security, summary}; use super::paths::{read_input, write_atomic}; +// The digital-ID listing tools are macOS (Keychain) and Windows (certificate store) only. +#[cfg(any(target_os = "macos", target_os = "windows"))] +use super::signing; use super::{Arc, Automation, Edit, Value, block_overlapping, comments, json, tools}; /// One piece of a tool's result. diff --git a/crates/js/src/formcalc/access.rs b/crates/js/src/formcalc/access.rs index bffbd8823d..bea902c752 100644 --- a/crates/js/src/formcalc/access.rs +++ b/crates/js/src/formcalc/access.rs @@ -1,8 +1,10 @@ +#[cfg(not(target_arch = "wasm32"))] +use super::CLOCK_EVERY; use super::ast::{Expr, Idx}; use super::value::{Val, num_text, parse_num}; use super::{ - CLOCK_EVERY, HNode, HashSet, Interp, LIST_TOO_LONG, MAX_LIST, MAX_PARSE_DEPTH, MAX_STEPS, R, RAN_TOO_LONG, child_named, descendants_named, - instances, resolve_som, + HNode, HashSet, Interp, LIST_TOO_LONG, MAX_LIST, MAX_PARSE_DEPTH, MAX_STEPS, R, RAN_TOO_LONG, child_named, descendants_named, instances, + resolve_som, }; impl Interp<'_> { diff --git a/crates/render/src/raster/pool.rs b/crates/render/src/raster/pool.rs index 66a575eaee..6da0c14d42 100644 --- a/crates/render/src/raster/pool.rs +++ b/crates/render/src/raster/pool.rs @@ -1,8 +1,10 @@ use super::{ - Arc, AssertUnwindSafe, AtomicBool, AtomicRenderStats, InterpreterSettings, JoinHandle, Mutex, Ordering, PageRenderer, Pdf, Pixels, Receiver, - RenderCache, RenderConfig, RenderRequest, RenderStats, RenderedPage, RequestFailureKey, RequestKind, ResultReceiver, Stopwatch, SyncSender, - WorkQueue, catch_unwind, finish, panic_message, parse, render_page, sync_channel, take_warnings, warning_settings, + Arc, AssertUnwindSafe, AtomicRenderStats, InterpreterSettings, JoinHandle, Mutex, Ordering, PageRenderer, Pdf, Pixels, RenderCache, RenderConfig, + RenderRequest, RenderStats, RenderedPage, RequestFailureKey, RequestKind, ResultReceiver, Stopwatch, SyncSender, WorkQueue, catch_unwind, finish, + panic_message, parse, render_page, take_warnings, warning_settings, }; +#[cfg(not(target_arch = "wasm32"))] +use super::{AtomicBool, Receiver, sync_channel}; /// How long one page may render before the pool gives up on it (the watchdog). pub const STUCK_AFTER: std::time::Duration = std::time::Duration::from_secs(20); diff --git a/crates/ui-egui/src/app/input.rs b/crates/ui-egui/src/app/input.rs index 953eb4a6eb..cda282e9ed 100644 --- a/crates/ui-egui/src/app/input.rs +++ b/crates/ui-egui/src/app/input.rs @@ -1,4 +1,6 @@ -use super::{GridDrop, GridFile, OpenRequest, PdfCraftApp, open_worker}; +use super::{GridDrop, GridFile, PdfCraftApp}; +#[cfg(not(target_arch = "wasm32"))] +use super::{OpenRequest, open_worker}; /// Read a file dropped on a page grid (see [`GridFile`]). fn read_grid_file((name, source): GridFile) -> Result<(String, Vec), (String, String)> { diff --git a/crates/ui-egui/src/workflows/combine_ui/parts.rs b/crates/ui-egui/src/workflows/combine_ui/parts.rs index 7de66b074d..5cba711a03 100644 --- a/crates/ui-egui/src/workflows/combine_ui/parts.rs +++ b/crates/ui-egui/src/workflows/combine_ui/parts.rs @@ -1,4 +1,6 @@ -use super::{BTreeSet, MAX_FOLDER_DEPTH, MAX_FOLDER_FILES, Ordering, SystemTime}; +use super::{BTreeSet, Ordering, SystemTime}; +#[cfg(not(target_arch = "wasm32"))] +use super::{MAX_FOLDER_DEPTH, MAX_FOLDER_FILES}; /// The PDFs, images and text files in `dir` (and, if `recursive`, the folders inside it, not /// following links), in natural order, at most [`MAX_FOLDER_FILES`]; and whether there were more. diff --git a/crates/ui-egui/src/workflows/combine_ui/session.rs b/crates/ui-egui/src/workflows/combine_ui/session.rs index ad8d2a4029..594b5f745a 100644 --- a/crates/ui-egui/src/workflows/combine_ui/session.rs +++ b/crates/ui-egui/src/workflows/combine_ui/session.rs @@ -1,8 +1,10 @@ +#[cfg(not(target_arch = "wasm32"))] +use super::MAX_FOLDER_FILES; use super::files::{AssessError, Assessed, CombineFile, Incoming, Secret, Snapshot, SortKey, UnlockPrompt, assess}; #[cfg(not(target_arch = "wasm32"))] use super::parts::combinable_in; use super::parts::{Part, items_of, moved_order, natural, parts_of, range_of, title_of}; -use super::{Arc, BTreeSet, CombineTab, HISTORY, MAX_FOLDER_FILES, Modifiers, PdfCraftApp}; +use super::{Arc, BTreeSet, CombineTab, HISTORY, Modifiers, PdfCraftApp}; impl PdfCraftApp { /// Show the Combine files tab (File ▸ Combine files…), opening it if needed.