Skip to content

Add Windows (MSVC) build support and CI#1

Merged
EdmondDantes merged 2 commits into
mainfrom
windows-support
Jun 9, 2026
Merged

Add Windows (MSVC) build support and CI#1
EdmondDantes merged 2 commits into
mainfrom
windows-support

Conversation

@EdmondDantes

Copy link
Copy Markdown
Contributor
  • config.w32: link the bundled clickhouse-cpp static libs; /DNOMINMAX so <windows.h> (pulled in by php.h) does not clobber clickhouse-cpp's std::max().
  • ch_transport.cpp: Winsock branches under PHP_WIN32 (WSAGetLastError, ioctlsocket non-blocking, int recv/send length).
  • php_clickhouse_async.h: extern "C" on the module entry so a static build links (C++ TU vs the engine's C reference).
  • .github/workflows/build-windows.yml + scripts/windows: build clickhouse-cpp with MSVC, build PHP (ZTS) with async + clickhouse_async, then smoke-test. Excludes zstd's GAS asm file that MSVC cannot assemble (C fallback is used).

Verified locally on VS 2022 (ZTS x64): full suite 50/50 pass against ClickHouse in Docker (1 TLS test skipped, no local TLS server).

- config.w32: link the bundled clickhouse-cpp static libs; /DNOMINMAX so
  <windows.h> (pulled in by php.h) does not clobber clickhouse-cpp's std::max().
- ch_transport.cpp: Winsock branches under PHP_WIN32 (WSAGetLastError,
  ioctlsocket non-blocking, int recv/send length).
- php_clickhouse_async.h: extern "C" on the module entry so a static build
  links (C++ TU vs the engine's C reference).
- .github/workflows/build-windows.yml + scripts/windows: build clickhouse-cpp
  with MSVC, build PHP (ZTS) with async + clickhouse_async, then smoke-test.
  Excludes zstd's GAS asm file that MSVC cannot assemble (C fallback is used).

Verified locally on VS 2022 (ZTS x64): full suite 50/50 pass against
ClickHouse in Docker (1 TLS test skipped, no local TLS server).
- ci.yml + build-windows.yml: trigger only on push to main and PRs into main,
  so a pushed PR branch no longer runs each workflow twice (push + pull_request).
- test_task.bat: drop EnableDelayedExpansion (it treated '!' in the inline PHP
  smoke code as delayed expansion and corrupted it) and run checks from smoke.php.
- build-windows.yml: drop the on-failure artifact step (its C:\obj paths sit
  outside the workspace and broke upload-artifact).

The Windows build itself passed on the runner; only the smoke step was broken.
@EdmondDantes EdmondDantes merged commit dd34097 into main Jun 9, 2026
3 checks passed
@EdmondDantes EdmondDantes deleted the windows-support branch June 10, 2026 07:33
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