Skip to content
pi-c Artifact [21b97c7b90]
Login

Artifact [21b97c7b90]

Artifact 21b97c7b90b084bd5700078fd91b8d827139d5e915f7e8626ae8c39c6f8e45de:


# Updating pic

pic can keep itself current with trunk, the line of builds that landed on the forge. It does not
download a binary: it builds one from source and installs it only when the build and the release
tests pass.

While the terminal interface is open it starts `pic update --auto` in the background shortly after
it starts and every ten minutes. That command does nothing when `autoUpdate` is false, when
`offline` is true, or when it looked less than half an hour ago. Otherwise it:

1. takes `~/.pic/update.lock`, so one update runs at a time;
2. finds the source checkout: the `autoUpdate.source` setting, or pic's own clone in
   `~/.pic/src/pi-c`, made on first use with `quarry repo clone` (or `zit clone`). When neither
   program is installed it says so; install one, or point `autoUpdate.source` at a checkout of
   trunk. A checkout that is not on trunk, or has changes of its own, is left alone;
3. pulls trunk, and stops there when that build is already installed or already failed;
4. builds the release binary and runs a light check at low priority: the docs checks and a few
   quick release suites (opening a journal, `pic -p` against the fake provider, chat);
5. when all of that passed and the new binary starts, copies it beside the pic that runs it and
   renames it over that pic. A build or a test that fails installs nothing.

Then a pic that is open says `✔ Update installed · /restart to update` ([the terminal
interface](tui.md)), and `pic remote` restarts itself. Journals a newer pic opens are migrated
by that pic; the old one keeps running until you restart it.

Every landing on trunk has already passed the whole suite on the forge, so running it again on
your machine after each landing would load it several times a day and let a load-sensitive suite
block updates for no reason. `pic update --full` runs the whole release suite before installing.

`pic update` runs one now whatever the half hour says, `--force` tries a trunk that failed before,
and `pic update --status` says what happened last: installed, up to date, failed or skipped and
why. The output of the build and tests is in `~/.pic/update.log`.

Turn it off with `pic settings autoUpdate false`. It needs a toolchain and `make`, and does nothing
where pic cannot start programs.