Expand description
Optional session-scoped VM execution (γ CLI / β sidecar): host SessionHolder::Host, Unix γ SessionHolder::Gamma.
Re-exports§
pub use sync::pull_workspace_to_vfs;pub use sync::push_full;pub use sync::push_incremental;pub use sync::VmSyncError;
Modules§
- sync
- Push/pull between VFS and a persistent host workspace directory (session VM staging).
Structs§
- Gamma
Session - Lima-backed session: sync VFS ↔ host workspace, run tools inside the VM.
- Host
Sandbox Session - Runs
rustup/cargovia temp directory export + sync (no persistent VM). - Lima
Guest FsOps - Owns a γ
GammaSessionforGuestFsOpstests and harnesses (delegates toGuestFsOpsforGammaSession). - Mock
Guest FsOps - In-memory
GuestFsOpsfor unit tests (no VM). - VmConfig
- Parsed VM-related environment.
Enums§
- Guest
FsError - Errors from
GuestFsOps(guest path / remote command). - Session
Holder - Active VM / sandbox backend for one REPL or script run.
- VmError
- Errors from VM session operations.
- Workspace
Mode - How the devshell workspace is backed: memory VFS + push/pull (
WorkspaceMode::Sync) vs guest-primary (WorkspaceMode::Guest, planned).
Constants§
- ENV_
DEVSHELL_ VM DEVSHELL_VM— Release / binary default: unset means on (use VM backend perENV_DEVSHELL_VM_BACKEND). Set tooff/0/false/no(case-insensitive) to use only the host temp sandbox.on/1/true/yesalso enable VM mode.- ENV_
DEVSHELL_ VM_ AUTO_ BUILD_ ESSENTIAL - When unset or truthy (default): after the VM is running, probe for
gccin the guest and, if missing, tryapt-get install -y build-essentialvia non-interactivesudo(requires NOPASSWD or equivalent). Set to0/false/no/offto skip. - ENV_
DEVSHELL_ VM_ AUTO_ BUILD_ TODO_ GUEST - When
1/true/yes: if guest lackstodobut Cargo workspace is under the Lima mount, runcargo build -p xtask --release --bin todoin the guest (slow; needscargo+ toolchain). Default: off. - ENV_
DEVSHELL_ VM_ AUTO_ TODO_ PATH - When unset or truthy (default): if
target/releasefromcargo metadata(host cwd) lies under the Lima workspace mount, prepend that path in the guest toPATHwhenexec limactl shellsotodoworks without an extra mounts entry. Set to0/false/no/offto skip. - ENV_
DEVSHELL_ VM_ BACKEND - Backend selector:
host,auto,lima,beta, … - ENV_
DEVSHELL_ VM_ BETA_ SESSION_ STAGING - When set (non-empty), β
session_startsends this string asstaging_dirto the sidecar instead ofcanonicalize(DEVSHELL_VM_WORKSPACE_PARENT / …). Use a POSIX path visible to the sidecar process (e.g./workspaceinside a Podman/WSL Linux container) whileDEVSHELL_VM_WORKSPACE_PARENTon the host remains the real Windows path for push/pull. Seedocs/devshell-vm-windows.md(Podman). - ENV_
DEVSHELL_ VM_ CONTAINER_ IMAGE - Windows β: OCI image used when no host Linux
devshell-vmELF is found:podman run -iwith--serve-stdioand the workspace mounted at/workspace(no host TCP). Default:ghcr.io/tangcan/xtask_todo/devshell-vm:v{CARGO_PKG_VERSION}(published by CI on release). - ENV_
DEVSHELL_ VM_ DISABLE_ PODMAN_ SSH_ HOME - When set (any value), do not isolate
USERPROFILE/HOMEforpodmansubprocesses (Windows). By default we pointUSERPROFILE(Go’sUserHomeDir()on Windows — not onlyHOME) at a writable temp “profile” with an empty default.ssh/known_hosts, so a locked, protected, or invalid%USERPROFILE%\.ssh\known_hostsis not read. An existing Podman Machine dir is symlinked in when possible (seepodman_machine.rs). - ENV_
DEVSHELL_ VM_ EAGER - When
1/true/yes, start the VM session eagerly (future γ); default is lazy start on first rust tool. - ENV_
DEVSHELL_ VM_ GUEST_ HOST_ DIR - Name of a symlink in the guest
$HOMEpointing at the hostcurrent_dirproject (default:host_dir). Set to0/false/off/noto skip$HOME/<name>and~/.todo.jsonsymlinks (stillcdinto the guest project when under the workspace mount). - ENV_
DEVSHELL_ VM_ GUEST_ TODO_ HINT - When unset or truthy (default): before
limactl shell, probe guest fortodoand print install hints if missing. Set to0/false/no/offto skip. - ENV_
DEVSHELL_ VM_ GUEST_ WORKSPACE - Guest mount point for that directory (default
/workspace). - ENV_
DEVSHELL_ VM_ LIMACTL - Override path to
limactl(default:PATH). - ENV_
DEVSHELL_ VM_ LIMA_ HINTS - Set to
0/false/no/offto silence Lima configuration hints. - ENV_
DEVSHELL_ VM_ LIMA_ INSTANCE - Lima instance name for γ (
limactl shell <name>). - ENV_
DEVSHELL_ VM_ LINUX_ BINARY - Windows β: optional full Windows path to the Linux
devshell-vmbinary (x86_64-unknown-linux-gnu/ ELF) forpodman machine sshtransport. - ENV_
DEVSHELL_ VM_ REPO_ ROOT - Windows β: optional Windows path to an xtask_todo repository root (directory containing
containers/devshell-vm/Containerfile). Locatestarget/x86_64-unknown-linux-gnu/release/devshell-vmwhenENV_DEVSHELL_VM_LINUX_BINARYis unset. Useful if you keep a checkout for building the sidecar but runcargo devshellfrom other directories; not applicable when you only have a crates.io install and no clone. - ENV_
DEVSHELL_ VM_ SKIP_ PODMAN_ BOOTSTRAP - When set (any value), skip
podman machine sshbootstrap on Windows: no Podman check / no requirement that the Linuxdevshell-vmbinary exists (tests or fully manual β setup). - ENV_
DEVSHELL_ VM_ SOCKET - Unix socket path for β client ↔
devshell-vm --serve-socket(see IPC draft). - ENV_
DEVSHELL_ VM_ STDIO_ TRANSPORT - Windows β: stdio transport for
DEVSHELL_VM_SOCKET=stdio:auto(default),machine-ssh(host ELF +podman machine ssh), orpodman-run(OCI image +podman run -i). - ENV_
DEVSHELL_ VM_ STOP_ ON_ EXIT - When set truthy, run
limactl stopon session shutdown. - ENV_
DEVSHELL_ VM_ WORKSPACE_ MODE DEVSHELL_VM_WORKSPACE_MODE—sync(default) orguest(Mode P; guest filesystem as source of truth).- ENV_
DEVSHELL_ VM_ WORKSPACE_ PARENT - Host directory we push/pull (must be mounted at
super::GammaSession::guest_mountin the Lima VM). - ENV_
DEVSHELL_ VM_ WORKSPACE_ USE_ CARGO_ ROOT - When unset or truthy (default): if
ENV_DEVSHELL_VM_WORKSPACE_PARENTis unset, resolve the host workspace directory fromcargo metadatain the current directory (Cargo workspace root), socargo-devshellstarted from a checkout mapscwd↔ guest under the same mount prefix. Set to0/false/no/offto use the legacy default (…/vm-workspace/<instance>/under the devshell export cache).
Traits§
- Guest
FsOps - Operations on the guest filesystem (Mode P). Paths are guest absolute paths (e.g.
/workspace/foo). - VmExecution
Session - Abstraction for a devshell execution session (host temp dir, γ VM, or β sidecar).
Functions§
- export_
devshell_ workspace_ root_ env - guest_
path_ is_ under_ mount - True if
pathismountor a strict descendant (after normalization).mountis e.g./workspace. - guest_
project_ dir_ on_ guest - Guest directory for the current logical cwd (γ layout:
guest_mount+ last segment oflogical_cwd). Same rule asguest_dir_for_cwd_innerinsession_gamma/ push layout. - normalize_
guest_ path - Lexically normalize an absolute Unix-style path (no symlink resolution).
- should_
delegate_ lima_ shell - try_
session_ rc - Build
SessionHolderfrom the environment. On failure (e.g. default γ Lima butlimactlmissing), writes tostderrand returnsErr(()). UseDEVSHELL_VM=offorDEVSHELL_VM_BACKEND=hostto force the host temp sandbox. - try_
session_ rc_ or_ host - Like
try_session_rc, but on failure usesSessionHolder::Hostso the REPL can run againstworkspace_parent_for_instance(same tree as the Lima mount). - vm_
workspace_ host_ root - Host directory that Lima mounts at the guest workspace (e.g.
/workspace). - workspace_
mode_ from_ env - Read
ENV_DEVSHELL_VM_WORKSPACE_MODEfrom the environment. - workspace_
parent_ for_ instance - Host workspace root shared with the VM / β staging tree (see
docs/devshell-vm-gamma.md).