Skip to content

fix: address Windows, NixOS, and localhost startup issues (#9 #10 #11)#12

Merged
nicoloboschi merged 2 commits intomainfrom
fix/windows-nixos-localhost
Apr 24, 2026
Merged

fix: address Windows, NixOS, and localhost startup issues (#9 #10 #11)#12
nicoloboschi merged 2 commits intomainfrom
fix/windows-nixos-localhost

Conversation

@nicoloboschi
Copy link
Copy Markdown
Collaborator

Summary

Addresses all three open issues:

Other

  • Removed PGBOUNCER_* from versions.env — it was declared but never referenced anywhere in build.rs or main.rs.
  • CI: new build-windows + sdk-tests-windows jobs in ci.yml. The build step mirrors the release-cli.yml Windows step exactly (same toolchain target, same cargo build --release --target x86_64-pc-windows-msvc, same artifact path) so CI exercises the real release compile path. The Python SDK tests run pytest tests/ on windows-latest. The existing coverage was only a minimal start/stop smoke test inside the wheel-build workflow.
  • test_data_survives_crash now skips on Windows because signal.SIGKILL doesn't exist there.

Test plan

  • cargo check on host (aarch64-apple-darwin)
  • cargo check --target x86_64-pc-windows-gnu
  • CI: build-windows produces pg0.exe
  • CI: sdk-tests-windows runs the full pytest suite on windows-latest
  • CI: existing macOS + docker Linux tests still pass

- Windows (#9): extract theseus-rs ZIP bundle via the zip crate (was
  failing with "invalid gzip header"), add Windows to the pgvector
  platform map so pg0-windows-x86_64.exe ships with pgvector, and pick
  the right .exe-suffixed binary names.
- NixOS (#11): pin timezone/log_timezone to UTC so PostgreSQL never
  reads /usr/share/zoneinfo at startup (the upstream binaries are
  compiled against Debian's tzdata path, which does not exist on NixOS).
- Localhost (#10): use 127.0.0.1 in all generated connection URIs and
  client calls, avoiding DNS/host-resolution variance for localhost.

Other:
- drop pgbouncer from versions.env (never referenced in build.rs or
  main.rs, so it was dead config).
- CI: add build-windows + sdk-tests-windows jobs that mirror the
  release-cli.yml compile step (same toolchain targets, same cargo
  invocation, same artifact path) and run the full pytest suite on
  windows-latest. Skip the SIGKILL crash-recovery test on Windows
  since signal.SIGKILL does not exist there.
On Windows, `pg0 start` spawns PostgreSQL which inherits pg0's stdio
handles. pg0 exits promptly (PG is intentionally detached via
std::mem::forget), but PostgreSQL keeps writing to the inherited
handles, so Python's `subprocess.run(capture_output=True)` never sees
pipe EOF and hangs indefinitely. Unix is unaffected — `pg_ctl` closes
inherited FDs before handing off to postgres.

Route stdio through real temporary files on Windows. subprocess.call
only waits on the process exit code, not on file handles held by
grandchildren, so pg0 returns as soon as it exits regardless of what
PostgreSQL does with the inherited file handles afterwards.

Also add a 20-minute timeout-minutes to the sdk-tests-windows CI job
so future hangs fail fast instead of consuming 6h of runner time.
@nicoloboschi nicoloboschi merged commit ba4b627 into main Apr 24, 2026
14 checks passed
@nicoloboschi nicoloboschi deleted the fix/windows-nixos-localhost branch April 24, 2026 11:41
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