mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
A folder named x--y, "foo (copy)" or "C++ stuff" failed to get a VM (#52): project.Slug turned each character other than a-z and 0-9 into its own dash, and Lima's instance-name grammar refuses separators in a row. Slug now writes one dash per run. - vmname: the project-VM grammar refuses dashes in a row ([a-z0-9]+(-[a-z0-9]+)*); HasRuns recognises the names releases up to 0.1.1-rc.3 made for such folders. - state: a vm.json whose name HasRuns and that has no created time is read as no state. Only a create that Lima refused leaves one (vm.json is written before limactl clone), so the folder's next VM, in the same hash folder, replaces it, rather than every read failing as corrupt. One with created set is still corrupt. - The limactl stub refuses names Lima refuses on create and clone; TestLimactlStubContract gains a refused clone, checked against real Lima. - Tests: TestNamesLimaTakes (Lima's regex as the oracle), TestHasRuns, TestVMWithRuns, TestLimactlRefusesNames, name_runs.txtar (a new VM for x--y, and an older release's leftover state replaced). - Docs: internals/backends.md's VM names; CHANGELOG Unreleased Fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
# A folder whose name has separators in a row gets a VM: each run becomes
|
|
# one dash in its VM's name, as Lima refuses separators in a row.
|
|
project x--y
|
|
exec devvm --network open
|
|
stdout '^==> creating_from image=base vm=devvm-x-y-[0-9a-f]{14}$'
|
|
vm_name XY x-y
|
|
stub_calls
|
|
stdout '^limactl clone --tty=false devvm-img-[0-9a-f]{12} devvm-x-y-[0-9a-f]{14} '
|
|
|
|
# The state an older release left in the folder's VM folder, of a VM it
|
|
# began making as devvm-x--y-<hash>, which Lima refused: no VM, so devvm
|
|
# makes the folder's VM in its place, by its name now, and ls lists only
|
|
# that one.
|
|
exec devvm rm --force --no-export
|
|
! exists $XY_dir/vm.json
|
|
exec sh $WORK/leftover.sh $WORK/x--y
|
|
exec devvm ls
|
|
! stdout 'devvm-x--y'
|
|
! stderr .
|
|
exec devvm --network open
|
|
stdout '^==> creating_from image=base vm='$XY'$'
|
|
! stderr corrupt
|
|
vm_state $XY_dir/vm.json
|
|
stdout '^name='$XY'$'
|
|
stdout '^alias=devvm-x-y$'
|
|
exec devvm ls
|
|
stdout $XY
|
|
! stdout 'devvm-x--y'
|
|
|
|
-- leftover.sh --
|
|
mkdir -p "$XY_dir"
|
|
printf '{"version":1,"id":"x","name":"devvm-x--y-%s","alias":"devvm-x--y","image":"base","dir":"%s","backend":"lima","net":{"tier":"open"}}\n' "${XY##*-}" "$1" > "$XY_dir/vm.json"
|