Skip to content

feat(cache): pin the build-environment image in the escrow manifest#106

Merged
jwinarske merged 1 commit into
mainfrom
jw/escrow-env-image
Jul 4, 2026
Merged

feat(cache): pin the build-environment image in the escrow manifest#106
jwinarske merged 1 commit into
mainfrom
jw/escrow-env-image

Conversation

@jwinarske

Copy link
Copy Markdown
Contributor

Extends the escrow archive (#102) so it references the environment, not just the data. An archive restores bytes, but a rebuild years on also needs a runnable environment — emb, the Flutter SDK, a period-appropriate host. This lets the archive pin the container image that reconstructs it.

What

  • emb cache export --image <ref> records the build-environment image (the one emb cross --dockerfile emits, baking emb + toolchain + sysroot) into the archive manifest as env_image. It warns when <ref> is a mutable tag rather than a digest, since only a digest is a durable escrow anchor.
  • emb cache import reports the pinned image so the operator knows which environment to pull before restoring the data.

Structure

  • cache_archive.dart: archiveManifest gains an optional envImage; new pure isImageDigestPinned(ref) (matches …@sha256:<hex>).

Test

  • dart analyze lib test clean; dart format --set-exit-if-changed clean.
  • cache_archive_test.dart covers the env_image field (present/absent) and isImageDigestPinned (digest vs tag).
  • Full suite: 524 pass, 2 skip, 2 pre-existing real dpkg-deb/real debugfs env failures.

Docs

README emb cache table (export --image, import reporting) and the escrow paragraph explain data-vs-environment and cross-link emb cross --dockerfile.

An escrow archive restores data, but a rebuild years later also needs a
runnable environment (emb, the Flutter SDK, a period host). Let the
archive reference the container image that reconstructs it.

- `emb cache export --image <ref>` records the build-environment image
  (from `emb cross --dockerfile`) in the manifest, warning when the ref
  is a mutable tag rather than a digest.
- `emb cache import` reports the pinned image so the operator knows which
  environment to pull.

Adds `isImageDigestPinned` and an `env_image` manifest field; README and
tests updated.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske merged commit ef57f4e into main Jul 4, 2026
7 checks passed
@jwinarske
jwinarske deleted the jw/escrow-env-image branch July 4, 2026 06:56
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.

1 participant