Repository navigation
Windows support for MudroomCore and the CLI (Docker Desktop, Podman) - #3
Merged
Merged
Conversation
Tests that need mode bits, FIFOs, signals or a pty are skipped on Windows with a reason. New tests cover Docker mount paths, command line quoting, CRLF files, read-only targets, long paths, junctions, Credential Manager and runAttached.
…e test Folders have no execute bit on Windows, so the project check lists the folder instead. Tests closed sockets with the C runtime's close(), which aborts on a socket. Atomic writes retry while an antivirus scan holds the old file. Keep LF endings for the image and shell scripts on Windows checkouts. CI also runs a CLI session end to end and a block-clone test on a ReFS Dev Drive.
…me tests Closing a socket with the request unread resets the connection, and Windows drops the 503 the client hasn't read yet, so drain it first. The long-path test writes through Win32 (FileManager can't create such paths), and control characters in file names are skipped on Windows, which doesn't allow them.
PowerShell drops a bare -- passed to a function, so mudroom new got the command as stray arguments. GitHub's runners can't format a ReFS volume, so the block-clone test stays opt-in.
The request can arrive after the 503 is sent, and closing then resets the connection. Read until the client closes, for at most 250 ms.
…ic write On Windows, Foundation's atomic write failed with a sharing violation when an antivirus scan had the new file open.
Windows has no signal masks or posix_spawn, so start() just runs the process there, and the POSIX-only runAttached tests are skipped.
Kernel-Hunter
force-pushed
the
windows-support
branch
from
October 10, 2026 17:32
9e42a14 to
7e79d2e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This gets MudroomCore and the
mudroomCLI building and working on Windows (x86_64 and arm64), with Docker Desktop or Podman as the sandbox. It's the same setup Linux already has: CLI only, container backend. The macOS app and theappleVM backend stay macOS-only.What changed
Most of the port is in new
*+Windows.swiftfiles next to the POSIX code. Existing files only get small#if os(Windows)branches, so macOS and Linux behave as before.Win32.swift,FileNode+Windows.swift,Cloner+Windows.swift): the same safety rules as the POSIX code. Files are opened without following reparse points, folders are listed through a handle, and every path opened underwork/is checked against its final path, so a link the agent swaps in isn't followed. Symlinks are recreated as symlinks. Junctions and other reparse points show up as special files and are never applied. Paths past MAX_PATH get the\\?\prefix. Windows has no mode bits, so files read as 0644 and folders as 0755. On ReFS the clones use block cloning (FSCTL_DUPLICATE_EXTENTS_TO_FILE); anywhere else they're plain copies.rename,unlink,mkdir,symlink,kill,usleepand a no-opchmodexist as String-path functions that are only built on Windows, so the shared code calls them as before.renamereplaces the target, handles read-only targets, and retries for half a second if an antivirus scan has the file open.Socket+Windows.swift): a WinsockSockwith the same API. EgressProxy now uses a fewSockhelpers (close, receive, poll, wake) instead of raw POSIX calls. On Windows the proxy listens on 127.0.0.1, as it does on macOS with Docker Desktop.ProcessRunner+Windows.swift,WindowsCommandLine.swift):runAttachedusesCreateProcessWand the child inherits only the console handles. Mudroom ignores Ctrl+C while the agent runs, and closing the console window stops thedockerprocess.whichsearches PATH with PATHEXT. Command-line quoting and the environment block are plain string code and are tested on every platform.FileLockusesLockFileEx. Tokens and API keys go to Credential Manager by default (MUDROOM_TOKEN_STORE=filestill works). The store lives in%LOCALAPPDATA%\Mudroom..atomicwrite as before. On Windows it retries the rename while another process has the file open.How it was tested
CI has a new
windowsjob onwindows-latest(x86_64) andwindows-11-arm(arm64) with Swift 6.2.4. It builds, runs the whole test suite, then runsscripts/windows-smoke.ps1. That script drives the built CLI through a full session without a sandbox:new, editwork/,diff,hunks,apply --all,undo,list,discard.Tests that need Unix modes, FIFOs, signals or a pty are skipped on Windows, each with a reason.
WindowsTests.swiftadds tests for what Windows does instead:chmodproducing no diffwork/that is reported but never followedwhich, and exit codes fromrunAttachedMUDROOM_TEST_REFSbecause GitHub's runners failed to format a ReFS volume, so CI skips it.macOS and Linux CI still pass.
Swift 6.2 ships Clang 19, and the Visual Studio 2026 headers on
windows-latestrefuse anything older than Clang 20 when compiling swift-crypto's BoringSSL. The Windows job passes-Xcxx -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH, and the README tells people building from source to do the same.Not supported yet
docker run, the forwarder and locked mode have only been exercised up to the point where Docker would start. Someone with Docker Desktop needs to runmudroom network check --backend dockerand a real session. Podman on Windows hasn't been tried at all.claudeCLI needs a pseudo-terminal.PtyProcesson Windows is a stub that throws until someone writes the ConPTY version.mudroom agent login claudesigns in inside the sandbox instead, andmudroom agent token claudestill takes a pasted token.dockerchild doesn't inherit the runner lock the way it inherits the POSIX descriptor, so the session guard also checks whether the container is still running.The README has a Windows row in the requirements table, build steps, and a section on these differences.
This is rebased on main after #1 and #2. The signal-mask and descriptor handling from #1 is POSIX-only, so it stays off Windows, and the new
ProcessRunnerTests.swiftis skipped there (WindowsTestscoversrunAttachedon Windows).