Windows: FileLock (and other Path.hpp primitives) are unsupported on _WIN32 #66

Open
opened 2026-12-05 22:35:54 +00:00 by faumaray · 0 comments
Owner

Context

VoidBuildSystem now builds for the Windows target (MinGW-w64 GCC 16.2) against this repository's main (482a3ea46b0050ec07f5063fd319e66180b4d2e4). Void_Configuration, Void_Crypto, Void_System and Void_Archive all compile and link, and the VBS binary runs under Wine.

Remaining Windows gaps in include/Void/System/Path.hpp (all return unsupported under _WIN32):

  • FileLock (lock/try_lock): the StateStore, editor selection locks and workspace locks cannot open on Windows. This is the main blocker - vbs gc reports FileSystem::FileLock: unsupported platform.
  • atomic_symlink_swap: editor compilation-database selection cannot switch generations.
  • set_timestamps_nofollow / canonical mtime: snapshot timestamp canonicalization falls back.
  • reflink_copy_file: VBS already falls back to a plain copy, so this is only a performance gap.

Requests

  1. Implement FileLock on Windows, e.g. CreateFileW + LockFileEx/UnlockFileEx (shared locks omit LOCKFILE_EXCLUSIVE_LOCK; non-blocking adds LOCKFILE_FAIL_IMMEDIATELY and reports ERROR_LOCK_VIOLATION as busy).
  2. Best-effort Windows implementations for atomic_symlink_swap (or an explicit documented limitation) and set_timestamps_nofollow (SetFileTime on a handle).
  3. Optionally a reflink/FSCTL_DUPLICATE_EXTENTS_TO_FILE path for NTFS.

Reproduction

Cross-build VBS for Windows and run any command that opens the state store, e.g. vbs gc --build-dir DIR (under Wine or MSYS2 UCRT64).

VBS tracks this as part of its Track C3 Windows port.

## Context VoidBuildSystem now builds for the Windows target (MinGW-w64 GCC 16.2) against this repository's `main` (`482a3ea46b0050ec07f5063fd319e66180b4d2e4`). `Void_Configuration`, `Void_Crypto`, `Void_System` and `Void_Archive` all compile and link, and the VBS binary runs under Wine. Remaining Windows gaps in `include/Void/System/Path.hpp` (all return `unsupported` under `_WIN32`): - **`FileLock`** (`lock`/`try_lock`): the StateStore, editor selection locks and workspace locks cannot open on Windows. This is the main blocker - `vbs gc` reports `FileSystem::FileLock: unsupported platform`. - **`atomic_symlink_swap`**: editor compilation-database selection cannot switch generations. - **`set_timestamps_nofollow`** / canonical mtime: snapshot timestamp canonicalization falls back. - **`reflink_copy_file`**: VBS already falls back to a plain copy, so this is only a performance gap. ## Requests 1. Implement `FileLock` on Windows, e.g. `CreateFileW` + `LockFileEx`/`UnlockFileEx` (shared locks omit `LOCKFILE_EXCLUSIVE_LOCK`; non-blocking adds `LOCKFILE_FAIL_IMMEDIATELY` and reports `ERROR_LOCK_VIOLATION` as busy). 2. Best-effort Windows implementations for `atomic_symlink_swap` (or an explicit documented limitation) and `set_timestamps_nofollow` (`SetFileTime` on a handle). 3. Optionally a reflink/`FSCTL_DUPLICATE_EXTENTS_TO_FILE` path for NTFS. ## Reproduction Cross-build VBS for Windows and run any command that opens the state store, e.g. `vbs gc --build-dir DIR` (under Wine or MSYS2 UCRT64). VBS tracks this as part of its Track C3 Windows port.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#66