Bring the runtime up on Windows without disturbing the POSIX paths. PTY: introduce a platform-neutral PtySession contract with a factory that picks NativePty (posix_openpt/posix_spawn) or the new WindowsPty (ConPTY via CreatePseudoConsole). The pane registry programs against the interface; NativePty now implements it. IPC: the per-workspace AF_UNIX socket lives under %LOCALAPPDATA% and is hashed from a canonical workspace key (backslash + ASCII-folded case) so the Dart server and the C client agree despite NTFS case- insensitivity. The C client grows a Win32 shim (winsock afunix); chmod is a no-op on Windows where the per-user ACL is the gate. Toolchain: PATH probing splits on ';' and tries PATHEXT extensions; the shell defaults to PowerShell (pwsh, then powershell); tmux is treated as optional since it has no Windows build; dugite falls back to PATH git for now. Build: add `make build-windows`, a clide-cli MSVC build wrapped by ci/build_cli_windows.sh, and a ConPTY smoke-test suite that self- skips off-platform. Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
1.4 KiB
Bash
34 lines
1.4 KiB
Bash
#!/bin/sh
|
|
# Build the C `clide` client with MSVC on Windows (Git Bash / MSYS).
|
|
# Wrapped by `make clide-cli` — don't run directly (see CLAUDE.md
|
|
# tooling discipline). Finds the VC++ toolset via vswhere, loads the
|
|
# x64 dev environment, compiles:
|
|
# native/clide-cli/clide.c -> native/windows-x64/clide.exe
|
|
# ws2_32.lib supplies winsock (AF_UNIX socket support).
|
|
set -e
|
|
|
|
VSWHERE="/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
|
|
if [ ! -x "$VSWHERE" ]; then
|
|
echo "vswhere.exe not found — install Visual Studio (Build Tools) with the C++ workload" >&2
|
|
exit 1
|
|
fi
|
|
VSROOT=$("$VSWHERE" -products '*' -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | tr -d '\r')
|
|
if [ -z "$VSROOT" ]; then
|
|
echo "no Visual Studio C++ x64 toolset found (vswhere returned nothing)" >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p native/windows-x64
|
|
# A generated .bat sidesteps the unwinnable sh->cmd quote escaping for
|
|
# the space-laden VS path. //c keeps MSYS from path-mangling cmd's /c
|
|
# switch; /Fo drops the .obj next to the .exe so the repo root stays
|
|
# clean.
|
|
BAT=$(mktemp --suffix=.bat)
|
|
trap 'rm -f "$BAT"' EXIT
|
|
cat > "$BAT" <<EOF
|
|
@call "$VSROOT\\Common7\\Tools\\VsDevCmd.bat" -arch=amd64 -no_logo
|
|
@cl /nologo /O2 /W4 /D_CRT_SECURE_NO_WARNINGS native\\clide-cli\\clide.c /Fonative\\windows-x64\\ /Fe:native\\windows-x64\\clide.exe ws2_32.lib
|
|
EOF
|
|
cmd.exe //c "$(cygpath -w "$BAT")"
|
|
rm -f native/windows-x64/clide.obj
|