Skip to content

Fix Windows tunnel runtime support#704

Open
d42me wants to merge 1 commit into
mainfrom
fix/windows-tunnel-runtime
Open

Fix Windows tunnel runtime support#704
d42me wants to merge 1 commit into
mainfrom
fix/windows-tunnel-runtime

Conversation

@d42me
Copy link
Copy Markdown
Contributor

@d42me d42me commented Jun 2, 2026

Summary

  • add Windows frpc downloads with verified checksums and zip extraction
  • select frpc.exe on Windows while preserving existing Unix binary behavior
  • replace POSIX-only fcntl startup polling with the existing pipe-drain thread path so tunnel startup can detect frpc success/failure on Windows

Stacked on

Tests

  • uv run pytest packages/prime-tunnel/tests packages/prime/tests/test_windows_cli.py -q
  • uv run ruff check packages/prime-tunnel/src/prime_tunnel/binary.py packages/prime-tunnel/src/prime_tunnel/tunnel.py packages/prime-tunnel/tests/test_binary.py packages/prime-tunnel/tests/test_tunnel.py
  • uv run ruff format --check packages/prime-tunnel/src/prime_tunnel/binary.py packages/prime-tunnel/src/prime_tunnel/tunnel.py packages/prime-tunnel/tests/test_binary.py packages/prime-tunnel/tests/test_tunnel.py
  • uv run ty check packages/prime-tunnel/src/prime_tunnel/binary.py packages/prime-tunnel/src/prime_tunnel/tunnel.py packages/prime-tunnel/tests/test_binary.py packages/prime-tunnel/tests/test_tunnel.py
  • PRIME_DISABLE_VERSION_CHECK=1 uv run prime --help
  • PRIME_DISABLE_VERSION_CHECK=1 uv run prime tunnel --help

Note

Medium Risk
Changes tunnel bootstrap and binary install paths on all platforms (startup ordering and log capture), though behavior is intended to stay equivalent on Unix; new external downloads add supply-chain surface on Windows.

Overview
Adds Windows support for the frpc client used by prime-tunnel.

Binary delivery: Windows amd64/arm64 release zips are downloaded with SHA256 verification, extracted via zipfile, and installed as frpc.exe. Platform detection now normalizes AMD64/ARM64 on Windows; Unix tar.gz paths still resolve to frpc.

Tunnel startup: Connection readiness no longer relies on POSIX fcntl non-blocking reads. Startup begins pipe-drain threads earlier, captures stdout/stderr into _output_lines while _capture_startup_output is set, and _wait_for_connection scans that buffered output for success/failure strings—so the same logic works on Windows.

Tests cover Windows arch mapping, frpc.exe path selection, zip extraction, and success detection via the drain path.

Reviewed by Cursor Bugbot for commit 93256a9. Bugbot is set up for automated code reviews on this repo. Configure here.

@d42me d42me force-pushed the fix/windows-cli-startup-minimal branch from 255043e to 6fcf85f Compare June 2, 2026 01:32
Base automatically changed from fix/windows-cli-startup-minimal to main June 2, 2026 01:49
@d42me d42me force-pushed the fix/windows-tunnel-runtime branch from 8a6642d to 93256a9 Compare June 2, 2026 01:52
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