Skip to content

feat(platform): declare Windows + macOS support (classifiers, CI matrix, README)#371

Merged
HumanBean17 merged 3 commits into
masterfrom
feat/windows-platform-support
Jul 4, 2026
Merged

feat(platform): declare Windows + macOS support (classifiers, CI matrix, README)#371
HumanBean17 merged 3 commits into
masterfrom
feat/windows-platform-support

Conversation

@HumanBean17

@HumanBean17 HumanBean17 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Update (commit 2) — Windows CI surfaced two real product bugs

The first Windows run failed (40 failed + 11 errors). Root-caused and fixed (not skipped):

  1. _fdlimit.pyimport resource at module scope. The resource module is Unix-only, so the import raised ModuleNotFoundError on Windows. Because both cli.py and server.py import raise_fd_limit, the entire CLI and MCP server failed to start on Windows. Guarded the import (try/except → None); the function already no-ops when RLIMIT_NOFILE is absent. test_fd_limit skipped on win32 (it asserts Unix rlimit behaviour).
  2. build_ast_graph.pydb.close() never called. All 8 cleanup paths in incremental_rebuild + write_ladybug closed the Connection but leaked the Database handle. Windows uses mandatory file locking, so the leaked handle holds the .lbug lock and the next open fails with "Error 33: another process has locked a portion of the file." This broke real init/increment on Windows, not just tests. Added db.close() after every conn.close(); same leak fixed in 4 tests that opened their own handle.

macOS leg passes; verified locally that the 53 affected tests pass on macOS (serial) — no regression. Pushing to re-run Windows.


Scope

Make Windows a first-class, officially-declared supported platform (alongside macOS). A pre-PR audit confirmed the tool already runs on Windows — every native dependency ships win_amd64 wheels and the Python path is portable — but nothing declared or verified it. This PR closes the packaging / CI / docs gap and fixes the two real Windows bugs the new CI leg exposed.

What Changed

  • pyproject.tomlOperating System :: POSIX :: Linux, :: MacOS :: MacOS X, :: Microsoft :: Windows classifiers.
  • .github/workflows/test.yml — 3-OS matrix (ubuntu/macos/windows-latest). Ubuntu is the required gate; macOS + Windows are continue-on-error + fail-fast: false until green across several merges.
  • README.md — portable smoke-test paths (/tmp/...tmp/..., gitignored); Linux/macOS/Windows line in Install; Git Bash/WSL note.
  • java_codebase_rag/_fdlimit.py — guarded import resource (was crashing Windows on import).
  • build_ast_graph.pydb.close() after every conn.close() (was leaking the Database handle → Windows Error 33).
  • 4 test files — paired db.close() with conn.close(); test_fd_limit skipped on win32.

Semantics / Non-Goals

  • Product behaviour unchanged on Unix (closing db after conn is correct; verified).
  • macOS/Windows CI legs remain continue-on-error until observed green — promote by dropping them from the continue-on-error expression.
  • Did not change ladybug_queries.py (the MCP server's long-lived read-only singleton — one persistent handle, no conflict in normal operation).

Validation

  • Local (macOS): pytest tests/test_incremental_graph.py tests/test_cross_service_resolution_flag.py tests/test_feign_not_exposer.py tests/test_fd_limit.py -q53 passed
  • py_compile on all 6 changed files ✅; _fdlimit.raise_fd_limit() still works on macOS ✅; 8 db.close() sites confirmed in build_ast_graph.py
  • CI: Ubuntu ✅, macOS ✅ on the first run. Windows re-running after the fixes above — that result is the open question this update addresses.

Manual evidence

Native wheels audited on PyPI: cocoindex 1.0.14 (win_amd64), ladybug 0.17.1 (pinned; cp310–cp314 win_amd64+win_arm64), plus established lancedb/pyarrow/torch/tree-sitter wheels.

Out of Scope Confirmed

  • Hard-blocking macOS/Windows gates (deferred until green).
  • cmd/PowerShell README variants beyond the Git Bash/WSL note.
  • /tmp/ cleanup in docs/* operator docs.

Definition of Done

  • OS classifiers added.
  • CI matrix runs on 3 OSes; Ubuntu remains the required gate.
  • README paths portable; Windows note added.
  • resource import guarded — CLI/MCP server starts on Windows.
  • db.close() lifecycle fixed — init/increment work on Windows.
  • Windows CI leg observed green on this re-run → then promote to a hard gate.

🤖 Generated with Claude Code

HumanBean17 and others added 3 commits July 4, 2026 13:14
…ix, README)

Audit confirmed the tool already runs cross-platform — every native dependency
ships win_amd64 wheels (cocoindex, ladybug/kuzu, lancedb) and the Python path
is portable (pathlib, copy-based install, list-arg subprocess, RLIMIT_NOFILE
no-op on Windows) — but nothing declared or verified it. This closes the gap.

- pyproject.toml: add Operating System classifiers for Linux/macOS/Windows
- .github/workflows/test.yml: 3-OS matrix (ubuntu/macos/windows-latest).
  Ubuntu remains the required merge gate; macOS + Windows run on every
  code-change PR but are continue-on-error until each is observed green
  across several merges (the fast suite exercises the native kuzu/ladybug
  graph layer, never before run on these OSes). fail-fast: false.
- README.md: portable smoke-test paths (/tmp/bank-chat-index ->
  tmp/bank-chat-index, gitignored + works in any shell/OS), a Linux/macOS/
  Windows line in Install, and a Git Bash/WSL note for the POSIX snippets.

No .py files modified; runtime behavior is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
The Windows CI leg added in #371 surfaced two real product bugs that left
the tool non-functional on Windows.

1. _fdlimit.py imported `resource` at module scope. `resource` is Unix-only,
   so the import raised ModuleNotFoundError on Windows — and because both
   cli.py and server.py import raise_fd_limit, the entire CLI and MCP server
   failed to start. Guard the import (try/except -> None); raise_fd_limit
   already no-ops when RLIMIT_NOFILE is absent. test_fd_limit is skipped on
   win32 (it asserts Unix rlimit behaviour).

2. build_ast_graph.py never called db.close(): all 8 cleanup paths in
   incremental_rebuild + write_ladybug closed the Connection but leaked the
   Database handle. Windows uses mandatory file locking, so the leaked handle
   holds the .lbug lock and the next open fails with "Error 33: another
   process has locked a portion of the file." This broke real init/increment
   on Windows, not just tests. Add db.close() after every conn.close(); same
   leak fixed in 4 tests that opened their own handle.

Verified locally: 53 affected tests pass on macOS (serial) — no regression.
Windows is the CI matrix's job.

Co-Authored-By: Claude <noreply@anthropic.com>
… path tests

Second Windows run (after the resource/db.close fixes) failed 12 — all resolved:

Product:
- installer.py: os.rename -> os.replace for the atomic config write. On
  Windows os.rename raises WinError 183 when the target already exists, so
  install/update broke whenever the config file was present (the normal case).
  os.replace is atomic on both platforms.
- cli.py erase: catch EOFError from input() and treat it as a non-interactive
  refusal. The Windows NUL device reports isatty()==True (it's a character
  device), so the non-TTY guard is bypassed and input() crashed with an EOF
  traceback; now it prints the refusal and exits 2.

Tests (Unix path assumptions — the suite had never run on Windows before):
- test_incremental_graph: pair db.close() with conn.close() in the one
  remaining orchestrator test (still leaking the Database handle -> Error 33).
- test_config / test_java_codebase_rag_cli: set USERPROFILE alongside HOME
  (Path.home()/expanduser read %USERPROFILE% on Windows), compare paths via
  Path equality instead of raw strings (forward/back-slash mismatch), and
  resolve-both-sides for the drive-relative YAML source_root assertions.

Verified locally: 122 affected tests pass on macOS (serial). Windows re-run pending.

Co-Authored-By: Claude <noreply@anthropic.com>
@HumanBean17 HumanBean17 merged commit c7e2e6f into master Jul 4, 2026
3 checks passed
@HumanBean17 HumanBean17 deleted the feat/windows-platform-support branch July 4, 2026 12:29
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