assets/prelude.sh gives each of devvm's scripts that a build runs with
bash $devvm_arch (arm64 or amd64), $devvm_libc (musl where apk is, else
gnu) and devvm_sha TOOL (the script's TOOL_sha256_<arch>_musl on musl
where it pins one, else TOOL_sha256_<arch>). It replaces the arch and sha
helpers in layers/base.sh, layers/nix.sh, features/cli-tools.sh,
shared-tools/build.sh and oci/build.sh, and the Alpine checks in
docker.sh, desktop.sh and fzf.sh. Each script that reads it checks it
came first (: "${devvm_arch:?}").
image.OwnScript reads devvm's own scripts with the prelude before them:
base.sh, apt.sh, built-in layers (LayerData) and features (featureStep),
shared-tools/build.sh (the tools build and ToolFile's key) and the
conversion's oci/build.sh (Lima's convertSteps, written into the
conversion's own temp folder). Users' layers and features get none.
keyHash.own goes, its one caller now hashing OwnScript's bytes.
Image keys change: every image and every shared tool image rebuilds.
Tests: testdata/script/prelude.txtar pins which pin devvm_sha picks from
each script on arm64 (aarch64 and arm64) and amd64, gnu and musl, and
refuses another architecture and a missing pin; oci.txtar sources the
prelude first and checks build.sh stops without it; TestOwnScript,
TestPreludeUsers (only scripts that get the prelude use it, each checks
its variables), key rows for the prelude in build and tool keys, and
recipe expectations with the prelude before devvm's scripts only.
e2e's nix copy as a user layer starts with the prelude.
Docs: internals/images.md (the scripts' prelude, keys), contributing
(owner, agreement test), maintaining, assets/oci/README.md, AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm is one file: assets/ (base.yaml, layers/, features/,
shared-tools/, guest/, oci/, smolvm/) is embedded as assets.FS, which
cli passes to every constructor; backends, the builder, the shared
tools, the proxy and Ubuntu's key check read it as an fs.FS. Scripts
reach VMs on stdin (backend.Script carries their contents). What needs
a path (limactl create's base.yaml, oci/ mounted into the conversion
VM, the proxies' policy files) is written out to
~/.local/share/devvm/assets/<hash>, atomically, files 600 and folders
700; devvm gc deletes older copies no VM's proxy was started with
(gc_assets, deleted_assets). Release archives hold the binary with
README.md, CHANGELOG.md and LICENSE, and the formula installs the
binary alone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
assets/ holds the files devvm ships: base.yaml, layers/, features/,
shared-tools/ (mise.toml, build.sh, the tools' policies), guest/ and
oci/. devvm reads them from assets/ beside its binary (paths.Root,
paths.RootOf); releases, the Homebrew formula, the CLI tests and e2e
put them there. Image keys hash them by their names in assets/.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
--from IMAGE (default $DEVVM_FROM) starts base from a Debian-, Ubuntu-
or Alpine-based container image instead of Ubuntu's cloud image, for new
VMs, build and rebuild. base is keyed by the image's digest, looked up
once per build and recorded per reference; existing VMs keep their own
(from_ignored).
- internal/from: ParseRef (registry_ref, with a fuzz target), Valid/
Check (bad_from), Pinned, Name, Recorded (from_digest), Registry.Digest
(manifest HEAD, anonymous Bearer token from an https realm only,
timeouts, size caps, retries; ErrUnreachable/ErrNotFound), Lookup.Refresh
(refresh_from_digest: registry, else Docker's ID, else the recorded
digest with a warning), DockerID, DockerRunning.
- build.Builder: From and Lookup; Inputs/Key/Chain with the recorded
digest; spec.From for base; records keep from and digest on every image
above a --from base; rebuild counters per from; building_image_from.
- lima: convert (oci_base): devvm-oci-build from Ubuntu's image with only
<tmp>/vm (rw) and oci/ (ro) mounted, confined to the internet, runs
oci/build.sh; docker save plus exportIs for images only Docker has;
checkConverted (regular files, gnu/musl, cmdline charset, raw ext4);
base created with --set .images (disk, kernel, cmdline, initrd); the
temp folder, build VM and the OCI build lock (lockOCI, pid, stale
takeover, oci_waiting) go however the run ends.
- cli/vm: global --from flag, state from=, builders with the VM's from in
open, update, remove.
- Messages: building_image_from, bad_from, from_ignored, from_unreachable,
from_not_found, from_cached_unreachable, from_cached_not_found,
no_digest, docker_only, exporting_docker, docker_export_failed,
docker_image_changed, oci_waiting, converting_in_vm, converting,
convert_failed, convert_bad_output; doc links to from.md.
- Copied: oci/ (build.sh and README edited: comment, docs link),
testdata/stubs/docker; limactl stub gains oci/build.sh outputs and
interrupt-on.
- Converted: from.bats (registry_ref, registry_digest token, 1/2,
https realm, refresh per tag, Docker-only, offline, no Docker, pinned,
moved tag, cached keys, build flow, docker save, Ctrl+C, steps, failures,
bad outputs, record, export check, lock) as Go tests and from.txtar;
oci.bats (libc_for, missing architecture, crane pins) as oci.txtar;
cli.bats --from parse_args and project.bats --from input checks.
- e2e: from section (--from tier, or --only from): node:24 Debian 12
node+python+claude, alpine:3 musl tools and Docker on OpenRC, base from
ubuntu:26.04, no Docker needed. Left out: features, an image only Docker
has.
- Docs: from.md; images, commands, lima, contributing, index; CLI
reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>