Skip to content

Title: feat(platform): Windows CI — abstract POSIX I/O, portable tests, PRIu64 (#10)#107

Open
jose-compu wants to merge 9 commits into
mainfrom
feature/windows-ci
Open

Title: feat(platform): Windows CI — abstract POSIX I/O, portable tests, PRIu64 (#10)#107
jose-compu wants to merge 9 commits into
mainfrom
feature/windows-ci

Conversation

@jose-compu

Copy link
Copy Markdown
Owner

Summary

Closes #10 — Windows support for milestone 0.13.0.

  • CI: adds windows-latest to the build matrix (Debug + Release) using MSVC via ilammy/msvc-dev-cmd, Ninja via choco, platform-split test/CLI invocation steps, and $env:RUNNER_TEMP for the smoke-test path
  • Tests: replaces all 75 hardcoded /tmp/ paths with a tmp_path() helper backed by std::filesystem::temp_directory_path(); guards POSIX headers (<unistd.h>, <fcntl.h>); fixes popen/pclose_popen/_pclose; wraps the WAL corruption test in _WIN32 guards using _open/_write/_commit/_close
  • CMakeLists: MSVC compile flags (/utf-8, /EHsc, /W3), _CRT_SECURE_NO_WARNINGS, fuzz guard extended to WIN32
  • CLI: replaces all %llu / (unsigned long long) with PRIu64 from <cinttypes>
  • README: adds Windows build instructions for both Ninja+MSVC and the VS generator

Test plan

  • CI passes on ubuntu-latest, macos-latest, windows-latest (Debug + Release)
  • All 59 doctest cases pass locally on macOS (verified before push)
  • Smoke test (logosdb-cli info) runs on all three OS runners

- ci.yml: add windows-latest matrix entry with ilammy/msvc-dev-cmd,
  Ninja via choco, platform-split test/CLI steps, and RUNNER_TEMP
  smoke path
- CMakeLists.txt: MSVC /utf-8 /EHsc /W3 flags, CRT deprecation
  suppressions, fuzz guard extended to WIN32
- tests: replace all /tmp/ paths with std::filesystem::temp_directory_path()
  helper; guard POSIX headers; fix popen/pclose; wrap WAL corruption
  test in _WIN32 guards
- tools/logosdb-cli.cpp: replace %llu with PRIu64 (cinttypes)
- README: add Windows build instructions

Milestone: 0.13.0
Co-authored-by: Cursor <cursoragent@cursor.com>
@jose-compu jose-compu added this to the 0.13.0 milestone May 17, 2026
@jose-compu jose-compu self-assigned this May 17, 2026
jose-compu and others added 8 commits May 17, 2026 14:19
- ci.yml: add windows-latest matrix entry with ilammy/msvc-dev-cmd,
  Ninja via choco, platform-split test/CLI steps, and RUNNER_TEMP
  smoke path
- CMakeLists.txt: MSVC /utf-8 /EHsc /W3 flags, CRT deprecation
  suppressions, fuzz guard extended to WIN32
- tests: replace all /tmp/ paths with std::filesystem::temp_directory_path()
  helper; guard POSIX headers; fix popen/pclose; wrap WAL corruption
  test in _WIN32 guards
- tools/logosdb-cli.cpp: replace %llu with PRIu64 (cinttypes)
- README: add Windows build instructions

Milestone: 0.13.0
Co-authored-by: Cursor <cursoragent@cursor.com>
On Windows, CreateFileA and the CRT ::open both default to omitting
FILE_SHARE_DELETE, which prevents std::filesystem::remove_all from
deleting a file while any handle to it is open — even from the same
process.  POSIX allows unlinking open files (the inode lives until
the last fd closes), so tests that call remove_all while the logosdb
handle is still in scope pass on Linux/macOS but throw on Windows.

Fix every Windows file open:
- platform.cpp: add FILE_SHARE_DELETE to both CreateFileA calls
  (mmap_open and mmap_reserve).
- storage.cpp / metadata.cpp / wal.cpp: replace ::open with
  _sopen_s(..., _SH_DENYNO, ...) so the CRT handle also carries
  delete-sharing, mirroring POSIX unlink semantics.
On Windows, CreateFileA and the CRT ::open both default to omitting
FILE_SHARE_DELETE, which prevents std::filesystem::remove_all from
deleting a file while any handle to it is open — even from the same
process.  POSIX allows unlinking open files (the inode lives until
the last fd closes), so tests that call remove_all while the logosdb
handle is still in scope pass on Linux/macOS but throw on Windows.

Fix every Windows file open:
- platform.cpp: add FILE_SHARE_DELETE to both CreateFileA calls
  (mmap_open and mmap_reserve).
- storage.cpp / metadata.cpp / wal.cpp: replace ::open with
  _sopen_s(..., _SH_DENYNO, ...) so the CRT handle also carries
  delete-sharing, mirroring POSIX unlink semantics.
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.

Windows support: abstract POSIX file I/O behind a portable layer

1 participant