Skip to content

Fix native Windows/MSYS2 compatibility - #60

Open
chris241 wants to merge 1 commit into
unclebob:mainfrom
chris241:windows-msys2-compat
Open

Fix native Windows/MSYS2 compatibility#60
chris241 wants to merge 1 commit into
unclebob:mainfrom
chris241:windows-msys2-compat

Conversation

@chris241

Copy link
Copy Markdown

Summary

SwarmForge's runnable path had never been exercised on native Windows before. Running the two-pack workflow end-to-end on Windows 11 with MSYS2 (zsh + tmux + native Babashka, no WSL) surfaced three concrete bugs, all in main's shared swarmforge/scripts/:

  • fs/set-posix-file-permissions throws UnsupportedOperationException on NTFS through a native (non-Cygwin) Babashka build. POSIX permission bits aren't meaningful on Windows, so the call is now wrapped in try/catch and ignored there.
  • handoffd.bb, swarm-window-watchdog.sh, and pack_web.sh were invoked directly as programs, relying on their #!/usr/bin/env ... shebang line. Native Windows process creation does not interpret shebangs (only Cygwin/MSYS2 shells do), so each of these three call sites now runs through an explicit interpreter (bb / zsh) — matching how every other script invocation in this codebase already works (e.g. stop_handoff_daemon.bb is already called as bb ... stop_handoff_daemon.bb).

Also documents MSYS2 as a native-Windows install path (no WSL required) in the README, alongside the existing WSL-oriented Windows Terminal notes.

Test plan

  • Installed MSYS2 (zsh, tmux, git) + native Babashka + the claude CLI on Windows 11.
  • Ran get-swarm-forge two-pack claude then ./swarm from an MSYS2 zsh shell against a real project directory.
  • Confirmed the dashboard started (Dashboard: http://127.0.0.1:...), both coder and cleaner tmux sessions launched, the handoff daemon started, and the coder role's claude agent process was invoked correctly inside its tmux pane.
  • Confirmed the same fixes don't change behavior on the intended platforms (the try/catch only swallows UnsupportedOperationException; the interpreter prefixes match the existing pattern used elsewhere in the file).

babashka.fs/set-posix-file-permissions throws UnsupportedOperationException
on NTFS via native (non-Cygwin) babashka builds; catch it and continue since
POSIX permission bits are not meaningful on Windows anyway.

handoffd.bb, swarm-window-watchdog.sh, and pack_web.sh were invoked directly
as programs relying on their shebang lines. Native Windows process creation
does not interpret shebangs, so these now run through an explicit
interpreter (bb / zsh) as every other script invocation in this codebase
already does.

Documents MSYS2 as a native-Windows path (no WSL required) in the README.
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