feat(bundle): use tauri-native resources + dynamic bundle path detection#213
Draft
TimeToBuildBob wants to merge 2 commits intoActivityWatch:masterfrom
Draft
feat(bundle): use tauri-native resources + dynamic bundle path detection#213TimeToBuildBob wants to merge 2 commits intoActivityWatch:masterfrom
TimeToBuildBob wants to merge 2 commits intoActivityWatch:masterfrom
Conversation
Draft exploration of Tauri-native module bundling instead of build_app_tauri.sh. **tauri.conf.json**: Add `bundle.resources` to include pre-built Python watcher modules in `Contents/Resources/modules/` during `tauri build`. Paths assume the repo is used as a submodule inside activitywatch (`../../dist/activitywatch/`). **dirs.rs** (macOS): Replace hardcoded `/Applications/ActivityWatch.app/...` paths with dynamic detection via `current_exe()`. The new logic: 1. Gets the executable path (Contents/MacOS/aw-tauri) 2. Walks up to Contents/Resources 3. Adds Resources/modules/ (for tauri-native layout) and Resources/ (legacy compat) This fixes discovery for any install location — not just /Applications. ### Trade-offs vs build_app_tauri.sh - Gains: standard Tauri tooling, dynamic resource path, auto-generated Info.plist - Unchanged: Python.framework signing complexity (PyInstaller issue, not bundler issue) - Still needed: activitywatch Makefile/CI changes to run `cargo tauri build` instead of `build_app_tauri.sh` — see ActivityWatch/activitywatch for the CI side This is a draft for evaluation — the CI integration is not yet done.
ErikBjare
reviewed
Apr 9, 2026
The hardcoded ../../dist/activitywatch/* paths broke standalone aw-tauri CI
since they only exist when aw-tauri is used as a submodule inside activitywatch.
Instead, the activitywatch build system should inject resources at build time:
cargo tauri build --config '{"bundle":{"resources":{...}}}'
This keeps aw-tauri self-contained and CI-friendly. The dirs.rs dynamic
discovery change is independently valuable and unaffected.
Addresses ErikBjare's review: 'Maybe these should be conditionally added?'
Member
|
Update the description to note 1dbc66b |
Contributor
Author
|
Done — updated the description to note commit 1dbc66b and explain the new approach (build-time injection vs static resources in ). |
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.
Summary
Draft PR to evaluate Tauri-native
.appbundling as a replacement for build_app_tauri.sh in the activitywatch repo.Raised by @ErikBjare in ErikBjare/bob#546:
Changes
tauri.conf.json— resources injected at build time (not statically configured)Initially this PR added static, but that broke standalone aw-tauri CI because the paths (bundle.resourcestotauri.conf.json../../dist/activitywatch/*) only exist when aw-tauri is used as a submodule inside the activitywatch repo.Per 1dbc66b, those static entries were removed. Instead, the activitywatch build system injects resources at build time via
--config:This keeps aw-tauri self-contained (CI-friendly) while still letting activitywatch drive the bundling.
dirs.rs— dynamic resource path detectionReplace the hardcoded
/Applications/ActivityWatch.app/Contents/...discovery paths with runtime detection viacurrent_exe():Why this matters: The old code only worked when installed at
/Applications/ActivityWatch.app. Users who move the app to~/Applications/or run it from a downloaded DMG had no module discovery. This change is independently valuable regardless of the bundler decision.What's NOT changed here
The Python.framework signing complexity (the #1254–#1256 series) is independent of the bundler. PyInstaller copies
Python.frameworkas separate inodes → needs canonical signing regardless of whetherbuild_app_tauri.shortauri buildcreates the.app.What's still needed (activitywatch side)
The companion change in activitywatch would replace
build_app_tauri.shwithcargo tauri build(with the--configflag above):CI would also need updating to use Tauri's signing/notarization flow (or keep the existing
xcnotaryapproach, applied aftertauri build).Evaluation questions
bundle.resourceswith directory paths work correctly with PyInstaller output (which includes nestedPython.framework)?Info.plistfields we currently set manually inbuild_app_tauri.sh(CFBundleURLTypes, LSUIElement, etc.)?cargo tauri buildfast enough vs the current shell script approach?Draft status — not ready to merge, but enough to evaluate the direction.