Skip to content

Windows support: compile and run natively on x86_64-pc-windows-msvc #16

Description

@gqf2008

Goal

Make walgit build and run natively on Windows today's host toolchain (x86_64-pc-windows-msvc, Rust 1.97.1): core production crates currently fail to compile because several Unix-only APIs are used without #[cfg] gates.

Why

The server story is Linux-first, but contributors run Windows; nothing even type-checks there today, so portability can silently rot further. Containers remain the recommended deployment shape — this issue is about the code no longer being un-buildable off POSIX.

Batch checklist

  • walgit-wal/src/registry.rs: hard-link-aware dir_size (MetadataExt dev/ino/nlink) and disk_usage (libc::statvfs) are ungated Unix code — add per-OS implementations behind cfg
  • Unix symlink creation ungated (walgit-wal/src/sync.rs, walgit-cli/src/import_direct.rs, walgit-server/src/rebuild.rs incl. its statvfs free-space probe) — converged into a new platform seam, crates/walgit-wal/src/platform.rs
  • walgit-server/src/tls.rs: POSIX permission bits on key/session files need gating (already gated; verified)
  • D39 paths: cache.dir default /tmp/walgit and the --config /dev/null sentinel are POSIX-shaped
  • Tests spawning sh / using PermissionsExt / libc::rusage: gate or cross-platformize (git_pipe buffered pipes ×4 suites; symmetric cfg gates; detect-and-speak skips)
  • .cargo/config.toml: GIT_CONFIG_GLOBAL=/dev/null on Windows — kept single-valued with a truthful note (git reads an unopenable global config as empty); constant-exercised by every cargo-spawned git in the suite
  • CI: a Windows leg must compile/run every new cfg(windows) branch (reachability rule: no ungated-but-unbuilt branches)
  • Docs reflect supported platforms

Plus one find the audit could not have predicted: remove_pack now releases this process's own pre-warmed odb index mappings before deleting and rides out a brief scanner lock with a bounded retry — refresh() mmaps every idx by design and, unlike Unix, Windows refuses to delete a mapped file.

Acceptance

  1. On Windows (Win10, rustc 1.97.1 msvc): fast tier green — 185 lib/bins + 168 integration + 38 server tests, 0 failures; zero new clippy findings on touched files.
  2. On Ubuntu: POSIX branches byte-for-byte unchanged by construction (#[cfg(unix)] twins of every changed seam); existing CI tiers untouched.

Non-goals left open here:

  • workspace-wide clippy -D warnings fails on main independent of OS (strict-gate pedantic debt landed on main red);
  • just e2e / sim suites not yet ported (the shebang-shim test is unix-only by mechanism).

Branch: windows-port on @gqf2008's fork (commit 8a5aa2e). Upstream PR awaits maintainer authorization per contributor policy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions