Skip to content

WIP: Windows support — compile, tests, and Windows releases#52

Draft
srnnkls wants to merge 3 commits into
mainfrom
fix/windows-compat
Draft

WIP: Windows support — compile, tests, and Windows releases#52
srnnkls wants to merge 3 commits into
mainfrom
fix/windows-compat

Conversation

@srnnkls

@srnnkls srnnkls commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Draft / tracking PR for full Windows support. Do not merge until green. The release pipeline (#50) ships Linux+macOS first; this PR adds Windows back once phora actually works there.

Done (verified)

  • Lib compiles on Windows: cfg-gated the revalidate_file TOCTOU identity check (Windows has no stable Metadata file identity — file_index/volume_serial_number are nightly-only — so it returns true and relies on the content-hash safety net); routed copy_tree symlink recreation through the cfg-gated create_symlink.
  • cfg(unix)-gated genuinely Unix-only tests + their exclusive helpers/imports (flushed the full dead-code cascade via a local --cfg phora_win_sim simulation).
  • Compiles + clippy --all-targets clean on Windows; macOS + Linux fully green (unit + scrut).

Remaining

  1. 176 runtime test failures — dominant root cause already found (test-fixture bug, not a phora bug): test config-builder helpers interpolate Windows temp paths (C:\Users\...) into TOML strings, where \U/\T are escape sequences → TOML parse error: too few unicode value digits. Fix the helpers to emit TOML-safe paths (forward slashes, TOML literal '...' strings, or proper serialization). This alone greens a large majority.
    • Smaller cluster: tests hardcoding Unix absolute paths (e.g. /abs/local/repo in sync/transitive.rs:907) that aren't absolute on Windows.
  2. Audit real source path semantics for any genuine (non-test) POSIX assumptions once the fixture noise clears.
  3. Re-add Windows to the release (the "Windows releases" half): x86_64-pc-windows-msvc target + powershell installer in dist-workspace.toml; windows-latest in the ci.yml unit lane. Rebase on merged feat: release pipeline (release-plz + cargo-dist) #50 first.

Current run: 1119 passed, 176 failed on Windows (all the above).

srnnkls added 3 commits June 30, 2026 12:31
phora used Unix-only APIs unconditionally, so it could not build on Windows
(which the release pipeline ships a binary for). Fixes:
- deploy.rs: cfg-gate the revalidate_file TOCTOU identity check — Windows uses
  file_index/volume_serial_number (falls back to the content-hash safety net
  when identity is unconfirmable).
- deploy.rs: route copy_tree symlink recreation through the existing cfg-gated
  create_symlink (symlink_file/symlink_dir on Windows).
- cfg(unix)-gate genuinely Unix-specific tests (symlink/permission semantics).
- ci.yml: cargo unit on ubuntu/macos/windows, scrut integration on ubuntu/macos.

Locking already uses the portable std::fs::File::try_lock; unchanged.
file_index/volume_serial_number are nightly-only (windows_by_handle), so the
Windows same_file_identity arm now returns true (the content-hash check is the
safety net; the inode/dev TOCTOU fast-path stays Unix-only). Gate the
cfg(unix)-test-only imports in sync/mod.rs so -D warnings stays clean on Windows.
After gating Unix-only tests, their exclusive helper fns/consts became dead code
on Windows (denied by -D warnings). Gate the closure: 6 symlink test helpers in
sync/tests.rs and CONFINE_SYMLINK_ANCESTOR in tests/transitive_confine.rs.
@srnnkls
srnnkls marked this pull request as draft June 30, 2026 12:35
@srnnkls srnnkls changed the title fix: Windows compatibility (compile + tests) + 3-OS CI matrix WIP: Windows support — compile, tests, and Windows releases Jun 30, 2026
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