mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
QEMU migration state isn't portable across accelerators — a KVM-captured snapshot won't resume under HVF, and `-cpu max` feature sets differ across hosts. Instead of trying to match every (KVM/HVF/TCG, amd64/arm64) combination in CI, capture the snapshot on the user's own machine during `stack emulator pull`: download the qcow2, cold-boot once, wait for all services, QMP migrate via mapped-ram + multifd, compress. Subsequent `stack emulator start`s fast-resume in ~3-8s as before. - Factor qmp_session + capture_vm_state out of build-image.sh into common.sh so run-emulator.sh can call them. - Add cmd_capture to run-emulator.sh. build_qemu_cmd emits the resume-compatible device layout (phantom ISOs, no virtfs, fsdev + pcie-root-port, pinned 4096MB/4CPU) with -incoming defer gated on an actual snapshot being present, so capture mode reuses the same path. - Capture regenerates runtime-config.iso with STACK_EMULATOR_VM_DIR_HOST empty — virtfs is detached for migration compat so /host isn't mounted; the `install internal-pck → /host/$VM_DIR_HOST` path would otherwise fail and restart-loop stack.service. Mirrors build-image.sh's CI runtime.env shape. - stack-cli `pull` downloads only the qcow2 then invokes run-emulator.sh capture. Add --skip-snapshot for CI/debug. startEmulator auto-captures on the auto-pull fallback. - Revert the arm64 CI split: delete qemu-emulator-build-arm64.yaml, restore arm64 to the unified matrix on ubicloud-standard-8 under cross-arch TCG (macOS HVF runner existed only to produce a portable snapshot; no longer needed). Drop savevm.zst from package/upload/publish steps; update release notes. Verified end-to-end on an arm64 Mac under HVF: capture 50s, fast-resume 6.5s, all services green. |
||
|---|---|---|
| .. | ||
| commands | ||
| lib | ||
| index.ts | ||