mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
Lima is devvm's only backend. The backend architecture stays (Backend, Caps, Features, Review/Require, the registry, backendtest.Fake), so another backend is an addition. State from a smolvm VM reads as an unknown backend (backend_unknown_vm, gc_orphans_unknown); nothing migrates it. The image keys of layers/docker.sh, layers/nix.sh and features/desktop.sh change, so images rebuild once. Lima's port forwarder moves off smolvm's files first: newForwarderCmd and forwarderMain from internal/cli/smolvmports.go to limaports.go, and assets/container/ports.sh to assets/guest/ports.sh (sent by the forwarder at run time, so no image key changes). Removed: - internal/backend/smolvm (4,070 lines with tests), _smolvm-ports, its registry entry, registry.Experimental and backend_experimental. - The decider: backend.Decider/UsesDecider, Confinement.Decider and DeciderToken, internal/proxy/decider.go and its test, the proxy's -decider, -decider-to and -decider-token-file, netpolicy's KeyDeciderPort, KeyDeciderToken and deciderToken, the decider port in vm's forwarding and UsedPorts. - backend.AgentStarter/AgentUnchosen, vm's checkAgentStart and agent_unchosen_stop. - vmssh/key.go (EnsureKey, Public, HostKey, ServicesArgs, Capped). - paths.Smolvm/SmolvmImage and space's smolvm folders; paths.VM's Record, Key, KnownHosts and ProxyURL; project.Detect, which nothing called (a test helper now). - ubuntu.ContainerRepo/ContainerDigest/ContainerRef/ContainerOrigin and bump.sh's ubuntu_image, with its part of bump.txtar. - assets/smolvm/ and assets/container/; the no-init-system branches of layers/docker.sh, layers/nix.sh and guest/sync.sh, and the notes in features/desktop.sh and guest/ca.sh. - Messages: smolvm_* (14), vm_no_ssh, vm_no_sshd, ports_no_ssh, creating_from_image, packing_image, pack_failed, backend_experimental, agent_unchosen_stop; descriptions naming smolvm reworded. - Tests: smolvm.txtar, the smolvm stub, registry, decider, netpolicy and sshagent cases; gc_backend, gc_skipped, gc_orphans and space test a failing or hanging Lima listing instead (the limactl stub's list-fails and list-hangs); the --backend smolvm examples; e2e's --backend smolvm and its section (about 1,130 lines), the smol_* helpers and the link section's backend switch. - Coverage: internal/backend/smolvm's lines in both baselines. - Docs: backends/smolvm.md, internals/smolvm.md, design.md's smolvm notes (Ports on Lima now holds the forwarder's description), the backends table's smolvm column, every page naming smolvm, the README, the home page's backends art, and AGENTS.md's smolvm rows and gotchas (and the Docker bind-mount gotcha, which nothing refers to). Kept: the docker layer, on Lima; --from's local Docker; --backend, the BACKEND column and setup's backend choice, which the next commit removes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
96 lines
3.2 KiB
Plaintext
96 lines
3.2 KiB
Plaintext
# devvm --help prints usage.
|
|
exec devvm --help
|
|
stdout '^Usage:'
|
|
stdout '^ devvm \[flags\]$'
|
|
! stdout 'IMAGE\]'
|
|
! stderr .
|
|
cp stdout help.txt
|
|
|
|
# So do devvm help and -h; devvm help COMMAND prints the command's.
|
|
exec devvm help
|
|
cmp stdout help.txt
|
|
exec devvm -h
|
|
cmp stdout help.txt
|
|
exec devvm help build
|
|
stdout 'devvm build IMAGE \[flags\]'
|
|
exec devvm build --help
|
|
stdout 'devvm build IMAGE \[flags\]'
|
|
! stub_calls
|
|
|
|
# An unknown flag is a usage error: its message on stderr, then the line
|
|
# naming the command's own help.
|
|
! exec devvm --nope
|
|
cmp stderr nope-flag.txt
|
|
! stdout .
|
|
! exec devvm stop --nope
|
|
stderr '^devvm: flag_unknown command=devvm stop flag=--nope$'
|
|
stderr '^usage_help command=devvm stop$'
|
|
|
|
# So is a command given too many arguments, naming those its help shows.
|
|
! exec devvm build a b
|
|
cmp stderr build-args.txt
|
|
! stdout .
|
|
! stub_calls
|
|
|
|
# devvm takes no word but a command's. A toolchain's, an agent's or a
|
|
# layer's name, or several joined with + or a comma, is a usage error
|
|
# naming devvm's --help that points to the flags choosing them; any other
|
|
# word gets a did-you-mean when a command is close. Nothing runs.
|
|
! exec devvm node
|
|
stderr '^devvm: no_command_part flags=--tools node word=node$'
|
|
stderr '^usage_help command=devvm$'
|
|
! exec devvm claude
|
|
stderr '^devvm: no_command_part flags=--agents claude word=claude$'
|
|
! exec devvm docker
|
|
stderr '^devvm: no_command_part flags=--layers docker word=docker$'
|
|
! exec devvm node+claude
|
|
stderr '^devvm: no_command_part flags=--tools node --agents claude word=node\+claude$'
|
|
stderr '^usage_help command=devvm$'
|
|
mkdir $XDG_CONFIG_HOME/devvm/layers
|
|
cp $WORK/pg.sh $XDG_CONFIG_HOME/devvm/layers/pg.sh
|
|
! exec devvm pg,node
|
|
stderr '^devvm: no_command_part flags=--tools node --layers pg word=pg,node$'
|
|
! exec devvm node+nope
|
|
stderr '^devvm: no_command word=node\+nope$'
|
|
! exec devvm stpo
|
|
stderr '^devvm: no_command_like command=stop word=stpo$'
|
|
stderr '^usage_help command=devvm$'
|
|
! stdout .
|
|
! stub_calls
|
|
|
|
# Flags for a new VM are devvm's alone, so other commands refuse
|
|
# them, before or after the command's name.
|
|
! exec devvm ls --cpus 4
|
|
stderr '^devvm: flag_unknown command=devvm ls flag=--cpus$'
|
|
! exec devvm --cpus 4 ls
|
|
stderr '^devvm: flag_unknown command=devvm ls flag=--cpus$'
|
|
! exec devvm restart --backend lima
|
|
stderr '^devvm: flag_unknown command=devvm restart flag=--backend$'
|
|
! exec devvm tools add node --from node:24
|
|
stderr '^devvm: flag_unknown command=devvm tools add flag=--from$'
|
|
# A backend that isn't one is refused first too.
|
|
! exec devvm build --backend nope base
|
|
stderr '^devvm: backend_unknown backends=lima name=nope$'
|
|
stderr '^usage_help command=devvm build$'
|
|
! stub_calls
|
|
|
|
# No flag or argument takes an empty value to mean none or its default.
|
|
! exec devvm --ports ''
|
|
stderr '^devvm: flag_blank flag=ports$'
|
|
! exec devvm --cpus=
|
|
stderr '^devvm: flag_blank flag=cpus$'
|
|
! exec devvm ''
|
|
stderr '^devvm: arg_blank command=devvm$'
|
|
! exec devvm history export ''
|
|
stderr '^devvm: arg_blank command=devvm history export$'
|
|
! stub_calls
|
|
|
|
-- nope-flag.txt --
|
|
devvm: flag_unknown command=devvm flag=--nope
|
|
usage_help command=devvm
|
|
-- build-args.txt --
|
|
devvm: args_too_many args=IMAGE command=devvm build given=a b
|
|
usage_help command=devvm build
|
|
-- pg.sh --
|
|
set -euo pipefail
|