Skip to content

fix(macos): stage PermissionFlow resource bundle into .app#3990

Merged
louis030195 merged 4 commits into
screenpipe:mainfrom
divanshu-go:fix/permission-flow-bundle-staging-3975
Jun 10, 2026
Merged

fix(macos): stage PermissionFlow resource bundle into .app#3990
louis030195 merged 4 commits into
screenpipe:mainfrom
divanshu-go:fix/permission-flow-bundle-staging-3975

Conversation

@divanshu-go

Copy link
Copy Markdown
Contributor

Description

Fixes the SIGTRAP that crashed onboarding on fresh macOS installs when users clicked Screen Recording or Accessibility. The PermissionFlow resource bundle now reaches Contents/Resources/ of the shipped .app, so localized strings load successfully and the native permission flow runs end-to-end on user machines

Root cause

swift-rs linked the plugin's Swift code but did not copy the SwiftPM-generated PermissionFlow_PermissionFlow.bundle into the consuming .app. At runtime, Bundle.module's generated accessor walked its candidate paths, found nothing, and ran Swift.fatalError("unable to find bundle named PermissionFlow_PermissionFlow"). The trap fired on the main thread inside SwiftUI body evaluation, so the Tauri command never returned and the JS-side try/catch fallback in permission-flow.ts was unreachable.

Closes #3975

Onboarding crashes with SIGTRAP (fatalError in Bundle.module) the first time
a user clicks Screen Recording or Accessibility on a fresh macOS install.
swift-rs links the plugin's Swift code but does not copy the SwiftPM-generated
PermissionFlow_PermissionFlow.bundle into the consuming .app, so Bundle.module's
generated accessor can't find the localization bundle and traps.

Fix:
  - Bump tauri-plugin-permission-flow to the fork rev that forwards the bundle
    path through Cargo links-key metadata
    (DEP_TAURI_PLUGIN_PERMISSION_FLOW_BUNDLE_DIR), so the consumer no longer
    scans hashed OUT_DIRs.
  - build.rs reads that env var, copies the bundle into src-tauri/, and panics
    on miss (replaces the prior cargo:warning=, which let broken .apps ship).
  - List the bundle in every tauri*.conf.json variant so Tauri's bundler
    stages it under Contents/Resources/ regardless of which config profile
    is in effect (default, prod, beta, enterprise).

Closes screenpipe#3975
tauri-build's validate_resources runs at cargo build time and walks
bundle.resources from tauri.conf.json, failing if any entry doesn't
exist on disk — even with --no-bundle. So warning-and-skip wasn't
enough; CI still tripped on:

  resource path `PermissionFlow_PermissionFlow.bundle` doesn't exist

Same trick mlx.metallib already uses in this build.rs: when the real
artifact isn't available, create an empty placeholder so the path
resolves. tauri-build only checks existence, not content. Real
bundles still ship on release builds (PROFILE=release still panics
on miss).
@louis030195 louis030195 merged commit c4908e1 into screenpipe:main Jun 10, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS onboarding hard-crash (SIGTRAP): permission-flow Bundle.module fatalError, resource bundle not shipped in .app

2 participants