fix(update): stream update child output to the live log (PYTHONUNBUFFERED) - #64576
Conversation
|
Verified the reported buffering path on current main. The proposed setting matches the established gateway update-streaming behavior in No blocking issues found. The current-main hunk contexts remain unchanged, so this appears mechanically salvageable. Automated hermes-sweeper review. |
…ERED)
hermes update is a Python CLI writing to a pipe when the Tauri updater or
the desktop's in-app POSIX path spawns it, so CPython block-buffers stdout.
Long quiet steps stream nothing to the progress UI. Worst case is the
pre-update backup (updates.pre_update_backup: true): it can zip multi-GB
archives for minutes while the updater still shows the previous line
('waiting for Hermes to exit...'). Users read that as a hang, cancel a
healthy update, and the orphaned child keeps mutating the install.
Set PYTHONUNBUFFERED=1 in both spawn sites (update_child_env in the Tauri
updater, applyUpdatesPosixInApp in the desktop) so output streams line by
line.
Also make the lock-probe unit test pass on macOS: the packaged payload
lives under Contents/Resources there, and Path::ends_with is
case-sensitive, so the lowercase resources/app.asar assertion only ever
matched the Windows/Linux layouts.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
03d338a to
86eba6f
Compare
|
Thanks for the verification. Rebased onto current main (clean, hunk contexts unchanged as you noted) and re-ran the installer suite on the rebased branch: 28 passed including the new env unit test. Good pointer on gateway/slash_commands.py already doing this for its own update streaming — same rationale, now consistent across all three update surfaces. |
…update-stream-output fix(update): stream update child output to the live log (PYTHONUNBUFFERED)
…update-stream-output fix(update): stream update child output to the live log (PYTHONUNBUFFERED)
…update-stream-output fix(update): stream update child output to the live log (PYTHONUNBUFFERED)
Problem
When the desktop app updates itself (Tauri
Hermes-Setup --updatehand-off, or the in-app POSIX path), the spawnedhermes updateis a Python CLI writing to a pipe, so CPython block-buffers its stdout. Nothing reaches the live log until 8 KB accumulate or the process exits.The worst case is the pre-update backup (
updates.pre_update_backup: true): it can zip multi-GB archives for minutes while the updater UI still shows the previous line. On my install the updater sat on[update] waiting for Hermes to exit…for over 3 minutes while a 4.2 GBpre-update-*.zipwas being written:A user reads that silence as a hang and cancels — and because the child is not killed with the updater, the orphaned
hermes updatekeeps mutating the install headless. The same silent-stage behaviour applies to the desktop's in-app POSIX update path.Fix
Set
PYTHONUNBUFFERED=1at both spawn sites so the child streams line by line:update_child_env()inapps/bootstrap-installer/src-tauri/src/update.rs(covers thehermes updateandhermes desktop --build-onlystages of the Tauri hand-off)envhanded torunStreamedUpdateinapplyUpdatesPosixInApp(apps/desktop/electron/main.ts)With this, the "Creating pre-update backup…" line (and everything after) appears in the live log the moment it is printed, so a long backup reads as progress instead of a freeze.
Also in this PR
cargo testfor the installer never passed on macOS:lock_probe_paths_include_desktop_app_payloadasserts a probe ends withresources/app.asar, but the macOS payload lives underContents/Resources/andPath::ends_withis case-sensitive. The assertion now accepts both layouts.Validation
cargo test --lib(apps/bootstrap-installer/src-tauri): 28 passed, 0 failed on macOS arm64, including a new unit test assertingPYTHONUNBUFFERED=1is present in the update child envnpx tsc -p apps/desktop --noEmit: clean🤖 Generated with Claude Code