Repository navigation
build(tauri): stage watcher modules before Linux Tauri build - #1498
TimeToBuildBob wants to merge 4 commits into
Conversation
|
On Linux, copy aw-watcher-afk, aw-watcher-window, and aw-sync into aw-tauri/src-tauri/modules/ before building the Tauri package. The aw-tauri Makefile (commit 931e56d) already detects the presence of src-tauri/modules/aw-* and injects them into the AppImage/deb/rpm via bundle.resources — but nothing was staging them there before this change, so standalone Linux bundles shipped without watchers. Restructure the package loop to build all non-aw-tauri PACKAGEABLES first, then stage modules on Linux, then build aw-tauri explicitly. On macOS the staging block is skipped (watchers are bundled differently there). Git-Session-Id: f6b4
123fb7c to
14ffe5c
Compare
|
Rebased onto upstream master (14ffe5c). The upstream had added |
The original code staged modules then called `make --directory=aw-tauri package`, but aw-tauri's Makefile evaluates TAURI_BUILD_ARGS at parse time: the `bundle.resources` config is only injected when src-tauri/modules/aw-* already exists when make starts. Staging after the top-level `make build` (which already ran `make --directory=aw-tauri build`) meant the tauri build ran without modules, and `make package` only copies the already-built bundles — so the deb/ rpm/AppImage were built without the watcher binaries embedded. Fix: on Linux, call `make --directory=aw-tauri build package` after staging, so tauri re-runs its build step with modules present and TAURI_BUILD_ARGS correctly includes `bundle.resources`. On non-Linux platforms the staging block doesn't run, so `make --directory=aw-tauri package` is unchanged. Git-Session-Id: 791dd535-5e0b-57e7-a6c3-b1653fe4976e
|
Root cause found and fixed in d1fb5c8. The CI failure (
Fix: on Linux, after staging modules, call |
|
@greptileai review |
awatcher is included as a PACKAGEABLE on Linux (alongside aw-watcher-afk and aw-watcher-window) but was missing from the src-tauri/modules/ staging block, so standalone Linux Tauri bundles shipped without the Wayland- compatible window watcher. Git-Session-Id: dc4bba9d-ca43-5116-848c-3f8e863d5efe
|
@greptileai review |
The previous package-time `make --directory=aw-tauri build package` re-ran tauri build after the top-level `make build` had already bundled aw-tauri without modules. That caused two CI failures: - ubuntu-24.04: second linuxdeploy (AppImage) failed with "failed to run linuxdeploy". Build already retried that flake twice; Package had no retry. - ubuntu-24.04-arm: `cp bundle/deb/*.deb .../aw-tauri.deb` failed because leftover .deb files from the first bundle made GNU cp treat the dest as a directory. Skip the Linux aw-tauri build until modules are staged, wipe any leftover bundle dir, and retry Package with the same signing env as Build so the one remaining tauri build can produce updater artifacts. Git-Session-Id: bob-monitor-3650578
|
The Package failures on
Research-edition Linux passed because that job's extra rebuild left a single Fix in c0a8853:
|
|
@greptileai review |
|
Status on c0a8853: the 4/5 rests only on the "Source builds skip the desktop" P1, and Greptile withdrew it at 18:26 after the design rationale. The summary score was computed before that. All 5 review threads are resolved. The two release.yml/test findings are pre-existing, and the No code change this round, so I'm not re-triggering a review. CI on c0a8853 is still running (the Tauri Linux legs are the ones that matter). Leaving this for human review and merge once those are green. |
|
On c0a8853, all three Tauri Linux legs passed: ubuntu-24.04, ubuntu-24.04-arm and research. The ubuntu-24.04 log shows the fix doing what it should:
The macOS legs are still queued for runners. This change is gated to Linux, so they don't exercise it. Ready for review and merge. |
🤖 AI code reviewThe PR restructures the Makefile Needs a look — P2 onlyConfidence 4/5 ℹ️ Consensus was degraded on this run: 1 of 3 passes answered, so findings were filtered at 1-of-1 agreement rather than 2-of-3 — less filtered than usual; 1 of 3 fan-out jobs answered, so the findings above were filtered against less evidence than the threshold assumes. 2 findings ·
|
| make package SKIP_SERVER_RUST=${{ matrix.skip_rust }} | ||
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4 | ||
| with: | ||
| timeout_minutes: 60 |
There was a problem hiding this comment.
Package step now uses nick-fields/retry with max_attempts: 3 and timeout_minutes: 60. The command runs make package SKIP_SERVER_RUST=${{ matrix.skip_rust }}. On Linux Tauri builds, this make package now runs tauri build (via make --directory=aw-tauri build package), which can take a long time. The retry action will retry the entire make package if it times out or fails. However, make package starts with rm -rf dist and rebuilds everything from scratch. If the first attempt fails after 60 minutes, the retry will start over, potentially wasting another 60 minutes. More importantly, the retry action's timeout_minutes applies to each attempt, but the make package on Linux Tauri may exceed 60 minutes, causing the retry to fail and then retry again, potentially hitting the overall job timeout. The previous Package step was a plain run without a timeout, so it could run as long as needed. Adding a 60-minute timeout may cause the build to fail on slower runners or when the cargo cache is cold. This is a potential regression in CI reliability.
| echo "Building $$module"; \ | ||
| if [ "$$module" = "aw-server-rust" ] && [ "$(TAURI_BUILD)" = "true" ]; then \ | ||
| make --directory=$$module aw-sync SKIP_WEBUI=$(SKIP_WEBUI) || { echo "Error in $$module aw-sync"; exit 2; }; \ | ||
| elif [ "$$module" = "aw-tauri" ] && [ "$(TAURI_BUILD)" = "true" ] && [ "$(OS)" = "Linux" ]; then \ |
There was a problem hiding this comment.
Makefile's build target now skips aw-tauri on Linux when TAURI_BUILD=true, with the comment that watcher modules must be staged first. However, the build target is also used by the CI Build step, which runs make build SKIP_WEBUI=... SKIP_SERVER_RUST=.... On Linux Tauri builds, this now skips building aw-tauri entirely, meaning the aw-tauri frontend (if any) and Rust code are not compiled during the Build step. They are compiled later during make package (in the Package step). This means the Build step no longer catches compile errors in aw-tauri on Linux; they only surface during Package, which is now wrapped in a retry with a 60-minute timeout. If aw-tauri fails to compile, the Package step will retry three times, each time re-running the full make package (including rebuilding all watchers and aw-tauri), wasting significant CI time before failing. This is a regression in CI feedback speed and could mask errors until the packaging stage.
|
Closing in favour of #1499, which fixes the same problem in the Makefile only. One issue here, for the record: this copies |
Problem
Linux standalone bundles (AppImage/deb/rpm) from
make package TAURI_BUILD=trueshipped without watchers. The aw-tauri Makefile already supports injecting asrc-tauri/modules/directory into the Tauri bundle viabundle.resources(commit 931e56d — conditional on$(wildcard src-tauri/modules/aw-*)being non-empty), but nothing in the activitywatch build was staging anything there.Fix
Restructure the
packagetarget to:PACKAGEABLESfirst (watchers + aw-core + aw-client)aw-watcher-afk/,aw-watcher-window/, andaw-syncintoaw-tauri/src-tauri/modules/modules/directory and injects it into the bundlemacOS is unchanged: the staging block is
ifeq ($(shell uname),Linux)only, since macOS bundles watchers differently (native window tracker, .app bundle structure).Test plan
make package TAURI_BUILD=trueon Linux — verifydist/activitywatch/aw-tauri/*.AppImagecontainsaw-watcher-afk,aw-watcher-window, andaw-syncunderResources/modules/make package(non-TAURI_BUILD) unchanged — aw-qt flow unaffected