Files
orbit/planning/4thyv-update-orbit-itself-from-the-registry.md
T
nandi d3b1dedeb5
Rolling Release / build (push) Successful in 1m58s
Rolling Release / publish (push) Successful in 10s
Add orbit self-update to replace the running binary
- `orbit self-update [constraint]` replaces the running orbit with the newest `orbit` package in its channel, or one matching a constraint (which may downgrade).
- The new build must print its version before it is renamed over the old binary.
- An orbit installed as a global package is upgraded instead, keeping rollback.
- `orbit upgrade orbit` does the same when orbit isn't installed as a package.
- Read `/proc/self/exe` through a new C stub; document in README; mock-registry test.
2026-12-02 13:32:29 -08:00

1.6 KiB

data, id, title
data id title
priority status type
normal done feature
4thyv Update Orbit itself from the registry

Orbit is published as the orbit package in main (built by orbit-packages, versioned by moon.mod). A copy installed outside Orbit (just install, the rolling release in ~/.local/bin) had no way to update itself.

Acceptance criteria

  • orbit self-update [constraint] replaces the running binary with the newest orbit build in its channel when that is newer than the running version, or with the newest build matching an explicit constraint (which may downgrade).
  • The new binary is checked to run (--version) before it atomically replaces the old one.
  • When the running binary is the one Orbit installed globally, it upgrades the orbit package instead, keeping rollback.
  • orbit upgrade orbit does the same when orbit isn't installed as a package.
  • Mock-registry test; README documents it.

Outcome

Done in src/main/self_update.mbt (cmd_self_update, replace_self), with orbit_self_exe in stub.c reading /proc/self/exe. The new build is staged as <exe>.orbit-new, must print orbit <version>, then is renamed over the old binary; the store download is deleted unless that build is installed. Tested with the mock registry (upgrade, up to date, downgrade by constraint, broken build left out) and by hand against main (0.1.0 reports up to date; a store-installed orbit hands off to orbit upgrade orbit).

Users only see an update once moon.mod's version is bumped and orbit-packages publishes it. The published 0.1.0 doesn't have the command yet.