docs: document incremental builds and the session design
CI / build (push) Successful in 3m6s
CI / test (push) Skipped
CI / publish (push) Skipped
CI / snap (push) Successful in 6m25s

README: the build-session workflow (auto-recording, --resume,
'pkh deb list', --keep, prune retention) under a new section.
plans/: the design spec with the decisions taken along the way
(opt-in resume, --keep for the iteration loop, /var/tmp/pkh/
sessions, Ctrl+C keeping the session) and the implementation notes
recording the as-built deviations.
This commit is contained in:
2026-09-26 11:52:07 +02:00
parent 1b71a6814c
commit 1c8f4cf35b
2 changed files with 451 additions and 0 deletions
+22
View File
@@ -111,6 +111,28 @@ pkh put --ppa user/hello_xxx
git push xxx user-fork
```
### Incremental builds (build sessions)
Every `pkh deb` build records a **session** under `/var/tmp/pkh/sessions`:
the bootstrapped chroot, the installed build dependencies and the build
artifacts of the staged tree. When a build fails (or is interrupted), the
session is kept and can be resumed:
```
pkh deb # fails after 25 minutes
pkh deb --resume # reuses the chroot, build deps and objects;
# only what changed is recompiled
pkh deb list # the sessions of this tree, with their ids
pkh deb --resume <id> # resume a specific session
pkh deb --keep # keep the session even after a successful build
# (iterate: edit, `pkh deb --resume --keep`, ...)
pkh prune # garbage-collect old sessions (7-day retention)
```
A plain `pkh deb` never reuses a session — everything is rechecked from
scratch — and it replaces the session of its target. `pkh deb --resume`
refuses to adopt a session built for a different series/architecture.
## Future improvement ideas
- pull: try to fetch the correct git branch for series on Debian