Skip to content

DO NOT MERGE: plain-Windows integration check - #5343

Draft
jandubois wants to merge 6 commits into
lima-vm:masterfrom
jandubois:integration-windows-plain
Draft

DO NOT MERGE: plain-Windows integration check#5343
jandubois wants to merge 6 commits into
lima-vm:masterfrom
jandubois:integration-windows-plain

Conversation

@jandubois

@jandubois jandubois commented Jul 26, 2026

Copy link
Copy Markdown
Member

This branch exists only to run the tests in CI proving that they are green once all PRs have been merged.

Cherry-picked onto master in this order:

#5299 and #5337 both append a test to the end of pkg/copytool/copytool_test.go, so that one file took a union resolution; every other pick applied cleanly.

Once the individual PRs have been merged, this PR should be closed.

Assisted-by: Claude Opus 5

On Windows, `limactl copy` converted host paths to the Cygwin/MSYS form
no matter which tool would consume them, and it passed ControlMaster
options unconditionally. Native OpenSSH cannot use that path form and
has no multiplexing, so scp failed with "getsockname failed".

The two backends need different path forms. scp takes whatever its own
toolchain uses, while rsync on Windows is always Cygwin-based and reads
a drive letter as a hostspec. So every path now takes the form of the
binary that reads it, operands and ssh options alike, because scp hands
its options to the ssh beside itself while rsync hands them to the ssh
it names.

Both backends now skip multiplexing on Windows, so they stop building
a control socket path they never use.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
A path naming an instance that does not exist reached the user as
"neither rsync nor scp found on host", because the auto backend
discarded the parse error, skipped rsync, and reported whatever the scp
fallback said. Only a host without scp saw that message; everywhere else
the auto backend built the copy tool without complaint and the real
error surfaced later, from the copy command itself. The explicit rsync
backend reduced the same error to "rsync not available on guest(s)".

The fallback message no longer guesses which tool is missing, since
rsync may well have been found and rejected for another reason.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
The sftp-server that serves a mount and the host path handed to it now
come from one install, the one holding the ssh.exe Lima selected at
startup. Otherwise sshocker picks an sftp-server off PATH that may come
from a different toolchain than the one the path was converted for, and
cannot resolve what it is given.

The builtin driver instead gets the native form, because sshocker serves
that one in-process, where a Cygwin path resolves to the wrong directory.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
`--sync` refuses a directory too close to the filesystem root, but on
Windows it measured a path already converted to the /c/... form while
still splitting on backslashes. Every directory counted as depth 1, so
`--sync` could not run there at all. Measuring the native path keeps one
threshold meaning the same thing everywhere.

Only Windows separates on a backslash. Elsewhere it is an ordinary
filename character, and counting it as a separator would score a
directory just below the root deep enough to pass, so the caller now
says which form it holds rather than leaving it implied.

That guard was also the only thing stopping `--sync` when the conversion
failed or returned nothing, because the empty string scored 1. Both now
need their own error. An empty directory reaches rsync as the toolchain
root, and with stdout not a terminal the sync back runs `--delete`
against it unprompted.

A wsl2 guest already reaches the host directory through the /mnt
automount, so `--sync` cannot isolate it from host files there. It now
refuses that combination up front.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
Lima now supports native Windows OpenSSH alongside the Cygwin-based
toolchains, and the two differ in which binaries they ship, which path
form they produce, and where their sftp-server lives. Document what to
install, how Lima picks between them, and what changes for reverse-sshfs
mounts.

Also replace the Known Issues bullet that claimed Windows ships no
ssh.exe. Lima unpacks a .tar.gz rootfs itself, so only xz, bzip2, and
zstd archives still need an external binary.

These pages describe the state after the copytool and reverse-sshfs
support lands, so this should merge after those.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
@jandubois
jandubois force-pushed the integration-windows-plain branch from 9e78f46 to b6e01fb Compare July 28, 2026 03:01
Move the Windows runner setup out of test.yml into reusable composite
actions, and add windows-plain-{wsl2,qemu} jobs that run Lima on a host
with Git for Windows, MSYS2, and Cygwin removed. The plain-host action
checks the toolchain is gone across filesystem, PATH, known binaries,
and registry, and that the native OpenSSH client is present, so a
runner-image change in either direction fails loudly instead of masking
a regression.

The plain-host check can prove the OpenSSH binaries exist but not which
ssh limactl will resolve, so the selection rules gain unit tests next to
the code that implements them.

With test.yml no longer setting _LIMA_WINDOWS_EXTRA_PATH, that env var
loses its last user, so drop the implementation and its docs entry. It
prepended C:\Program Files\Git\usr\bin to limactl's PATH, which is how
the MSYS2 jobs got a Cygwin ssh.

The MSYS2 jobs install openssh in its place, so they keep exercising the
Cygwin toolchain while the plain jobs exercise the native one. They also
gain rsync. Without it hack/test-templates.sh skips its rsync copy
backend instead of failing, so the path conversion that backend performs
on Windows never runs.

The "windows" job id becomes "windows-wsl2". Its name: is unchanged, so
required status checks are unaffected.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
@jandubois
jandubois force-pushed the integration-windows-plain branch from b6e01fb to b8016ef Compare July 29, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant