fix(macos): stage PermissionFlow resource bundle into .app#3990
Merged
louis030195 merged 4 commits intoJun 10, 2026
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 machinesRoot cause
swift-rslinked the plugin's Swift code but did not copy the SwiftPM-generatedPermissionFlow_PermissionFlow.bundleinto the consuming.app. At runtime,Bundle.module's generated accessor walked its candidate paths, found nothing, and ranSwift.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-sidetry/catchfallback inpermission-flow.tswas unreachable.Closes #3975