Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

ci(desktop): decouple desktop-only native code from mobile release gates (#8441)

Eric Hayes6c21ee1a474e
diff --git a/.github/workflows/ios-app-store-release.yml b/.github/workflows/ios-app-store-release.yml
index 707cdbef6d..e6c12f03be 100644
--- a/.github/workflows/ios-app-store-release.yml
+++ b/.github/workflows/ios-app-store-release.yml
@@ -43,24 +43,29 @@ jobs:
run: |
# --- native tree ------------------------------------------------------------
# Hash identifying "the iOS native code" at a commit: every tracked blob under
- # apps/web/tauri except the paths that never reach the iOS binary. Android-only
- # code is recognised by Tauri's naming convention — a path component that is
- # `android`, starts with `android_` / `android.`, or contains `.android.`
- # (the android_* plugins, every android/ directory, android.rs / android.json,
- # android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
- # cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. Plus one thing outside that tree: the version of the client cache
- # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
- # cache crates natively, and the team bumps that version when a cache change
- # must ship, so the bump — not every edit under crates/client — is the native
- # signal. The release stamps uploaded builds with the hash, the merge gate
- # compares the live build's stamp against the merge result's, and the drift /
- # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/tauri except the paths that never reach the iOS binary, recognised
+ # by the same naming convention the Android gate uses (android-native.mjs,
+ # which excludes iOS/macOS/linux/windows/apple/desktop-named paths): a path
+ # component that is `android`, `macos`, `linux`, `windows` or `desktop`,
+ # starts with that name plus `_`, `.` or `-`, or an extension-style
+ # `.android.` / `.macos.` / `.linux.` / `.windows.` infix (the android_*
+ # plugins, tauri.android.conf.json and tauri.macos.conf.json, desktop_update
+ # and the desktop_* modules, linux_notification, the macos icons; the Rust
+ # ones are all behind cfg(target_os) / cfg(desktop)) — plus the desktop
+ # updater manifest and editor config. `apple`/`ios` paths stay included:
+ # gen/apple is the Xcode project. Plus one thing outside that tree: the
+ # version of the client cache wasm package
+ # (crates/client/cache-wasm/Cargo.toml). The app compiles the cache crates
+ # natively, and the team bumps that version when a cache change must ship, so
+ # the bump — not every edit under crates/client — is the native signal. The
+ # release stamps uploaded builds with the hash, the merge gate compares the
+ # live build's stamp against the merge result's, and the drift / head guards
+ # compare commits with it. Must match nativeTreeHash() in
# apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
# detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
- export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
# (--full-tree: ls-tree otherwise narrows its output to the current directory,
@@ -341,24 +346,29 @@ jobs:
run: |
# --- native tree ------------------------------------------------------------
# Hash identifying "the iOS native code" at a commit: every tracked blob under
- # apps/web/tauri except the paths that never reach the iOS binary. Android-only
- # code is recognised by Tauri's naming convention — a path component that is
- # `android`, starts with `android_` / `android.`, or contains `.android.`
- # (the android_* plugins, every android/ directory, android.rs / android.json,
- # android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
- # cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. Plus one thing outside that tree: the version of the client cache
- # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
- # cache crates natively, and the team bumps that version when a cache change
- # must ship, so the bump — not every edit under crates/client — is the native
- # signal. The release stamps uploaded builds with the hash, the merge gate
- # compares the live build's stamp against the merge result's, and the drift /
- # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/tauri except the paths that never reach the iOS binary, recognised
+ # by the same naming convention the Android gate uses (android-native.mjs,
+ # which excludes iOS/macOS/linux/windows/apple/desktop-named paths): a path
+ # component that is `android`, `macos`, `linux`, `windows` or `desktop`,
+ # starts with that name plus `_`, `.` or `-`, or an extension-style
+ # `.android.` / `.macos.` / `.linux.` / `.windows.` infix (the android_*
+ # plugins, tauri.android.conf.json and tauri.macos.conf.json, desktop_update
+ # and the desktop_* modules, linux_notification, the macos icons; the Rust
+ # ones are all behind cfg(target_os) / cfg(desktop)) — plus the desktop
+ # updater manifest and editor config. `apple`/`ios` paths stay included:
+ # gen/apple is the Xcode project. Plus one thing outside that tree: the
+ # version of the client cache wasm package
+ # (crates/client/cache-wasm/Cargo.toml). The app compiles the cache crates
+ # natively, and the team bumps that version when a cache change must ship, so
+ # the bump — not every edit under crates/client — is the native signal. The
+ # release stamps uploaded builds with the hash, the merge gate compares the
+ # live build's stamp against the merge result's, and the drift / head guards
+ # compare commits with it. Must match nativeTreeHash() in
# apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
# detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
- export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
# (--full-tree: ls-tree otherwise narrows its output to the current directory,
diff --git a/.github/workflows/ios-release-drift.yml b/.github/workflows/ios-release-drift.yml
index 86113142ae..398973dadb 100644
--- a/.github/workflows/ios-release-drift.yml
+++ b/.github/workflows/ios-release-drift.yml
@@ -30,24 +30,29 @@ jobs:
run: |
# --- native tree ------------------------------------------------------------
# Hash identifying "the iOS native code" at a commit: every tracked blob under
- # apps/web/tauri except the paths that never reach the iOS binary. Android-only
- # code is recognised by Tauri's naming convention — a path component that is
- # `android`, starts with `android_` / `android.`, or contains `.android.`
- # (the android_* plugins, every android/ directory, android.rs / android.json,
- # android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
- # cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. Plus one thing outside that tree: the version of the client cache
- # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
- # cache crates natively, and the team bumps that version when a cache change
- # must ship, so the bump — not every edit under crates/client — is the native
- # signal. The release stamps uploaded builds with the hash, the merge gate
- # compares the live build's stamp against the merge result's, and the drift /
- # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/tauri except the paths that never reach the iOS binary, recognised
+ # by the same naming convention the Android gate uses (android-native.mjs,
+ # which excludes iOS/macOS/linux/windows/apple/desktop-named paths): a path
+ # component that is `android`, `macos`, `linux`, `windows` or `desktop`,
+ # starts with that name plus `_`, `.` or `-`, or an extension-style
+ # `.android.` / `.macos.` / `.linux.` / `.windows.` infix (the android_*
+ # plugins, tauri.android.conf.json and tauri.macos.conf.json, desktop_update
+ # and the desktop_* modules, linux_notification, the macos icons; the Rust
+ # ones are all behind cfg(target_os) / cfg(desktop)) — plus the desktop
+ # updater manifest and editor config. `apple`/`ios` paths stay included:
+ # gen/apple is the Xcode project. Plus one thing outside that tree: the
+ # version of the client cache wasm package
+ # (crates/client/cache-wasm/Cargo.toml). The app compiles the cache crates
+ # natively, and the team bumps that version when a cache change must ship, so
+ # the bump — not every edit under crates/client — is the native signal. The
+ # release stamps uploaded builds with the hash, the merge gate compares the
+ # live build's stamp against the merge result's, and the drift / head guards
+ # compare commits with it. Must match nativeTreeHash() in
# apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
# detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
- export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
# (--full-tree: ls-tree otherwise narrows its output to the current directory,
diff --git a/.github/workflows/ios-release-watch.yml b/.github/workflows/ios-release-watch.yml
index 9f395328ac..405c100431 100644
--- a/.github/workflows/ios-release-watch.yml
+++ b/.github/workflows/ios-release-watch.yml
@@ -111,24 +111,29 @@ jobs:
run: |
# --- native tree ------------------------------------------------------------
# Hash identifying "the iOS native code" at a commit: every tracked blob under
- # apps/web/tauri except the paths that never reach the iOS binary. Android-only
- # code is recognised by Tauri's naming convention — a path component that is
- # `android`, starts with `android_` / `android.`, or contains `.android.`
- # (the android_* plugins, every android/ directory, android.rs / android.json,
- # android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
- # cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. Plus one thing outside that tree: the version of the client cache
- # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
- # cache crates natively, and the team bumps that version when a cache change
- # must ship, so the bump — not every edit under crates/client — is the native
- # signal. The release stamps uploaded builds with the hash, the merge gate
- # compares the live build's stamp against the merge result's, and the drift /
- # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/tauri except the paths that never reach the iOS binary, recognised
+ # by the same naming convention the Android gate uses (android-native.mjs,
+ # which excludes iOS/macOS/linux/windows/apple/desktop-named paths): a path
+ # component that is `android`, `macos`, `linux`, `windows` or `desktop`,
+ # starts with that name plus `_`, `.` or `-`, or an extension-style
+ # `.android.` / `.macos.` / `.linux.` / `.windows.` infix (the android_*
+ # plugins, tauri.android.conf.json and tauri.macos.conf.json, desktop_update
+ # and the desktop_* modules, linux_notification, the macos icons; the Rust
+ # ones are all behind cfg(target_os) / cfg(desktop)) — plus the desktop
+ # updater manifest and editor config. `apple`/`ios` paths stay included:
+ # gen/apple is the Xcode project. Plus one thing outside that tree: the
+ # version of the client cache wasm package
+ # (crates/client/cache-wasm/Cargo.toml). The app compiles the cache crates
+ # natively, and the team bumps that version when a cache change must ship, so
+ # the bump — not every edit under crates/client — is the native signal. The
+ # release stamps uploaded builds with the hash, the merge gate compares the
+ # live build's stamp against the merge result's, and the drift / head guards
+ # compare commits with it. Must match nativeTreeHash() in
# apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
# detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
- export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
# (--full-tree: ls-tree otherwise narrows its output to the current directory,
diff --git a/.github/workflows/web-app-check-main.yml b/.github/workflows/web-app-check-main.yml
index ad123bfa08..f793d12685 100644
--- a/.github/workflows/web-app-check-main.yml
+++ b/.github/workflows/web-app-check-main.yml
@@ -519,6 +519,17 @@ jobs:
- '!apps/web/tauri/**/android_*/**'
- '!apps/web/tauri/**/android.*'
- '!apps/web/tauri/**/*.android.*'
+ - '!apps/web/tauri/**/macos/**'
+ - '!apps/web/tauri/**/macos_*'
+ - '!apps/web/tauri/**/macos_*/**'
+ - '!apps/web/tauri/**/macos.*'
+ - '!apps/web/tauri/**/*.macos.*'
+ - '!apps/web/tauri/**/linux_*'
+ - '!apps/web/tauri/**/linux_*/**'
+ - '!apps/web/tauri/**/desktop/**'
+ - '!apps/web/tauri/**/desktop_*'
+ - '!apps/web/tauri/**/desktop_*/**'
+ - '!apps/web/tauri/**/desktop.*'
- '!apps/web/tauri/desktop-release.json'
- '!apps/web/tauri/.helix/**'
- id: cache-wasm
@@ -645,24 +656,29 @@ jobs:
run: |
# --- native tree ------------------------------------------------------------
# Hash identifying "the iOS native code" at a commit: every tracked blob under
- # apps/web/tauri except the paths that never reach the iOS binary. Android-only
- # code is recognised by Tauri's naming convention — a path component that is
- # `android`, starts with `android_` / `android.`, or contains `.android.`
- # (the android_* plugins, every android/ directory, android.rs / android.json,
- # android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
- # cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. Plus one thing outside that tree: the version of the client cache
- # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
- # cache crates natively, and the team bumps that version when a cache change
- # must ship, so the bump — not every edit under crates/client — is the native
- # signal. The release stamps uploaded builds with the hash, the merge gate
- # compares the live build's stamp against the merge result's, and the drift /
- # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/tauri except the paths that never reach the iOS binary, recognised
+ # by the same naming convention the Android gate uses (android-native.mjs,
+ # which excludes iOS/macOS/linux/windows/apple/desktop-named paths): a path
+ # component that is `android`, `macos`, `linux`, `windows` or `desktop`,
+ # starts with that name plus `_`, `.` or `-`, or an extension-style
+ # `.android.` / `.macos.` / `.linux.` / `.windows.` infix (the android_*
+ # plugins, tauri.android.conf.json and tauri.macos.conf.json, desktop_update
+ # and the desktop_* modules, linux_notification, the macos icons; the Rust
+ # ones are all behind cfg(target_os) / cfg(desktop)) — plus the desktop
+ # updater manifest and editor config. `apple`/`ios` paths stay included:
+ # gen/apple is the Xcode project. Plus one thing outside that tree: the
+ # version of the client cache wasm package
+ # (crates/client/cache-wasm/Cargo.toml). The app compiles the cache crates
+ # natively, and the team bumps that version when a cache change must ship, so
+ # the bump — not every edit under crates/client — is the native signal. The
+ # release stamps uploaded builds with the hash, the merge gate compares the
+ # live build's stamp against the merge result's, and the drift / head guards
+ # compare commits with it. Must match nativeTreeHash() in
# apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
# detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
- export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
# (--full-tree: ls-tree otherwise narrows its output to the current directory,
diff --git a/apps/web/scripts/android-native.mjs b/apps/web/scripts/android-native.mjs
index bdcb2234d1..793cdaa08e 100644
--- a/apps/web/scripts/android-native.mjs
+++ b/apps/web/scripts/android-native.mjs
@@ -13,7 +13,7 @@
// the team bumps that version when a cache change must ship, so the bump
// counts as a native change while other edits under crates/client do not.
// The iOS gate (tooling/xtask/.../scripts/ios_native_tree.sh) is the mirror
-// image, excluding Android-only paths instead.
+// image, excluding Android-only and desktop-only paths instead.
import { execFileSync } from 'node:child_process';
import { resolve } from 'node:path';
diff --git a/apps/web/scripts/ios-app-store.mjs b/apps/web/scripts/ios-app-store.mjs
index bfa8f736c6..082b500b8e 100644
--- a/apps/web/scripts/ios-app-store.mjs
+++ b/apps/web/scripts/ios-app-store.mjs
@@ -131,17 +131,21 @@ const WITHDRAWABLE_SUBMISSION_STATES = new Set([
const BOOLEAN_FLAGS = new Set(["require-live", "require-unused-build"]);
/// "The native code": every tracked blob under this directory except what
-/// never reaches the iOS binary — anything Android-only by Tauri's naming
-/// convention (a path component `android`, `android_*`, `android.*` or
-/// `*.android.*`), the desktop updater manifest, editor config — plus the
-/// version of the client cache wasm package, which the team bumps when a
-/// cache change must ship (the app compiles the cache crates natively). Must
-/// match `native_tree_hash` in
+/// never reaches the iOS binary — anything Android-only or desktop-only by
+/// Tauri's naming convention (a path component `android`, `macos`, `linux`,
+/// `windows` or `desktop`, that name plus `_`, `.` or `-`, or a `*.android.*`
+/// / `*.macos.*` / `*.linux.*` / `*.windows.*` infix; all behind
+/// cfg(target_os) / cfg(desktop)), the desktop updater manifest, editor
+/// config — plus the version of the client cache wasm package, which the team
+/// bumps when a cache change must ship (the app compiles the cache crates
+/// natively). `apple`/`ios` paths stay included: gen/apple is the Xcode
+/// project. Must match `native_tree_hash` in
/// tooling/xtask/.../workflows/scripts/ios_native_tree.sh and the iOS Native
/// Check's change detection.
const NATIVE_TREE_PATH = "apps/web/tauri";
const CACHE_WASM_MANIFEST = "crates/client/cache-wasm/Cargo.toml";
-const NATIVE_TREE_EXCLUDE = /(^|\/)android([_.\/]|$)|\.android\.|^desktop-release\.json$|^\.helix\//;
+const NATIVE_TREE_EXCLUDE =
+ /(^|\/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix\//;
const STAMP_RE = /native tree ([0-9a-f]{40})/;
const STAMP_PR_RE = /for PR #(\d+)/;
diff --git a/apps/web/tauri/src-tauri/src/desktop.rs b/apps/web/tauri/src-tauri/src/desktop.rs
new file mode 100644
index 0000000000..095541c32d
--- /dev/null
+++ b/apps/web/tauri/src-tauri/src/desktop.rs
@@ -0,0 +1,10 @@
+//! Modules compiled only into the desktop app.
+//!
+//! Everything under `src/desktop/` is `cfg(desktop)` by construction — the
+//! whole tree hangs off one gated `mod desktop;` in lib.rs — which is what
+//! lets the Android and iOS native-release gates exempt this path by name:
+//! changes here can never reach a mobile binary, so they require no mobile
+//! version bump or store release (see apps/web/scripts/android-native.mjs and
+//! tooling/xtask/.../scripts/ios_native_tree.sh).
+
+pub(crate) mod macrod;
diff --git a/apps/web/tauri/src-tauri/src/macrod.rs b/apps/web/tauri/src-tauri/src/desktop/macrod.rs
similarity index 97%
rename from apps/web/tauri/src-tauri/src/macrod.rs
rename to apps/web/tauri/src-tauri/src/desktop/macrod.rs
index f91bbfa57d..5b9bcb9603 100644
--- a/apps/web/tauri/src-tauri/src/macrod.rs
+++ b/apps/web/tauri/src-tauri/src/desktop/macrod.rs
@@ -189,7 +189,11 @@ fn macrod_path_env() -> String {
/// Locate the macrod binary: an explicit override, the bundled copy next to
/// this executable, the resource directory, then the development `PATH`.
fn macrod_binary(app: &AppHandle) -> Option<PathBuf> {
- let name = if cfg!(windows) { "macrod.exe" } else { "macrod" };
+ let name = if cfg!(windows) {
+ "macrod.exe"
+ } else {
+ "macrod"
+ };
if let Ok(path) = std::env::var("MACROD_PATH") {
let path = PathBuf::from(path);
if path.is_file() {
@@ -218,7 +222,8 @@ fn macrod_binary(app: &AppHandle) -> Option<PathBuf> {
}
fn macrod_command(app: &AppHandle) -> Result<tokio::process::Command, String> {
- let binary = macrod_binary(app).ok_or_else(|| "macrod is not bundled with this build".to_owned())?;
+ let binary =
+ macrod_binary(app).ok_or_else(|| "macrod is not bundled with this build".to_owned())?;
let mut command = tokio::process::Command::new(binary);
command.env("PATH", macrod_path_env());
if crate::AppEnvironment::current() == crate::AppEnvironment::Development {
@@ -270,7 +275,7 @@ pub(crate) struct MacrodSupport {
#[tauri::command]
pub(crate) fn macrod_support(app: AppHandle) -> MacrodSupport {
- let supported = cfg!(desktop) && macrod_binary(&app).is_some();
+ let supported = macrod_binary(&app).is_some();
let default_workspace = app
.path()
.home_dir()
@@ -327,7 +332,10 @@ pub(crate) async fn macrod_start(
command.args(["--scope", scope]);
}
if let Some(allowed) = options.allow_permission_bypass {
- command.args(["--allow-permission-bypass", if allowed { "true" } else { "false" }]);
+ command.args([
+ "--allow-permission-bypass",
+ if allowed { "true" } else { "false" },
+ ]);
}
let mut child = command
.stdin(Stdio::piped())
@@ -431,7 +439,12 @@ pub(crate) async fn macrod_stop(
/// The current snapshot, for a webview that (re)mounted after events fired.
#[tauri::command]
pub(crate) fn macrod_status(state: tauri::State<'_, MacrodState>) -> MacrodStatus {
- state.inner.lock().expect("macrod state lock").status.clone()
+ state
+ .inner
+ .lock()
+ .expect("macrod state lock")
+ .status
+ .clone()
}
/// Kill the child synchronously; the app is exiting and cannot await.
@@ -507,9 +520,6 @@ fn autostart_enabled(app: &AppHandle) -> bool {
/// At app launch: resume the daemon when the user enabled it and a paired
/// config exists, so agents are reachable without opening settings.
pub(crate) fn autostart(app: &AppHandle) {
- if !cfg!(desktop) {
- return;
- }
let app = app.clone();
tauri::async_runtime::spawn(async move {
if !autostart_enabled(&app) || macrod_binary(&app).is_none() {
@@ -534,3 +544,4 @@ pub(crate) fn autostart(app: &AppHandle) {
}
});
}
+
diff --git a/apps/web/tauri/src-tauri/src/lib.rs b/apps/web/tauri/src-tauri/src/lib.rs
index cfeedd8cdc..8473e9405b 100644
--- a/apps/web/tauri/src-tauri/src/lib.rs
+++ b/apps/web/tauri/src-tauri/src/lib.rs
@@ -33,6 +33,8 @@ use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use url::Url;
+#[cfg(desktop)]
+mod desktop;
mod desktop_update;
mod device;
mod diagnostics;
@@ -41,7 +43,6 @@ mod linux_notification;
mod logging;
#[cfg(target_os = "macos")]
mod macos_notification_permission;
-mod macrod;
mod share_target;
mod staged_upload;
#[cfg(desktop)]
@@ -336,7 +337,6 @@ pub fn run() {
.manage(DeepLinkDelivery::default())
.manage(graphql_cache_plugin::CacheState::default())
.manage(IsIpad(is_ipad_device))
- .manage(macrod::MacrodState::default())
.invoke_handler(tauri::generate_handler![
desktop_update::get_native_update_status,
desktop_update::restart_native_update,
@@ -390,12 +390,18 @@ pub fn run() {
read_shared_file_text,
flush_launch_deep_link,
staged_upload::upload_staged_file_to_presigned_url,
- macrod::macrod_support,
- macrod::macrod_detect_agents,
- macrod::macrod_inspect,
- macrod::macrod_start,
- macrod::macrod_stop,
- macrod::macrod_status,
+ #[cfg(desktop)]
+ desktop::macrod::macrod_support,
+ #[cfg(desktop)]
+ desktop::macrod::macrod_detect_agents,
+ #[cfg(desktop)]
+ desktop::macrod::macrod_inspect,
+ #[cfg(desktop)]
+ desktop::macrod::macrod_start,
+ #[cfg(desktop)]
+ desktop::macrod::macrod_stop,
+ #[cfg(desktop)]
+ desktop::macrod::macrod_status,
])
.setup(move |app| {
#[cfg(desktop)]
@@ -420,7 +426,11 @@ pub fn run() {
app.chain(attach_deep_link_handler);
cleanup_stale_staged_files(&app.handle());
- macrod::autostart(&app.handle());
+ #[cfg(desktop)]
+ {
+ app.manage(desktop::macrod::MacrodState::default());
+ desktop::macrod::autostart(&app.handle());
+ }
Ok(())
})
@@ -489,10 +499,11 @@ pub fn run() {
desktop_update::on_exit_requested(app_handle, api)
}
RunEvent::Exit => {
- if let Some(state) = app_handle.try_state::<macrod::MacrodState>() {
+ #[cfg(desktop)]
+ if let Some(state) = app_handle.try_state::<desktop::macrod::MacrodState>() {
// The daemon also exits on its own when its stdin pipe
// closes with this process; the kill is the fast path.
- macrod::kill_now(&state);
+ desktop::macrod::kill_now(&state);
}
if let Some(state) = app_handle.try_state::<graphql_cache_plugin::CacheState>() {
state
diff --git a/apps/web/tauri/src-tauri/tauri.android.conf.json b/apps/web/tauri/src-tauri/tauri.android.conf.json
index 8617cd1127..66e056e0c7 100644
--- a/apps/web/tauri/src-tauri/tauri.android.conf.json
+++ b/apps/web/tauri/src-tauri/tauri.android.conf.json
@@ -2,7 +2,7 @@
"version": "2.5.0",
"bundle": {
"android": {
- "versionCode": 9
+ "versionCode": 10
}
},
"$schema": "https://schema.tauri.app/config/2",
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh
index 92db084f7c..4ce0161d2e 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh
@@ -1,23 +1,28 @@
# --- native tree ------------------------------------------------------------
# Hash identifying "the iOS native code" at a commit: every tracked blob under
-# apps/web/tauri except the paths that never reach the iOS binary. Android-only
-# code is recognised by Tauri's naming convention — a path component that is
-# `android`, starts with `android_` / `android.`, or contains `.android.`
-# (the android_* plugins, every android/ directory, android.rs / android.json,
-# android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
-# cfg(target_os = "android")) — plus the desktop updater manifest and editor
-# config. Plus one thing outside that tree: the version of the client cache
-# wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
-# cache crates natively, and the team bumps that version when a cache change
-# must ship, so the bump — not every edit under crates/client — is the native
-# signal. The release stamps uploaded builds with the hash, the merge gate
-# compares the live build's stamp against the merge result's, and the drift /
-# head guards compare commits with it. Must match nativeTreeHash() in
+# apps/web/tauri except the paths that never reach the iOS binary, recognised
+# by the same naming convention the Android gate uses (android-native.mjs,
+# which excludes iOS/macOS/linux/windows/apple/desktop-named paths): a path
+# component that is `android`, `macos`, `linux`, `windows` or `desktop`,
+# starts with that name plus `_`, `.` or `-`, or an extension-style
+# `.android.` / `.macos.` / `.linux.` / `.windows.` infix (the android_*
+# plugins, tauri.android.conf.json and tauri.macos.conf.json, desktop_update
+# and the desktop_* modules, linux_notification, the macos icons; the Rust
+# ones are all behind cfg(target_os) / cfg(desktop)) — plus the desktop
+# updater manifest and editor config. `apple`/`ios` paths stay included:
+# gen/apple is the Xcode project. Plus one thing outside that tree: the
+# version of the client cache wasm package
+# (crates/client/cache-wasm/Cargo.toml). The app compiles the cache crates
+# natively, and the team bumps that version when a cache change must ship, so
+# the bump — not every edit under crates/client — is the native signal. The
+# release stamps uploaded builds with the hash, the merge gate compares the
+# live build's stamp against the merge result's, and the drift / head guards
+# compare commits with it. Must match nativeTreeHash() in
# apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
# detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
-export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
+export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
# (--full-tree: ls-tree otherwise narrows its output to the current directory,
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs
index 3cc2d5afd3..5fc0cac78e 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs
@@ -96,6 +96,13 @@ fn paths_filter() -> Step<Use> {
.add_with(("predicate-quantifier", "every"))
.add_with((
"filters",
+ // Mirror NATIVE_TREE_EXCLUDE in scripts/ios_native_tree.sh: paths
+ // named for another platform (android, macos, linux, windows,
+ // desktop) never reach the iOS binary. The generator rejects
+ // globs that match nothing, so only the shapes present in the
+ // tree today are listed; when a file in a new shape appears
+ // (e.g. the first windows_* module), extend this list to keep it
+ // in step with the regex.
indoc::indoc! {"
ios_native:
- 'apps/web/tauri/**'
@@ -104,6 +111,17 @@ fn paths_filter() -> Step<Use> {
- '!apps/web/tauri/**/android_*/**'
- '!apps/web/tauri/**/android.*'
- '!apps/web/tauri/**/*.android.*'
+ - '!apps/web/tauri/**/macos/**'
+ - '!apps/web/tauri/**/macos_*'
+ - '!apps/web/tauri/**/macos_*/**'
+ - '!apps/web/tauri/**/macos.*'
+ - '!apps/web/tauri/**/*.macos.*'
+ - '!apps/web/tauri/**/linux_*'
+ - '!apps/web/tauri/**/linux_*/**'
+ - '!apps/web/tauri/**/desktop/**'
+ - '!apps/web/tauri/**/desktop_*'
+ - '!apps/web/tauri/**/desktop_*/**'
+ - '!apps/web/tauri/**/desktop.*'
- '!apps/web/tauri/desktop-release.json'
- '!apps/web/tauri/.helix/**'
"},