Skip to content

fix(app): ship checksum worker sidecar across all bundle formats#27

Open
lukyrys wants to merge 14 commits intomainfrom
fix/checksum-worker-cross-platform-bundles
Open

fix(app): ship checksum worker sidecar across all bundle formats#27
lukyrys wants to merge 14 commits intomainfrom
fix/checksum-worker-cross-platform-bundles

Conversation

@lukyrys
Copy link
Copy Markdown
Collaborator

@lukyrys lukyrys commented May 4, 2026

What

Fixes the checksum worker not being shipped (or not discoverable) in production
bundles. Original Windows-only ZIP fix is extended to all bundle formats
(NSIS/MSI/Windows ZIP, macOS DMG/ZIP, Linux DEB/RPM/Pacman/AppImage/ZIP),
adds worker lifecycle hardening, and gates the build on cross-package tests.

Why

Bun-compiled binaries see import.meta.url as /$bunfs/root/<binary> (virtual),
so the worker URL resolved to a non-existent file. Tauri bundles also weren't
copying the worker into the resource directory. Result: silent 0% hang on
LISH creation, then segfault on stop.

The fix:

  1. Worker shipped as real sidecar at <dir(execPath)>/lish/checksum-worker.js
  2. bundle.resources includes the worker on all 3 platforms
  3. app/build.sh ZIP/DEB/RPM staging copies the worker
  4. worker.terminate() swapped for worker.unref() on Windows compiled (Bun segfault avoided)
  5. Pre-build test gate runs typecheck + unit tests before producing artifacts

Verified

Platform Build Worker runtime
Windows backend (zip standalone) ✅ smoke + stopCreate
Linux ZIP ✅ 4m on lister ✅ 16+24 chunks
Linux DEB ✅ 24 chunks (extracted)
Windows Tauri NSIS ✅ 2m local ✅ 24 chunks + 3 file events
macOS / Linux Tauri not exercised logical only — same code path

Pre-build gate: typecheck + 405 unit tests + frontend bun run check + shared/cli typecheck.
Skip with SKIP_TESTS=1 only in emergencies.

Commits (13)

Type Commit Subject
fix 760eec5 ship checksum worker for windows builds
fix 4bd3606 bundle worker as Tauri resource on all platforms
fix 03e09a6 include worker in zip and linux package staging
fix 98ef61f exit on first build step failure on windows
refactor 07f26e6 use releaseWorkers helper on success path
perf 4320673 cache compiled-binary detection at module load
style a5de9f1 typed worker.unref intersection
style c76e9ce clarify messageerror description
chore 642da99 drop nsis languages without multiuser plugin coverage
test ebdffc7 stopCreate regression test for compiled worker abort path
test 03e48d5 run typecheck and unit tests as backend pre-build gate
test 8758bed run cross-package verification as app pre-build gate
test 9ed2471 skip windows-specific backslash traversal cases on posix

⚠️ Coordinate with PR #26

PR #26's docker/Dockerfile compiles app.ts and checksum-worker.ts with
two entry points into a single --outfile, which doesn't produce the sidecar
this PR's runtime resolution requires. Whichever PR lands second must split
the Docker build into two bun build steps mirroring backend/build.sh.

Out of scope

  • Migrate to Tauri's bundle.externalBin + tauri-plugin-shell sidecar API
  • Factor common bundle.resources into shared tauri.conf.json (RFC 7396 merge behavior unclear)
  • DRY 3× duplicated worker build line across backend/build.{sh,bat} + app/build.bat
  • FHS-compliant Linux layout (/usr/lib/libershare/ instead of /usr/bin/lish/)

@lukyrys lukyrys marked this pull request as ready for review May 5, 2026 16:50
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.

1 participant