feat(ssh): run preview builds on remotes from the release archive #11319
sea/runtime-archives fromrefs/pull/11319/head·merged by juliusmarminge View on GitHubShowing 5 changed files with 134 additions and 0 deletions (loading 2).
🟠 High src/main.ts:102
Archive-mode installs mark the version ready before verifying that the extracted t3 binary can execute. If the binary fails on the target Linux environment (for example, due to an incompatible system libc), later SSH launches follow t3_runtime_ready and repeatedly exec the broken binary instead of reinstalling. Validate t3 --version before writing .install-complete or moving the archive into the runtime location.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/desktop/src/main.ts around line 102:
Archive-mode installs mark the version ready before verifying that the extracted `t3` binary can execute. If the binary fails on the target Linux environment (for example, due to an incompatible system libc), later SSH launches follow `t3_runtime_ready` and repeatedly exec the broken binary instead of reinstalling. Validate `t3 --version` before writing `.install-complete` or moving the archive into the runtime location.
Fixed in 53f05043fb: the runner runs $T3_STAGING/t3 --version before writing .install-complete and moving the tree into place, so a binary that cannot execute on the host fails the install and is retried next launch rather than cached. scripts/install.sh already did this.
🟠 High src/main.ts:103
Concurrent preview launches using archiveVersion both proceed through the archive runner's installer lock, so they can delete or move the same runtime directory and leave an incomplete runtime or fail the remote launch. The lock's mv "$T3_LOCK_CANDIDATE" "$T3_LOCK" acquisition must be made exclusive when the target lock directory already exists.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/desktop/src/main.ts around line 103:
Concurrent preview launches using `archiveVersion` both proceed through the archive runner's installer lock, so they can delete or move the same runtime directory and leave an incomplete runtime or fail the remote launch. The lock's `mv "$T3_LOCK_CANDIDATE" "$T3_LOCK"` acquisition must be made exclusive when the target lock directory already exists.
Done in f48b338f91: the lock is taken with mkdir again (the only portable exclusive create); the pid is published atomically right after via rename. Both launches cannot hold the lock, and an executable test now races three installs against a file:// mirror and asserts one runtime.