You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve the working CLI installation if a release update fails #38
The updater deletes and replaces bin, lib, config and libexec one directory at a time. It checks for the new executable afterwards in the live destination. An archive with a bin directory but no CLI can displace a working binary before validation fails. A failed rename can also leave new executables paired with older libraries.
Expected behavior and verification
Validate the staged release and retain a recoverable previous layout until replacement succeeds. Exercise an invalid archive and a failure partway through replacement. In both cases the previous CLI should still run with its own libraries and the stored version should remain accurate.
Fixed on branch 38-safe-cli-update (7e3e5e7), pull request #53.
The staged release is validated before anything is touched. If it has no CLI, the installed version stays as it is.
The installed bin, lib, config and libexec folders are moved aside and the staged ones moved in. On any failure, the new folders are removed and the old ones are put back. The old copy is deleted only after the new layout is complete.
At startup, an update interrupted midway is rolled back, or its leftover copy is deleted if the new release is complete.
The stored version is updated only after a successful install.
Tests: an archive with no CLI, a failure partway through replacement (the previous release is restored with its own libraries), a full replacement, a CLI at the archive root, and recovery after an interrupted update. Unit and workspace suites pass locally (Linux).
Note: the startup recovery decides whether the new release is complete by checking for the CLI only. A crash between moving in bin and moving in lib would keep the new bin without libraries. This is a narrow case and could be handled separately.
Activity
Arthurvroum commentedon Nov 25, 2026
Fixed on branch
38-safe-cli-update(7e3e5e7), pull request #53.bin,lib,configandlibexecfolders are moved aside and the staged ones moved in. On any failure, the new folders are removed and the old ones are put back. The old copy is deleted only after the new layout is complete.Tests: an archive with no CLI, a failure partway through replacement (the previous release is restored with its own libraries), a full replacement, a CLI at the archive root, and recovery after an interrupted update. Unit and workspace suites pass locally (Linux).
Note: the startup recovery decides whether the new release is complete by checking for the CLI only. A crash between moving in
binand moving inlibwould keep the newbinwithout libraries. This is a narrow case and could be handled separately.