Skip to content

docs(advanced): add Lockfiles and build stamps page#417

Merged
nicksinas merged 4 commits into
mainfrom
nsinas/advanced-lockfiles-stamps
May 18, 2026
Merged

docs(advanced): add Lockfiles and build stamps page#417
nicksinas merged 4 commits into
mainfrom
nsinas/advanced-lockfiles-stamps

Conversation

@nicksinas
Copy link
Copy Markdown
Contributor

Summary

Adds a new Advanced-section page documenting Avocado's two internal subsystems that govern reproducible builds:

  • Lockfiles (.avocado/lock.json) — pin package versions per (target, sysroot) scope so subsequent installs reproduce byte-identical sysroots. Covers the scope flag matrix on avocado unlock (--sdk, --rootfs, --initramfs, --extension, --runtime), the broader avocado clean --unlock equivalent, and the typical update workflow.
  • Build stamps ($AVOCADO_PREFIX/.stamps/ inside the SDK container) — cache successful command completions so steps don't re-run unnecessarily. Covers the file layout, what invalidates a stamp (config-section + package-list SHA-256 hashes), prerequisite chaining, partial-failure resume semantics, --no-stamps global flag, and avocado clean --stamps.

Closes the long-standing documentation gap (sources 015, 016) — until now these systems were observable from CLI output and flag descriptions but had no conceptual reference. The page ends with a symptom → action table so it also serves as a troubleshooting entry point.

Combined into a single page (rather than two separate ones) because the subsystems answer the same user question — "why is my build doing/not doing what I expected?" — and the answer requires understanding both. Title uses the actual CLI vocabulary ("stamp", "unlock") so users grepping for terms they see in CLI output land here.

Slot: under Developer Reference / Advanced, sidebar position 9 (after customizing-rootfs-initramfs).

Test plan

  • Visit /developer-reference/lockfiles-and-build-stamps and confirm the page renders.
  • Confirm it appears in the Advanced sidebar after "Customizing the rootfs and initramfs".
  • Spot-check accuracy against current CLI: avocado unlock --help, avocado clean --help, avocado --no-stamps --help.
  • Verify the three "See also" links resolve to existing anchors.
  • Table renders cleanly in light + dark modes.

Copilot AI review requested due to automatic review settings May 15, 2026 22:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Advanced” developer-reference guide explaining Avocado’s reproducibility mechanisms (lockfiles + build stamps) and wires it into the guides sidebar so it’s discoverable alongside other advanced topics.

Changes:

  • Add a new Lockfiles and build stamps advanced guide page covering lock/unlock workflows, stamp invalidation, and troubleshooting actions.
  • Insert the new page into the Developer Reference → Advanced sidebar list after “Customizing the rootfs and initramfs”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/sidebars-guides.js Adds the new advanced doc ID to the “Advanced” sidebar items list.
src/docs-guides/lockfiles-and-build-stamps.md Introduces a new conceptual + troubleshooting reference for lockfiles and build-stamp caching.
Comments suppressed due to low confidence (1)

src/docs-guides/lockfiles-and-build-stamps.md:142

  • The troubleshooting row suggests avocado clean --stamps --unlock, but avocado clean requires -C/--config and --target whenever --stamps or --unlock is used. Please update the suggested command (or add those required flags in the table) to match the CLI’s required arguments.
| Build skipping a step you expected to re-run | Inputs unchanged, stamp still valid | `avocado --no-stamps <cmd>` for a one-off, or `avocado clean --stamps` to reset |
| Build reusing an old package version after a feed update | Lockfile pinning the old version | `avocado unlock --<scope>` then `avocado install` |
| Build seems to ignore an `avocado.yaml` edit | Section hash unchanged or unrelated to the edit | Check the section you edited matches the component's stamp scope; if it should invalidate, `--no-stamps` to confirm |
| Want a fully clean re-build | Both layers stale or you want to start from scratch | `avocado clean --stamps --unlock` (clears both), then re-install / re-build |

`avocado clean --stamps --unlock` is the heaviest reset short of `avocado clean` removing the container volume entirely — it nukes both subsystems' state for the target but leaves your sources and the SDK image alone.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/docs-guides/lockfiles-and-build-stamps.md Outdated
Comment thread src/docs-guides/lockfiles-and-build-stamps.md
Comment thread src/docs-guides/lockfiles-and-build-stamps.md Outdated
Comment thread src/docs-guides/lockfiles-and-build-stamps.md Outdated
Comment thread src/docs-guides/lockfiles-and-build-stamps.md
Copilot AI review requested due to automatic review settings May 15, 2026 22:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/docs-guides/lockfiles-and-build-stamps.md
Comment thread src/docs-guides/customizing-rootfs-initramfs.md Outdated
@nicksinas nicksinas requested a review from mobileoverlord May 15, 2026 22:41
nicksinas added 4 commits May 18, 2026 11:26
- Clarify schema v6 per-runtime extension structure alongside top-level
  extensions map
- Add example for avocado clean --unlock showing required -C and --target
  flags
- Replace misleading "avocado image" reference with concrete component
  image subcommands
- Update customizing-rootfs-initramfs lockfile reference from stale
  avocado.lock to .avocado/lock.json and link to the new advanced page
The previous wording ("recorded after each successful install") implied
re-writing on every install, which contradicts the new Lockfiles page.
Reword to make the on-first-install + unlock-to-update semantics explicit.
Copilot AI review requested due to automatic review settings May 18, 2026 16:26
@nicksinas nicksinas force-pushed the nsinas/advanced-lockfiles-stamps branch from 5febe2c to f337383 Compare May 18, 2026 16:26
@nicksinas nicksinas merged commit f337383 into main May 18, 2026
7 checks passed
@nicksinas nicksinas deleted the nsinas/advanced-lockfiles-stamps branch May 18, 2026 16:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

@@ -152,4 +152,4 @@ If you remove a package from the `packages` map, the CLI detects the removal on

## Lock file
- A **lockfile** that pins package versions on first install so subsequent builds are reproducible. This is your _input_ state.
- A **stamp** cache that tracks which build steps have already succeeded so they don't re-run unnecessarily. This is your _output_ state.

You generally don't think about either of these — they just make builds reproducible and fast. But when something goes wrong (an apparently stale build, a package that won't update, a partial failure that "stuck"), knowing how they work is what gets you unstuck. This page covers both, plus the commands for invalidating them.
Comment on lines +84 to +89
The file layout uses one stamp per (command, component, name) tuple:

```
$AVOCADO_PREFIX/.stamps/
├── sdk/<host_arch>/install.stamp
├── sdk/<host_arch>/compile-deps.stamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants