diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf9952568..a3ee1293f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -209,14 +209,14 @@ jobs: fail-fast: false matrix: settings: - # - platform: macos-latest - # args: --target aarch64-apple-darwin - # target: aarch64-apple-darwin - # artifact_suffix: aarch64-apple-darwin - # - platform: macos-latest - # args: --target x86_64-apple-darwin - # target: x86_64-apple-darwin - # artifact_suffix: x86_64-apple-darwin + - platform: macos-latest + args: --target aarch64-apple-darwin + target: aarch64-apple-darwin + artifact_suffix: aarch64-apple-darwin + - platform: macos-latest + args: --target x86_64-apple-darwin + target: x86_64-apple-darwin + artifact_suffix: x86_64-apple-darwin - platform: ubuntu-22.04 args: --target x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu diff --git a/app/src-tauri/Cargo.lock b/app/src-tauri/Cargo.lock index 0b096f82a..e3d42ac46 100644 --- a/app/src-tauri/Cargo.lock +++ b/app/src-tauri/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "OpenHuman" -version = "0.49.17" +version = "0.49.18" dependencies = [ "anyhow", "chrono", diff --git a/app/src-tauri/src/core_process.rs b/app/src-tauri/src/core_process.rs index 25cfbbe7f..4579d6ddb 100644 --- a/app/src-tauri/src/core_process.rs +++ b/app/src-tauri/src/core_process.rs @@ -280,13 +280,16 @@ pub fn default_core_bin() -> Option { // Sidecar layout: bundle.externalBin("binaries/openhuman") is emitted as // openhuman-(.exe) under app resources. - let mut search_dirs = vec![exe_dir.to_path_buf()]; - #[cfg(target_os = "macos")] - { - if let Some(resources_dir) = exe_dir.parent().map(|p| p.join("Resources")) { - search_dirs.push(resources_dir); + let search_dirs = { + let mut dirs = vec![exe_dir.to_path_buf()]; + #[cfg(target_os = "macos")] + { + if let Some(resources_dir) = exe_dir.parent().map(|p| p.join("Resources")) { + dirs.push(resources_dir); + } } - } + dirs + }; for dir in search_dirs { let Ok(entries) = std::fs::read_dir(&dir) else { diff --git a/src/openhuman/autocomplete/core.rs b/src/openhuman/autocomplete/core.rs index f3cbbc17a..0b1d0afdc 100644 --- a/src/openhuman/autocomplete/core.rs +++ b/src/openhuman/autocomplete/core.rs @@ -4,6 +4,7 @@ use chrono::Utc; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use std::sync::Arc; +#[cfg(target_os = "macos")] use std::sync::Mutex as StdMutex; #[cfg(target_os = "macos")] use std::{ @@ -737,6 +738,7 @@ fn sanitize_suggestion(text: &str) -> String { truncate_tail(&cleaned, MAX_SUGGESTION_CHARS) } +#[cfg_attr(not(target_os = "macos"), allow(unused_variables))] fn show_overflow_badge( kind: &str, suggestion: Option<&str>, diff --git a/src/openhuman/screen_intelligence/capture.rs b/src/openhuman/screen_intelligence/capture.rs index fb4127d90..7eb35eb10 100644 --- a/src/openhuman/screen_intelligence/capture.rs +++ b/src/openhuman/screen_intelligence/capture.rs @@ -1,8 +1,14 @@ -use base64::{engine::general_purpose::STANDARD as BASE64_STANDARD, Engine as _}; use chrono::Utc; + +#[cfg(target_os = "macos")] +use base64::{engine::general_purpose::STANDARD as BASE64_STANDARD, Engine as _}; +#[cfg(target_os = "macos")] use uuid::Uuid; -use super::context::{AppContext, WindowBounds}; +use super::context::AppContext; +#[cfg(target_os = "macos")] +use super::context::WindowBounds; +#[cfg(target_os = "macos")] use super::limits::MAX_SCREENSHOT_BYTES; pub(crate) fn now_ms() -> i64 { @@ -55,6 +61,7 @@ pub(crate) fn capture_screen_image_ref_for_context( #[cfg(not(target_os = "macos"))] { + let _ = context; Err("screen capture is unsupported on this platform".to_string()) } } diff --git a/src/openhuman/service/mock.rs b/src/openhuman/service/mock.rs index 3c7956aba..94bc85589 100644 --- a/src/openhuman/service/mock.rs +++ b/src/openhuman/service/mock.rs @@ -7,6 +7,10 @@ use std::path::{Path, PathBuf}; use crate::openhuman::config::Config; +#[cfg(any( + target_os = "macos", + not(any(target_os = "macos", target_os = "linux", windows)) +))] use super::common::SERVICE_LABEL; use super::{ServiceState, ServiceStatus};