Does deno upgrade provide automatic rollback on failure?
0 reputation · 26 Feb 2025, 22:48 UTC
The deno upgrade command replaces the current Deno executable with a newer version. While the process typically involves downloading a binary and replacing the existing file, the behavior during a catastrophic failure—such as a system crash or an interrupted write—is not explicitly defined as a self-healing process.
On Unix-like systems, the rename operation is generally atomic, but on Windows, the replacement of a running binary can be more complex. If the process is interrupted, there is a risk that the executable becomes corrupted or incomplete, as Deno does not appear to maintain a hidden backup of the previous stable binary for automatic restoration.
Given that $DENO_DIR/upgrade.json tracks version hashes but is not used for automated recovery, it remains unclear how to programmatically ensure a return to a functional state without manual re-installation.
- Does Deno implement any internal mechanism to automatically rollback to the previous version if the new binary fails to execute?
- What is the recommended strategy for verifying binary integrity immediately following a
deno upgradecommand?