Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
ci(desktop): build Chromium macOS app in release workflow (#8485)
Eric Hayesb6018fe89f3e
diff --git a/.github/workflows/build_desktop_on_tag.yml b/.github/workflows/build_desktop_on_tag.ymlindex 9b3a81240d..5c18b8e731 100644--- a/.github/workflows/build_desktop_on_tag.yml+++ b/.github/workflows/build_desktop_on_tag.yml@@ -545,6 +545,38 @@ jobs:ficodesign --verify --deep --strict --verbose=2 "$app"+ framework="$app/Contents/Frameworks/Chromium Embedded Framework.framework"+ if [ ! -s "$framework/Chromium Embedded Framework" ]; then+ echo "Signed DMG is missing the Chromium framework" >&2+ exit 1+ fi+ helpers=("$app"/Contents/Frameworks/*.app)+ if [ "${#helpers[@]}" -lt 5 ]; then+ echo "Signed DMG is missing Chromium helper apps" >&2+ exit 1+ fi++ check_cef_entitlements() {+ local bundle="$1"+ local entitlements+ entitlements=$(mktemp)+ codesign -d --entitlements :- "$bundle" > "$entitlements" 2>/dev/null+ for key in \+ com.apple.security.cs.allow-jit \+ com.apple.security.cs.allow-unsigned-executable-memory \+ com.apple.security.cs.disable-library-validation; do+ if [ "$(/usr/libexec/PlistBuddy -c "Print :$key" "$entitlements")" != true ]; then+ echo "$bundle is missing the $key entitlement" >&2+ exit 1+ fi+ done+ rm "$entitlements"+ }+ check_cef_entitlements "$app"+ for helper in "${helpers[@]}"; do+ check_cef_entitlements "$helper"+ done+dylib_refs=$(mktemp)search_roots=("$app/Contents/MacOS")if [ -d "$app/Contents/Frameworks" ]; thendiff --git a/.github/workflows/build_dmg_on_tag.yml b/.github/workflows/build_dmg_on_tag.ymlindex 322c1365e9..288c0ff5c2 100644--- a/.github/workflows/build_dmg_on_tag.yml+++ b/.github/workflows/build_dmg_on_tag.yml@@ -1,7 +1,7 @@# DO NOT EDIT — regenerate with `cargo x workflows` (from the repository root).# Source: tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rsname: Build macOS DMG-'on':+on:workflow_call:inputs:ref:@@ -12,6 +12,15 @@ name: Build macOS DMGPOSTHOG_API_KEY:description: PostHog project API key inlined into the desktop bundlerequired: true+ MACOS_DEVELOPER_ID_CERTIFICATE_BASE64:+ description: Developer ID certificate for signing the macOS app+ required: true+ MACOS_DEVELOPER_ID_CERTIFICATE_PASSWORD:+ description: Password for the Developer ID certificate+ required: true+ MACOS_RELEASE_DOPPLER_TOKEN:+ description: Doppler token for notarizing the macOS DMG+ required: truejobs:build-dmg:name: Build macOS DMG@@ -358,6 +367,38 @@ jobs:ficodesign --verify --deep --strict --verbose=2 "$app"+ framework="$app/Contents/Frameworks/Chromium Embedded Framework.framework"+ if [ ! -s "$framework/Chromium Embedded Framework" ]; then+ echo "Signed DMG is missing the Chromium framework" >&2+ exit 1+ fi+ helpers=("$app"/Contents/Frameworks/*.app)+ if [ "${#helpers[@]}" -lt 5 ]; then+ echo "Signed DMG is missing Chromium helper apps" >&2+ exit 1+ fi++ check_cef_entitlements() {+ local bundle="$1"+ local entitlements+ entitlements=$(mktemp)+ codesign -d --entitlements :- "$bundle" > "$entitlements" 2>/dev/null+ for key in \+ com.apple.security.cs.allow-jit \+ com.apple.security.cs.allow-unsigned-executable-memory \+ com.apple.security.cs.disable-library-validation; do+ if [ "$(/usr/libexec/PlistBuddy -c "Print :$key" "$entitlements")" != true ]; then+ echo "$bundle is missing the $key entitlement" >&2+ exit 1+ fi+ done+ rm "$entitlements"+ }+ check_cef_entitlements "$app"+ for helper in "${helpers[@]}"; do+ check_cef_entitlements "$helper"+ done+dylib_refs=$(mktemp)search_roots=("$app/Contents/MacOS")if [ -d "$app/Contents/Frameworks" ]; thendiff --git a/.github/workflows/ios-app-store-release.yml b/.github/workflows/ios-app-store-release.ymlindex e6c12f03be..018e272865 100644--- a/.github/workflows/ios-app-store-release.yml+++ b/.github/workflows/ios-app-store-release.yml@@ -52,8 +52,8 @@ jobs:# 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+ # updater manifest, editor config and Markdown docs. `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@@ -65,7 +65,7 @@ jobs:# detection (web_app_check_main/ios_native_check.rs).NATIVE_TREE_PATH=apps/web/tauriCACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml- export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|\.md$|^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,@@ -355,8 +355,8 @@ jobs:# 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+ # updater manifest, editor config and Markdown docs. `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@@ -368,7 +368,7 @@ jobs:# detection (web_app_check_main/ios_native_check.rs).NATIVE_TREE_PATH=apps/web/tauriCACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml- export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|\.md$|^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.ymlindex 398973dadb..8c7ae4cd9b 100644--- a/.github/workflows/ios-release-drift.yml+++ b/.github/workflows/ios-release-drift.yml@@ -39,8 +39,8 @@ jobs:# 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+ # updater manifest, editor config and Markdown docs. `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@@ -52,7 +52,7 @@ jobs:# detection (web_app_check_main/ios_native_check.rs).NATIVE_TREE_PATH=apps/web/tauriCACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml- export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|\.md$|^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.ymlindex 405c100431..4e3bd0126e 100644--- a/.github/workflows/ios-release-watch.yml+++ b/.github/workflows/ios-release-watch.yml@@ -120,8 +120,8 @@ jobs:# 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+ # updater manifest, editor config and Markdown docs. `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@@ -133,7 +133,7 @@ jobs:# detection (web_app_check_main/ios_native_check.rs).NATIVE_TREE_PATH=apps/web/tauriCACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml- export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|\.md$|^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.ymlindex f793d12685..01c6fe5708 100644--- a/.github/workflows/web-app-check-main.yml+++ b/.github/workflows/web-app-check-main.yml@@ -527,11 +527,14 @@ jobs:- '!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_*/**'- '!apps/web/tauri/**/desktop.*'- '!apps/web/tauri/desktop-release.json'- '!apps/web/tauri/.helix/**'+ - '!apps/web/tauri/**/*.md'- id: cache-wasmname: Detect a client cache wasm version bumprun: |@@ -665,8 +668,8 @@ jobs:# 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+ # updater manifest, editor config and Markdown docs. `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@@ -678,7 +681,7 @@ jobs:# detection (web_app_check_main/ios_native_check.rs).NATIVE_TREE_PATH=apps/web/tauriCACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml- export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'+ export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|\.md$|^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/AGENTS.md b/apps/web/AGENTS.mdindex 621cfd4298..0cdf895d1c 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -260,15 +260,13 @@ Build and copy the agent-fold JavaScript glue and WASM before Vite runs, andcheck that both appear in the output. Without them, Vite leaves the worker'srelative imports unchanged and Tauri can serve HTML for the missing module.-## macOS desktop runtime: Chromium (CEF), experimental-`tauri/desktop-cef` builds the macOS app with Chromium in its own Cargo workspace;-the shipped builds of every platform still come from `tauri/src-tauri` on the-system webview. See `tauri/desktop-cef/AGENTS.md` before changing Tauri+## macOS desktop runtime: Chromium (CEF)+`tauri/desktop-cef` builds the shipped macOS app with Chromium in its own Cargo+workspace. The macOS release DMG builds this workspace; iOS, Android, Linux,+and Windows still build `tauri/src-tauri` on the system webview. See+`tauri/desktop-cef/AGENTS.md` before changing Tauridependencies or the app's served origin.-## macOS desktop gotcha: third-party iframes-WKWebView asks the desktop navigation plugin about iframe loads as well as page loads, and the plugin cannot tell them apart. A third-party iframe is classified as external: its load is cancelled and the page opens in the browser, leaving an empty frame in the app. List a third-party page the app frames in `EMBEDDED_DOCUMENTS` in `tauri/src-tauri/src/lib.rs`.-## iOS gotcha: Web Workers must be lazyOn iOS WKWebView, eagerly constructing an ES module Web Worker (`new Worker(url, { type: 'module' })`) whose script is served via the `tauri://` custom URL scheme **deadlocks the WebContent process**. The worker thread parks in WebKit's sync module loader waiting for an IPC response that never wakes it; JS execution silently stops after that point.diff --git a/apps/web/docs/ios-releases.md b/apps/web/docs/ios-releases.mdindex e799d18360..f973a61584 100644--- a/apps/web/docs/ios-releases.md+++ b/apps/web/docs/ios-releases.md@@ -126,7 +126,8 @@ Two things:Android-only by Tauri's naming convention (a path component `android`,`android_*`, `android.*` or `*.android.*` — the `android_*` plugins, every`android/` directory, `android.rs`, `tauri.android.conf.json` and so on),- `desktop-release.json`, and `.helix/`.+ `desktop-release.json`, `.helix/`, and Markdown docs. Desktop, macOS,+ Linux, and Windows-only paths are excluded too.- **A bump of the client cache wasm package version** in`crates/client/cache-wasm/Cargo.toml`. The app compiles the cache crates(`crates/client/cache-core`, `cache-turso` and what they pull in)diff --git a/apps/web/scripts/android-native.mjs b/apps/web/scripts/android-native.mjsindex 793cdaa08e..3492beee99 100644--- a/apps/web/scripts/android-native.mjs+++ b/apps/web/scripts/android-native.mjs@@ -8,8 +8,8 @@// the Android binary — iOS, macOS, Linux, Windows and desktop-only paths by// naming convention (a path component or extension naming the platform, the// generated Xcode project under gen/apple, the desktop updater manifest,-// editor config) — plus one thing outside that tree: the version of the-// client cache wasm package. The app compiles the cache crates natively, and+// editor config, Markdown docs) — plus one thing outside that tree: the+// version of the client cache wasm package. The app compiles the cache crates natively, and// 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@@ -22,7 +22,7 @@ import { pathToFileURL } from 'node:url';export const tauriPath = 'apps/web/tauri';export const cacheWasmManifest = 'crates/client/cache-wasm/Cargo.toml';export const androidExclude =- /(^|\/)(ios|macos|linux|windows|apple|desktop)([_./-]|$)|\.(ios|macos|linux|windows)\.|^desktop-release\.json$|^\.helix\//;+ /(^|\/)(ios|macos|linux|windows|apple|desktop)([_./-]|$)|\.(ios|macos|linux|windows)\.|\.md$|^desktop-release\.json$|^\.helix\//;/// A `git` runner bound to a working directory.export function gitIn(cwd) {diff --git a/apps/web/scripts/android-version-check.test.ts b/apps/web/scripts/android-version-check.test.tsindex ec7debbe72..3b12e58eb5 100644--- a/apps/web/scripts/android-version-check.test.ts+++ b/apps/web/scripts/android-version-check.test.ts@@ -151,6 +151,7 @@ describe('PR Android version enforcement', () => {'apps/web/tauri/src-tauri/icons/macos/Macro.icon/icon.json','apps/web/tauri/src-tauri/tauri.macos.conf.json','apps/web/tauri/src-tauri/src/linux_notification.rs',+ 'apps/web/tauri/src-tauri/README.md','apps/web/tauri/desktop-release.json',])('ignores the iOS/desktop-only path %s', (path) => {const base = git('rev-parse', 'HEAD');@@ -201,4 +202,3 @@ describe('PR Android version enforcement', () => {expect(() => checkAndroidVersion({ cwd, base: 'missing-base' })).toThrow();});});-diff --git a/apps/web/scripts/ios-app-store.mjs b/apps/web/scripts/ios-app-store.mjsindex 082b500b8e..5ff7eac1da 100644--- a/apps/web/scripts/ios-app-store.mjs+++ b/apps/web/scripts/ios-app-store.mjs@@ -136,8 +136,8 @@ const BOOLEAN_FLAGS = new Set(["require-live", "require-unused-build"]);/// `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+/// config and Markdown docs — 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@@ -145,7 +145,7 @@ const BOOLEAN_FLAGS = new Set(["require-live", "require-unused-build"]);const NATIVE_TREE_PATH = "apps/web/tauri";const CACHE_WASM_MANIFEST = "crates/client/cache-wasm/Cargo.toml";const NATIVE_TREE_EXCLUDE =- /(^|\/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix\//;+ /(^|\/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|\.md$|^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/src/components/icon/wide-channel.tsx b/apps/web/src/components/icon/wide-channel.tsxindex 235b64743c..1c22bb6bfd 100644--- a/apps/web/src/components/icon/wide-channel.tsx+++ b/apps/web/src/components/icon/wide-channel.tsx@@ -10,7 +10,7 @@// channel-v-right right (right bar separates rightward)//// Built on `transform` (not `d` morphing), so unlike the old version it animates in-// Safari/WebKit too (incl. the macOS Tauri WKWebView).+// Safari/WebKit too (including the iOS Tauri webview).export const AnimatedChannelIcon = (props: {triggerAnimation?: boolean;diff --git a/apps/web/tauri/desktop-cef/AGENTS.md b/apps/web/tauri/desktop-cef/AGENTS.mdindex ae4406f581..1d67c9be56 100644--- a/apps/web/tauri/desktop-cef/AGENTS.md+++ b/apps/web/tauri/desktop-cef/AGENTS.md@@ -1,6 +1,7 @@# desktop-cef-Status: experimental; not built by CI or the release pipeline yet.+Status: shipped macOS desktop app. The desktop release workflow builds it,+packages it as a signed DMG, and publishes the release.## What it is@@ -18,6 +19,9 @@ thin binary over `../src-tauri` (`app_lib::run_with`) that selects## Checks- `RUSTUP_TOOLCHAIN=1.95.0 cargo check --target aarch64-apple-darwin`+- From the repository root on macOS, `nix build --option sandbox false+ .#tauri-desktop-cef-app` builds the unsigned app. Release builds use+ `.#tauri-desktop-dmg` and sign, notarize, and publish that app.- Bundle: build the frontend inside `nix develop` (`just build-tauri` in`apps/web`), then from here run the Tauri CLI built from the `macro-cef`branch of `macro-inc/tauri`:@@ -36,6 +40,12 @@ thin binary over `../src-tauri` (`app_lib::run_with`) that selects`tauri::DynRuntime`. It only compiles in this workspace.- Needs Rust 1.95 (the repo pins 1.94), `cmake`, and `ninja`; the first builddownloads about 1 GB of CEF into `~/Library/Caches/tauri-cef`.+- Nix pins Rust 1.95 and the `macro-cef` Tauri CLI separately for macOS. Keep+ `nix/tauri-desktop.nix` on this workspace and CLI; the stock CLI omits the CEF+ framework and helper apps from macOS bundles.+- Keep `entitlements.plist` on the CEF config and the Nix DMG signing step. The+ release signs the unsigned Nix app after bundling, and Chromium needs the JIT+ entitlements under the hardened runtime.- Keep `tauri.conf.json` aligned with `../src-tauri/tauri.conf.json` and`tauri.macos.conf.json`: the CLI bundles from this file, while the app'sruntime config still comes from `../src-tauri`.diff --git a/apps/web/tauri/desktop-cef/entitlements.plist b/apps/web/tauri/desktop-cef/entitlements.plistnew file mode 100644index 0000000000..f2eb2ecb0a--- /dev/null+++ b/apps/web/tauri/desktop-cef/entitlements.plist@@ -0,0 +1,12 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>com.apple.security.cs.allow-jit</key>+ <true/>+ <key>com.apple.security.cs.allow-unsigned-executable-memory</key>+ <true/>+ <key>com.apple.security.cs.disable-library-validation</key>+ <true/>+</dict>+</plist>diff --git a/apps/web/tauri/desktop-cef/tauri.conf.json b/apps/web/tauri/desktop-cef/tauri.conf.jsonindex 3eb3a9d31e..3f5388cd6a 100644--- a/apps/web/tauri/desktop-cef/tauri.conf.json+++ b/apps/web/tauri/desktop-cef/tauri.conf.json@@ -62,6 +62,7 @@"../src-tauri/icons/macos/Macro.icns"],"macOS": {+ "entitlements": "entitlements.plist","files": {"Resources/Assets.car": "../src-tauri/icons/macos/Assets.car"},diff --git a/apps/web/tauri/src-tauri/README.md b/apps/web/tauri/src-tauri/README.mdindex 9cb69a1ed7..c86a25c150 100644--- a/apps/web/tauri/src-tauri/README.md+++ b/apps/web/tauri/src-tauri/README.md@@ -45,7 +45,8 @@ an increased updater count identifies an app-requested update reload attempt.Dispatch does not prove the JavaScript reload completed. A new native launch IDmeans the host process restarted. Missing counters on an older binary meanunknown, not zero. The properties are also attached to subsequent PostHog events.-Termination reporting is available only on iOS and macOS. On other platforms,+Termination reporting is available on iOS and older macOS WKWebView builds. On+Chromium macOS and other platforms,startup events mark it unavailable and omit termination counts/timestamps evenwhen the native snapshot includes an unused zero-valued counter.@@ -123,9 +124,12 @@ The same tests without that environment variable check for drift.## Running in development```sh-# Desktop shell (macOS/Linux/Windows)+# Linux and Windows desktop shell (from this directory)cargo tauri dev+# macOS desktop shell (from ../desktop-cef, using the macro-cef cargo-tauri CLI)+RUSTUP_TOOLCHAIN=1.95.0 cargo-tauri dev+# iOS simulatorcargo tauri ios dev@@ -215,7 +219,10 @@ document-rendering finding; passing the smoke test is not full iOS 26/27 parity.## Building bundles```sh-# Desktop bundle+# macOS desktop bundle (Chromium; from the repository root)+nix build --option sandbox false .#tauri-desktop-cef-app++# Linux and Windows desktop bundles (system webview; from this directory)cargo tauri build# iOS / Android release artifacts@@ -478,8 +485,11 @@ These are process memory measurements, not JavaScript heap/allocation profiles.RSS and macOS physical footprint have different accounting; sums are explicitlyprocess sums and need not equal Activity Monitor's app total.-macOS sampling uses `proc_pid_rusage`. WebKit helpers are XPC processes, so PPID-alone is insufficient. Attribution resolves the optional private libSystem SPI+macOS sampling uses `proc_pid_rusage`. The sampler recognizes WebKit helpers in+older WKWebView builds; Chromium desktop builds currently report only native+process memory and mark frontend coverage unavailable. WebKit helpers are XPC+processes, so PPID alone is insufficient. Attribution resolves the optional+private libSystem SPI`responsibility_get_pid_responsible_for_pid` at runtime and includes only knownWebKit helpers whose responsible PID is this app. If the SPI, permissions, orattribution are unavailable, frontend coverage is explicitly unavailable. Neverdiff --git a/docs/development/android.md b/docs/development/android.mdindex 7d92342e84..3c21626ec3 100644--- a/docs/development/android.md+++ b/docs/development/android.md@@ -135,8 +135,10 @@ Android releases are driven from pull requests, like iOS (seedeployment cycle. Three generated workflows plus the `Android Native Check`job of the web app PR checks enforce it:-**`Android Native Check`** runs on every PR against `main`. It always-requires a `versionCode` bump when the Android native code changed (see+**`Android Native Check`** runs on every PR against `main`. Its native tree+excludes platform-specific desktop/iOS files and Markdown docs, which do not+ship in the Android binary. It always requires a `versionCode` bump when the+Android native code changed (see"Native release identity" above for what counts), and, when it changed, asksGoogle Play whether that version code is a production release that Googlehas **published** (through review and available to users — the edit API'sdiff --git a/flake.lock b/flake.lockindex 156199515f..f24490d0bb 100644--- a/flake.lock+++ b/flake.lock@@ -141,7 +141,8 @@"flake-parts": "flake-parts","flake-utils": "flake-utils","import-tree": "import-tree",- "nixpkgs": "nixpkgs"+ "nixpkgs": "nixpkgs",+ "tauri-cef": "tauri-cef"}},"rust-analyzer-src": {@@ -175,6 +176,23 @@"repo": "default","type": "github"}+ },+ "tauri-cef": {+ "flake": false,+ "locked": {+ "lastModified": 1792523699,+ "narHash": "sha256-++WQc4YpvoMPBFTuDj//856BguC1ArS6AeLTbIOn38Q=",+ "owner": "macro-inc",+ "repo": "tauri",+ "rev": "285fb6b1cb2fc20666da1688f4c74e240a100035",+ "type": "github"+ },+ "original": {+ "owner": "macro-inc",+ "repo": "tauri",+ "rev": "285fb6b1cb2fc20666da1688f4c74e240a100035",+ "type": "github"+ }}},"root": "root",diff --git a/flake.nix b/flake.nixindex ea8251502f..ed40a997e7 100644--- a/flake.nix+++ b/flake.nix@@ -9,7 +9,11 @@fenix.inputs.nixpkgs.follows = "nixpkgs";crane.url = "github:ipetkov/crane";crane-tauri.url = "github:JPHutchins/crane-tauri";+ tauri-cef = {+ url = "github:macro-inc/tauri/285fb6b1cb2fc20666da1688f4c74e240a100035";+ flake = false;+ };};outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./nix);-}\ No newline at end of file+}diff --git a/nix/tauri-desktop.nix b/nix/tauri-desktop.nixindex be301b7db8..862b511df2 100644--- a/nix/tauri-desktop.nix+++ b/nix/tauri-desktop.nix@@ -47,10 +47,13 @@# (`ios_production_telemetry` in `apps/web/scripts/ios-native-env.sh`);# export either variable and build with `--impure` to send elsewhere.# Export stays behind the `enable-browser-otel` PostHog flag.- envOr = name: fallback:- let value = builtins.getEnv name; in if value == "" then fallback else value;- otelExporterUrl =- envOr "VITE_OTEL_EXPORTER_URL" "https://macro-prox-prod.macroverse.workers.dev/i/otlp/v1/traces";+ envOr =+ name: fallback:+ let+ value = builtins.getEnv name;+ in+ if value == "" then fallback else value;+ otelExporterUrl = envOr "VITE_OTEL_EXPORTER_URL" "https://macro-prox-prod.macroverse.workers.dev/i/otlp/v1/traces";otelEnv = envOr "VITE_OTEL_ENV" "prod";rustToolchain = fenix.packages.${system}.fromToolchainFile {@@ -58,6 +61,12 @@sha256 = "sha256-qqF33vNuAdU5vua96VKVIwuc43j4EFeEXbjQ6+l4mO4=";};craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;+ cefRustToolchain =+ (fenix.packages.${system}.fromToolchainName {+ name = "1.95.0";+ sha256 = "sha256-gh/xTkxKHL4eiRXzWv8KP7vfjSk61Iq48x47BEDFgfk=";+ }).toolchain;+ cefCraneLib = (crane.mkLib pkgs).overrideToolchain cefRustToolchain;jsRoot = ../.;jsSrc = lib.cleanSourceWith {@@ -809,202 +818,311 @@touch "$out"'';};- tauriDesktopDmgConfig = builtins.toJSON (- lib.recursiveUpdate- {- version = appVersion;- plugins = desktopPlugins;- build = {- frontendDist = "${frontend}";- beforeBuildCommand = "";- };- bundle = {- active = true;- targets = [ "app" ];- externalBin = [ "binaries/macrod" ];- };- }- (- lib.optionalAttrs (tauriDesktopDmgSigningIdentity != "") {- bundle.macOS.signingIdentity = tauriDesktopDmgSigningIdentity;+ cefCliVendorDir = cefCraneLib.vendorCargoDeps {+ src = inputs.tauri-cef;+ cargoLock = inputs.tauri-cef + "/Cargo.lock";+ outputHashes = {+ "git+https://github.com/tauri-apps/plugins-workspace?branch=feat/cef#1423992771e0b57582ca3b06a6adc46ec26aa784" =+ "sha256-D2OrQkCjh8VrtWO+/0orsefx47ES8L5eT0AmaDVmoUg=";+ "git+https://github.com/tauri-apps/winit-gtk4?branch=master#3d7c7cd19d3c752f75762ceea535444e63bdf8de" =+ "sha256-2mFNnZcPnVqPQ2iakMoXSKXrlHiIv+HuQZ7iOwtrKb4=";+ };+ };+ cefTauriCli = cefCraneLib.mkCargoDerivation {+ pname = "cargo-tauri-cef";+ version = "2.11.4";+ src = inputs.tauri-cef;+ cargoArtifacts = null;+ cargoVendorDir = cefCliVendorDir;+ cargoLock = inputs.tauri-cef + "/Cargo.lock";+ nativeBuildInputs = [ pkgs.pkg-config ];+ buildInputs = [+ pkgs.openssl+ pkgs.libiconv+ ];+ CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER = tauriDesktopDmgAppleLinker;+ doCheck = false;+ buildPhaseCargoCommand = "cargo build --release -p tauri-cli";+ installPhaseCommand = ''+ install -Dm0755 target/release/cargo-tauri "$out/bin/cargo-tauri"+ '';+ doInstallCargoArtifacts = false;+ };+ cefCargoVendorDir = cefCraneLib.vendorCargoDeps {+ src = ../apps/web/tauri/desktop-cef;+ cargoLock = ../apps/web/tauri/desktop-cef/Cargo.lock;+ outputHashes = {+ "git+https://github.com/macro-inc/plugins-workspace?rev=06474e4c446600627cf37a11f0c22c27bcf764ca#06474e4c446600627cf37a11f0c22c27bcf764ca" =+ "sha256-ngH5sltERe8DlP/zjsin9jmlGOZFeABk8SxJ5AnZG18=";+ "git+https://github.com/macro-inc/tauri-plugins?rev=6ddd6600e20436388f169e936b610fe93944b7b0#6ddd6600e20436388f169e936b610fe93944b7b0" =+ "sha256-5ErLW2po5ZlTTuJjsCExwC//rHYcQo2tKXiyz3w/0kQ=";+ "git+https://github.com/macro-inc/tauri?rev=285fb6b1#285fb6b1cb2fc20666da1688f4c74e240a100035" =+ "sha256-++WQc4YpvoMPBFTuDj//856BguC1ArS6AeLTbIOn38Q=";+ "git+https://github.com/tauri-apps/winit-gtk4?rev=3d7c7cd19d3c752f75762ceea535444e63bdf8de#3d7c7cd19d3c752f75762ceea535444e63bdf8de" =+ "sha256-2mFNnZcPnVqPQ2iakMoXSKXrlHiIv+HuQZ7iOwtrKb4=";+ "git+https://github.com/tursodatabase/turso?rev=79163249538197d01dec5ea7f65519454ed792e2#79163249538197d01dec5ea7f65519454ed792e2" =+ "sha256-7Noz7RMN+4nhlU5BBLzxZZ53nNFGewrr8BFMO1adkCo=";+ "git+https://github.com/voxelbee/tauri-plugin-virtual-keyboard?branch=main#70e8e8325b5ff7d681ef5f3b996ac083d4fc5a01" =+ "sha256-OdEp5mw0l5Euj0ry7gzNVxdB0jlGUq0N7XINXUhtE+c=";+ };+ };+ cefCargoSources = cefCraneLib.fileset.commonCargoSources ../.;+ cefAppSrc = lib.fileset.toSource {+ root = ../.;+ fileset = lib.fileset.unions [+ cefCargoSources+ ../static_assets/schema.graphql+ ../apps/web/tauri/desktop-cef/tauri.conf.json+ ../apps/web/tauri/desktop-cef/entitlements.plist+ ../apps/web/tauri/src-tauri/tauri.conf.json+ ../apps/web/tauri/src-tauri/tauri.macos.conf.json+ ../apps/web/tauri/src-tauri/capabilities+ ../apps/web/tauri/src-tauri/icons+ ];+ };+ tauriDesktopCefConfig = builtins.toJSON {+ version = appVersion;+ plugins = desktopPlugins;+ build = {+ frontendDist = "${frontend}";+ beforeBuildCommand = "";+ };+ bundle = {+ active = true;+ targets = [ "app" ];+ externalBin = [ "binaries/macrod" ];+ cef.embed = true;+ };+ };+ tauriDesktopCefApp = cefCraneLib.mkCargoDerivation {+ pname = "macro-tauri-desktop-cef-app";+ version = appVersion;+ src = cefAppSrc;+ cargoArtifacts = null;+ cargoVendorDir = cefCargoVendorDir;+ cargoLock = ../apps/web/tauri/desktop-cef/Cargo.lock;+ TAURI_CONFIG = tauriDesktopCefConfig;+ nativeBuildInputs = [+ cefTauriCli+ pkgs.cmake+ pkgs.ninja+ pkgs.pkg-config+ ];+ buildInputs = [+ pkgs.openssl+ pkgs.libiconv+ ];+ CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER = tauriDesktopDmgAppleLinker;+ doCheck = false;+ preConfigure = ''+ export CARGO_TARGET_DIR="$PWD/apps/web/tauri/desktop-cef/target"+ '';+ preBuild = ''+ export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin"+ export CEF_PATH="$TMPDIR/tauri-cef"+ cp ${../apps/web/package.json} apps/web/package.json+ rm -rf apps/web/dist+ cp -r ${frontend} apps/web/dist+ printf production > apps/web/tauri/src-tauri/.macro-tauri-env+ install -Dm0755 ${macrodBinary}/bin/macrod \+ "apps/web/tauri/desktop-cef/binaries/macrod-${rustHostTriple}"+ install -Dm0755 ${macrodBinary}/bin/macrod \+ "apps/web/tauri/src-tauri/binaries/macrod-${rustHostTriple}"+ cd apps/web/tauri/desktop-cef+ '';+ buildPhaseCargoCommand = ''+ cargo tauri build --bundles app \+ --features tauri/custom-protocol \+ --config "$TAURI_CONFIG"+ '';+ installPhaseCommand = ''+ appPath=$(find "$CARGO_TARGET_DIR" -type d -path '*/release/bundle/macos/*.app' -print -quit)+ if [ -z "$appPath" ]; then+ echo "failed to locate built macOS Chromium app bundle" >&2+ find "$CARGO_TARGET_DIR" -path '*/bundle/*' -print >&2 || true+ exit 1+ fi+ test -d "$appPath/Contents/Frameworks/Chromium Embedded Framework.framework"+ mkdir -p "$out"+ cp -a "$appPath" "$out/Macro.app"+ '';+ doInstallCargoArtifacts = false;+ };+ tauriDesktopDmg = pkgs.stdenvNoCC.mkDerivation {+ pname = "macro-tauri-desktop-dmg";+ version = appVersion;+ APPLE_SIGNING_IDENTITY = tauriDesktopDmgSigningIdentity;+ nativeBuildInputs = [+ pkgs.coreutils+ (pkgs.python3.withPackages (ps: [ ps.ds-store ]))+ ];+ dontUnpack = true;+ dontConfigure = true;+ dontBuild = true;+ installPhase = ''+ if [ -z "$APPLE_SIGNING_IDENTITY" ]; then+ echo "APPLE_SIGNING_IDENTITY must be set when building the signed macOS DMG; use nix build --impure." >&2+ exit 1+ fi+ export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin"+ appPath="$TMPDIR/Macro.app"+ cp -a ${tauriDesktopCefApp}/Macro.app "$appPath"+ chmod -R u+w "$appPath"++ bundle_nix_dylibs() {+ local app="$1"+ local frameworks="$app/Contents/Frameworks"+ mkdir -p "$frameworks"++ local -a queue=()+ while IFS= read -r -d "" mach_o; do+ if otool -hv "$mach_o" >/dev/null 2>&1; then+ queue+=("$mach_o")+ fi+ done < <(find "$app/Contents/MacOS" "$frameworks" -type f -print0)++ local processed="$TMPDIR/bundled-mach-o-files"+ : > "$processed"++ copy_dep() {+ local dep="$1"+ local base+ base=$(basename "$dep")+ local dest="$frameworks/$base"+ if [ ! -e "$dest" ]; then+ echo "Bundling Nix dylib $dep -> $dest" >&2+ cp -L "$dep" "$dest"+ chmod u+w "$dest"+ queue+=("$dest")+ fi}- )- );- tauriDesktopDmg = craneLib.mkCargoDerivation (- tauri.commonArgs- // {- cargoArtifacts = tauri.cargoArtifacts;- pname = "macro-tauri-desktop-dmg";- TAURI_CONFIG = tauriDesktopDmgConfig;- APPLE_SIGNING_IDENTITY = tauriDesktopDmgSigningIdentity;- nativeBuildInputs = tauri.commonArgs.nativeBuildInputs ++ [ pkgs.cargo-tauri ];- preBuild = ''- if [ -z "$APPLE_SIGNING_IDENTITY" ]; then- echo "APPLE_SIGNING_IDENTITY must be set when building the signed macOS DMG; use nix build --impure." >&2- exit 1- fi- export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin"- ${tauriDesktopPreBuild}- ${installMacrodSidecar}- '';- buildPhaseCargoCommand = ''- cargo tauri build --bundles app \- --features tauri/custom-protocol \- --config "$TAURI_CONFIG"- '';- installPhaseCommand = ''- export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin"-- appPath=$(find target -type d -path '*/release/bundle/macos/*.app' -print -quit)- if [ -z "$appPath" ]; then- echo "failed to locate built macOS app bundle" >&2- find target -path '*/bundle/*' -print >&2 || true- exit 1- fi-- bundle_nix_dylibs() {- local app="$1"- local frameworks="$app/Contents/Frameworks"- mkdir -p "$frameworks"-- local -a queue=()- while IFS= read -r -d "" mach_o; do- if otool -hv "$mach_o" >/dev/null 2>&1; then- queue+=("$mach_o")- fi- done < <(find "$app/Contents/MacOS" "$frameworks" -type f -print0)-- local processed="$TMPDIR/bundled-mach-o-files"- : > "$processed"-- copy_dep() {- local dep="$1"- local base- base=$(basename "$dep")- local dest="$frameworks/$base"- if [ ! -e "$dest" ]; then- echo "Bundling Nix dylib $dep -> $dest" >&2- cp -L "$dep" "$dest"- chmod u+w "$dest"- queue+=("$dest")- fi- }- local i=0- while [ "$i" -lt "''${#queue[@]}" ]; do- local binary="''${queue[$i]}"- i=$((i + 1))+ local i=0+ while [ "$i" -lt "''${#queue[@]}" ]; do+ local binary="''${queue[$i]}"+ i=$((i + 1))- if grep -Fxq "$binary" "$processed"; then- continue- fi- printf '%s\n' "$binary" >> "$processed"-- chmod u+w "$binary" || true- local prefix="@loader_path"- case "$binary" in- "$app/Contents/MacOS/"*) prefix="@executable_path/../Frameworks" ;;- *) install_name_tool -id "@loader_path/$(basename "$binary")" "$binary" 2>/dev/null || true ;;- esac-- local deps- deps=$(otool -L "$binary" 2>/dev/null | awk 'NR > 1 { print $1 }' | grep '^/nix/store/.*\.dylib$' || true)- if [ -z "$deps" ]; then- continue- fi-- while IFS= read -r dep; do- [ -n "$dep" ] || continue- copy_dep "$dep"- install_name_tool -change "$dep" "$prefix/$(basename "$dep")" "$binary"- done <<< "$deps"- done-- local remaining_refs="$TMPDIR/remaining-nix-dylib-refs"- : > "$remaining_refs"- while IFS= read -r -d "" file; do- otool -L "$file" 2>/dev/null \- | awk -v file="$file" 'NR > 1 && $1 ~ "^/nix/store/.*\\.dylib$" { print file ": " $1 }' \- >> "$remaining_refs" || true- done < <(find "$app/Contents/MacOS" "$app/Contents/Frameworks" -type f -print0)-- if [ -s "$remaining_refs" ]; then- echo "App bundle still contains absolute Nix dylib references:" >&2- cat "$remaining_refs" >&2- exit 1+ if grep -Fxq "$binary" "$processed"; then+ continuefi- }+ printf '%s\n' "$binary" >> "$processed"- sign_darwin_app() {- local app="$1"- local -a sign_args=(--force --sign "$APPLE_SIGNING_IDENTITY")- if [ "$APPLE_SIGNING_IDENTITY" != "-" ]; then- sign_args+=(--timestamp --options runtime)+ local deps+ deps=$(otool -L "$binary" 2>/dev/null | awk 'NR > 1 { print $1 }' | grep '^/nix/store/.*\.dylib$' || true)+ if [ -z "$deps" ]; then+ continuefi- if [ -d "$app/Contents/Frameworks" ]; then- while IFS= read -r -d "" file; do- if otool -hv "$file" >/dev/null 2>&1; then- codesign "''${sign_args[@]}" "$file"- fi- done < <(find "$app/Contents/Frameworks" -type f -print0)+ chmod u+w "$binary"+ local relative_frameworks+ relative_frameworks=$(${pkgs.python3}/bin/python -c \+ 'import os, sys; print(os.path.relpath(sys.argv[1], sys.argv[2]))' \+ "$frameworks" "$(dirname "$binary")")+ local prefix="@loader_path/$relative_frameworks"+ if [ "$(dirname "$binary")" = "$frameworks" ]; then+ install_name_tool -id "@loader_path/$(basename "$binary")" "$binary"fi- # Helper executables (the macrod sidecar) must be signed- # individually for notarization; the --deep pass below re-seals- # the bundle on top of them.+ while IFS= read -r dep; do+ [ -n "$dep" ] || continue+ copy_dep "$dep"+ install_name_tool -change "$dep" "$prefix/$(basename "$dep")" "$binary"+ done <<< "$deps"+ done++ local remaining_refs="$TMPDIR/remaining-nix-dylib-refs"+ : > "$remaining_refs"+ while IFS= read -r -d "" file; do+ otool -L "$file" 2>/dev/null \+ | awk -v file="$file" 'NR > 1 && $1 ~ "^/nix/store/.*\\.dylib$" { print file ": " $1 }' \+ >> "$remaining_refs" || true+ done < <(find "$app/Contents/MacOS" "$app/Contents/Frameworks" -type f -print0)++ if [ -s "$remaining_refs" ]; then+ echo "App bundle still contains absolute Nix dylib references:" >&2+ cat "$remaining_refs" >&2+ exit 1+ fi+ }++ sign_darwin_app() {+ local app="$1"+ local -a sign_args=(--force --sign "$APPLE_SIGNING_IDENTITY")+ if [ "$APPLE_SIGNING_IDENTITY" != "-" ]; then+ sign_args+=(--timestamp --options runtime)+ fi+ local -a executable_sign_args=("''${sign_args[@]}" --entitlements ${../apps/web/tauri/desktop-cef/entitlements.plist})++ if [ -d "$app/Contents/Frameworks" ]; thenwhile IFS= read -r -d "" file; doif otool -hv "$file" >/dev/null 2>&1; thencodesign "''${sign_args[@]}" "$file"fi- done < <(find "$app/Contents/MacOS" -type f -print0)+ done < <(find "$app/Contents/Frameworks" -type f -print0)+ # CEF ships a framework and five nested helper apps. Seal the+ # bundles after their Mach-O files, from the inside out.+ while IFS= read -r -d "" bundle; do+ case "$bundle" in+ *.app) codesign "''${executable_sign_args[@]}" "$bundle" ;;+ *) codesign "''${sign_args[@]}" "$bundle" ;;+ esac+ done < <(find "$app/Contents/Frameworks" -depth -type d \+ \( -name '*.framework' -o -name '*.app' \) -print0)+ fi- codesign "''${sign_args[@]}" --deep "$app"- codesign --verify --deep --strict --verbose=2 "$app"- }+ # Helper executables (the macrod sidecar) must be signed+ # individually for notarization; the --deep pass below re-seals+ # the bundle on top of them.+ while IFS= read -r -d "" file; do+ if otool -hv "$file" >/dev/null 2>&1; then+ codesign "''${executable_sign_args[@]}" "$file"+ fi+ done < <(find "$app/Contents/MacOS" -type f -print0)- bundle_nix_dylibs "$appPath"- sign_darwin_app "$appPath"+ codesign "''${executable_sign_args[@]}" --deep "$app"+ codesign --verify --deep --strict --verbose=2 "$app"+ }- mkdir -p "$out"- # Export the final, relocated and signed app for updater packaging.- # Notarization, stapling and updater signing happen outside the store.- cp -a "$appPath" "$out/Macro.app"- dmgPath="$out/Macro-${appVersion}-${system}.dmg"- # Package a drag-to-install volume, including Finder's icon layout.- dmgRoot=$(mktemp -d "$TMPDIR/macro-dmg.XXXXXX")- cp -a "$appPath" "$dmgRoot/Macro.app"- ln -s /Applications "$dmgRoot/Applications"- ${pkgs.python3.withPackages (ps: [ ps.ds-store ])}/bin/python \- ${./dmg-layout.py} "$dmgRoot"- # hdiutil's automatic APFS sizing can run out of space while copying- # the app. Budget logical bytes (including sparse files), then leave- # 25% plus 64 MiB for filesystem metadata and temporary allocations.- appSize=$(${pkgs.coreutils}/bin/du --apparent-size --count-links --block-size=1 --summarize "$appPath")- read -r appBytes _ <<< "$appSize"- appSizeMiB=$(( (appBytes + 1048575) / 1048576 ))- dmgSizeMiB=$(( appSizeMiB + (appSizeMiB + 3) / 4 + 64 ))- echo "DMG sizing: app=$appBytes logical bytes, image=$dmgSizeMiB MiB"- df -h "$TMPDIR" "$out"- hdiutil create \- -fs APFS \- -size "$dmgSizeMiB"m \- -volname "Macro" \- -srcfolder "$dmgRoot" \- -ov \- -format UDZO \- "$dmgPath"-- if [ "$APPLE_SIGNING_IDENTITY" = "-" ]; then- codesign --force --sign - "$dmgPath"- else- codesign --force --sign "$APPLE_SIGNING_IDENTITY" --timestamp "$dmgPath"- fi- codesign --verify --strict --verbose=2 "$dmgPath"- '';- doInstallCargoArtifacts = false;- }- );+ bundle_nix_dylibs "$appPath"+ sign_darwin_app "$appPath"++ mkdir -p "$out"+ # Export the final, relocated and signed app for updater packaging.+ # Notarization, stapling and updater signing happen outside the store.+ cp -a "$appPath" "$out/Macro.app"+ dmgPath="$out/Macro-${appVersion}-${system}.dmg"+ # Package a drag-to-install volume, including Finder's icon layout.+ dmgRoot=$(mktemp -d "$TMPDIR/macro-dmg.XXXXXX")+ cp -a "$appPath" "$dmgRoot/Macro.app"+ ln -s /Applications "$dmgRoot/Applications"+ ${pkgs.python3.withPackages (ps: [ ps.ds-store ])}/bin/python \+ ${./dmg-layout.py} "$dmgRoot"+ # hdiutil's automatic APFS sizing can run out of space while copying+ # the app. Budget logical bytes (including sparse files), then leave+ # 25% plus 64 MiB for filesystem metadata and temporary allocations.+ appSize=$(${pkgs.coreutils}/bin/du --apparent-size --count-links --block-size=1 --summarize "$appPath")+ read -r appBytes _ <<< "$appSize"+ appSizeMiB=$(( (appBytes + 1048575) / 1048576 ))+ dmgSizeMiB=$(( appSizeMiB + (appSizeMiB + 3) / 4 + 64 ))+ echo "DMG sizing: app=$appBytes logical bytes, image=$dmgSizeMiB MiB"+ df -h "$TMPDIR" "$out"+ hdiutil create \+ -fs APFS \+ -size "$dmgSizeMiB"m \+ -volname "Macro" \+ -srcfolder "$dmgRoot" \+ -ov \+ -format UDZO \+ "$dmgPath"++ if [ "$APPLE_SIGNING_IDENTITY" = "-" ]; then+ codesign --force --sign - "$dmgPath"+ else+ codesign --force --sign "$APPLE_SIGNING_IDENTITY" --timestamp "$dmgPath"+ fi+ codesign --verify --strict --verbose=2 "$dmgPath"+ '';+ };tauriAppImagePackagingTests =pkgs.runCommand "tauri-appimage-packaging-tests"@@ -1134,9 +1252,9 @@}// lib.optionalAttrs isAarch64Darwin {tauri-frontend = frontend;+ tauri-desktop-cef-app = tauriDesktopCefApp;tauri-desktop-dmg = tauriDesktopDmg;tauri-desktop-apple-linker-smoke = tauriDesktopDmgAppleLinkerSmoke;- tauri-desktop-cargo-artifacts = tauri.cargoArtifacts;};};}diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows.rs b/tooling/xtask/crates/xtask_workflows/src/workflows.rsindex 1ca6f6f180..6b8a41462e 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows.rs@@ -143,7 +143,7 @@ const WORKFLOWS: &[WorkflowFile] = &[WorkflowFile {slug: "build_dmg_on_tag",file_name: "build_dmg_on_tag.yml",- render_yaml: || render_gh_workflow(build_dmg_on_tag::build_dmg)(),+ render_yaml: || render_patched(build_dmg_on_tag::build_dmg, build_dmg_on_tag::patch),},WorkflowFile {slug: "build_desktop_on_tag",diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rsindex 98022120d0..5f1ffae8f5 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs@@ -1,5 +1,5 @@//! `Build macOS DMG` — reusable workflow that builds the Tauri desktop DMG via-//! Nix. Called from [`super::build_desktop_on_tag`].+//! Nix. The release orchestrator also uses its build job directly.use gh_workflow::{Event, Expression, Job, Run, Step, Workflow, WorkflowCall, WorkflowCallInput};@@ -29,6 +29,33 @@ pub fn build_dmg() -> Workflow {.add_job("build-dmg", build_dmg_job("${{ inputs.ref }}"))}+/// Declare every secret referenced by the reusable job in stable YAML order.+pub fn patch(root: &mut serde_yaml::Value) -> anyhow::Result<()> {+ let call = root+ .get_mut("on")+ .and_then(|on| on.get_mut("workflow_call"))+ .and_then(serde_yaml::Value::as_mapping_mut)+ .ok_or_else(|| anyhow::anyhow!("rendered DMG workflow has no workflow_call"))?;+ call.insert(+ "secrets".into(),+ crate::workflows::yaml_fragment(indoc::indoc! {r#"+ POSTHOG_API_KEY:+ description: PostHog project API key inlined into the desktop bundle+ required: true+ MACOS_DEVELOPER_ID_CERTIFICATE_BASE64:+ description: Developer ID certificate for signing the macOS app+ required: true+ MACOS_DEVELOPER_ID_CERTIFICATE_PASSWORD:+ description: Password for the Developer ID certificate+ required: true+ MACOS_RELEASE_DOPPLER_TOKEN:+ description: Doppler token for notarizing the macOS DMG+ required: true+ "#})?,+ );+ Ok(())+}+/// Build the macOS DMG job, checking out and naming artifacts from `ref_expr`.pub fn build_dmg_job(ref_expr: &str) -> Job {Job::default()@@ -59,7 +86,7 @@ pub fn build_dmg_job(ref_expr: &str) -> Job {))}-fn assert_arm64() -> Step<Run> {+pub(super) fn assert_arm64() -> Step<Run> {Step::new("Assert arm64 runner").run(indoc::indoc! {r#"set -euo pipefail@@ -92,7 +119,7 @@ fn nix_build_dmg() -> Step<Run> {.add_env(("VITE_POSTHOG_API_KEY", vars::POSTHOG_API_KEY))}-fn configure_nix_cache() -> Step<Run> {+pub(super) fn configure_nix_cache() -> Step<Run> {Step::new("Configure macOS Nix binary cache").run(include_str!("scripts/configure_macos_nix_cache.sh")).id("nix-cache")@@ -100,7 +127,7 @@ fn configure_nix_cache() -> Step<Run> {.continue_on_error(true)}-fn save_nix_cache() -> Step<Run> {+pub(super) fn save_nix_cache() -> Step<Run> {Step::new("Prune and save macOS Nix build dependencies").run(include_str!("scripts/save_macos_nix_cache.sh")).shell("bash")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.shindex 4ce0161d2e..e0b4987246 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@@ -9,8 +9,8 @@# 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+# updater manifest, editor config and Markdown docs. `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@@ -22,7 +22,7 @@# detection (web_app_check_main/ios_native_check.rs).NATIVE_TREE_PATH=apps/web/tauriCACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml-export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|^desktop-release\.json$|^\.helix/'+export NATIVE_TREE_EXCLUDE='(^|/)(android|macos|linux|windows|desktop)([_./-]|$)|\.(android|macos|linux|windows)\.|\.md$|^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/scripts/validate_signed_dmg.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/validate_signed_dmg.shindex 994077942c..47c8d92600 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/validate_signed_dmg.sh+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/validate_signed_dmg.sh@@ -20,6 +20,38 @@ if [ -z "$app" ]; thenficodesign --verify --deep --strict --verbose=2 "$app"+framework="$app/Contents/Frameworks/Chromium Embedded Framework.framework"+if [ ! -s "$framework/Chromium Embedded Framework" ]; then+ echo "Signed DMG is missing the Chromium framework" >&2+ exit 1+fi+helpers=("$app"/Contents/Frameworks/*.app)+if [ "${#helpers[@]}" -lt 5 ]; then+ echo "Signed DMG is missing Chromium helper apps" >&2+ exit 1+fi++check_cef_entitlements() {+ local bundle="$1"+ local entitlements+ entitlements=$(mktemp)+ codesign -d --entitlements :- "$bundle" > "$entitlements" 2>/dev/null+ for key in \+ com.apple.security.cs.allow-jit \+ com.apple.security.cs.allow-unsigned-executable-memory \+ com.apple.security.cs.disable-library-validation; do+ if [ "$(/usr/libexec/PlistBuddy -c "Print :$key" "$entitlements")" != true ]; then+ echo "$bundle is missing the $key entitlement" >&2+ exit 1+ fi+ done+ rm "$entitlements"+}+check_cef_entitlements "$app"+for helper in "${helpers[@]}"; do+ check_cef_entitlements "$helper"+done+dylib_refs=$(mktemp)search_roots=("$app/Contents/MacOS")if [ -d "$app/Contents/Frameworks" ]; thendiff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rsindex 4e5d87a8da..165b8f4874 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs@@ -1,4 +1,4 @@-//! `Web App Pr Checks` — frontend PR checks for the web app.+//! `Web App Pr Checks` — frontend and mobile PR checks.//! Generated into `web-app-check-main.yml`.use gh_workflow::{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.rsindex 5fc0cac78e..e6345caa5e 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@@ -119,11 +119,14 @@ fn paths_filter() -> Step<Use> {- '!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_*/**'- '!apps/web/tauri/**/desktop.*'- '!apps/web/tauri/desktop-release.json'- '!apps/web/tauri/.helix/**'+ - '!apps/web/tauri/**/*.md'"},))}diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/test.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/test.rsindex 4749ddba9c..5524dbd6a4 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/test.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/test.rs@@ -76,6 +76,14 @@ fn status_check_requires_the_ios_native_check() {gate.contains("predicate-quantifier: every"),"negated path filters need the `every` quantifier: {gate}");+ assert!(+ gate.contains("!apps/web/tauri/**/*.md"),+ "documentation must not trigger an iOS native release: {gate}"+ );+ assert!(+ gate.contains("!apps/web/tauri/**/desktop-*/**"),+ "macOS CEF files must not trigger an iOS native release: {gate}"+ );// `!` binds tighter than `==` in GitHub expressions: `!x == 'true'` is// always false, which silently skipped every gated step.assert!(