Skip to content

Add Windows build support - #9

Merged
mondain merged 12 commits into
mainfrom
feature/windows-build
May 8, 2026
Merged

Add Windows build support#9
mondain merged 12 commits into
mainfrom
feature/windows-build

Conversation

@mondain

@mondain mondain commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add windows-latest to CI and release workflow matrices (MSVC / Visual Studio 2022)
  • Fix three picotls Windows build gaps found during local test: missing wincompat.h include path, missing wintimeofday.c source, and missing bcrypt.lib linkage
  • Exclude picotls POSIX-only test/bench/fuzz executables from the Windows default build
  • Exclude LINK_GROUP:RESCAN (GNU ld-specific) from Windows; use separate picohttp-core link instead
  • Link ws2_32 and iphlpapi for Winsock2 when building with picoquic on Windows
  • Add /W4 /WX- /utf-8 compile options for MSVC
  • Package Windows release as .zip with openmoq-publisher.exe from build/Release/
  • Remove hardcoded Linux path from OPENMOQ_PICOQUIC_SOURCE_DIR default
  • Update README: platform list, build instructions, OpenSSL guidance, CI section, Quick Start Windows note, fix absolute Linux doc link

Test plan

  • Validated locally on Windows with MSVC 19.44 (VS 2022) and OpenSSL 3.6.0
  • cmake --build --config Release exits 0 with no errors
  • All 4 CTest suites pass (packaging, cli, transport, webtransport)
  • CI run on windows-latest, ubuntu-latest, macos-latest (triggered by this PR)

?? Generated with Claude Code

mondain and others added 3 commits May 8, 2026 08:37
- Add windows-latest to both CI and release workflow matrices
- Detect pre-installed OpenSSL on Windows runners; fall back to choco
- Pass OPENSSL_ROOT_DIR to CMake when set (Windows only)
- Switch Configure steps to bash arrays so the OpenSSL arg is conditional
- Fix toolchain display to handle MSVC (no bare `c++` command)
- Exclude LINK_GROUP:RESCAN from Windows/MSVC builds; add WIN32 to the
  picohttp-core separate-link fallback path instead
- Link ws2_32 and iphlpapi when building with picoquic on Windows
- Add /W4 /WX- /utf-8 compile options for MSVC builds
- Package Windows release as .zip with .exe binary from build/Release/
- Remove hardcoded Linux path from OPENMOQ_PICOQUIC_SOURCE_DIR default

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three issues found and fixed during local Windows test build:

1. picotls.h includes "wincompat.h" bare on Windows but picotls's own
   CMakeLists.txt never adds picotlsvs/picotls to the include path.
   Inject it via include_directories(BEFORE) before picoquic's
   add_subdirectory so picotls-core compiles cleanly under MSVC.

2. picotls-core calls wintimeofday() which is only listed in the VS
   project files, not the CMakeLists. Add wintimeofday.c explicitly
   to picotls-core via target_sources for CMake Windows builds.

3. picotls-minicrypto uses BCryptGenRandom but doesn't link bcrypt.lib.
   Add it via target_link_libraries (plain signature to match picotls
   CMakeLists style).

Also exclude all picotls test/bench/fuzz executables (cli, test-openssl.t,
test-minicrypto.t, test-fusion.t, test-mbedtls.t, ptlsbench, fuzz-*)
from EXCLUDE_FROM_ALL on Windows; they pull in POSIX headers
(<netinet/in.h> etc.) that don't exist on Windows.

Validated locally: cmake --build --config Release exits 0, all 4
ctest suites pass on windows-latest equivalent (MSVC 19.44 / VS 2022).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Headline and intro: add Windows to the platform list
- Fix absolute Linux path in the draft handling doc link (use relative path)
- Repository layout: update CI/release workflow descriptions to mention Windows
- Release builds: add Windows archive note (.zip with .exe)
- Build section: replace hardcoded Linux paths with generic clone instructions;
  add Windows-specific OpenSSL guidance (choco install + OPENSSL_ROOT_DIR);
  note that build\Release\ is the output directory for MSVC multi-config builds
- Quick Start: add Windows binary path and env var note
- CI section: add windows-latest to the platform list and note how OpenSSL
  is located automatically on the runner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class Windows build and release support for the OpenMOQ publisher, aligning CMake, CI, release packaging, and documentation to work with MSVC/VS 2022 and Windows runner constraints.

Changes:

  • Extend CI and release workflows to include windows-latest, plus Windows-specific OpenSSL detection and .zip packaging.
  • Update CMakeLists.txt to close Windows build gaps in the picoquic/picotls integration and add MSVC compile/link options.
  • Update README.md with Windows build guidance and corrected documentation links.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
README.md Documents Windows support, build steps (incl. OpenSSL), and updates workflow/platform notes.
CMakeLists.txt Adjusts picoquic/picotls integration for Windows, updates link logic, and adds MSVC compile options.
.github/workflows/release.yml Adds Windows release job, OpenSSL location/install logic, and .zip packaging for Windows artifacts.
.github/workflows/ci.yml Adds Windows CI job and OpenSSL location/install logic for Windows runner builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines +62 to +66
}
if (-not $env:OPENSSL_ROOT_DIR) {
choco install openssl --no-progress -y
"OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
Comment thread .github/workflows/ci.yml
Comment on lines 68 to +72
- name: Configure
run: >
cmake -S . -B build
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DOPENMOQ_PICOQUIC_SOURCE_DIR="${{ github.workspace }}/third_party/picoquic"
-DOPENMOQ_PICOTLS_SOURCE_DIR="${{ github.workspace }}/third_party/picotls"
shell: bash
run: |
args=(
cmake -S . -B build
Comment on lines +63 to +67
}
if (-not $env:OPENSSL_ROOT_DIR) {
choco install openssl --no-progress -y
"OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
Comment on lines 69 to +73
- name: Configure
run: >
cmake -S . -B build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DOPENMOQ_PICOQUIC_SOURCE_DIR="${{ github.workspace }}/third_party/picoquic"
-DOPENMOQ_PICOTLS_SOURCE_DIR="${{ github.workspace }}/third_party/picotls"
-DOPENMOQ_RUN_PICOQUIC_SMOKE_TESTS=OFF
shell: bash
run: |
args=(
cmake -S . -B build
Comment on lines +103 to +106
if [[ "${RUNNER_OS}" == "Windows" ]]; then
# MSVC multi-config generator places the binary under build/Release/
cp build/Release/openmoq-publisher.exe "${package_root}/"
cp README.md LICENSE "${package_root}/"
Comment thread CMakeLists.txt Outdated
Comment on lines +54 to +58
if(WIN32 AND EXISTS "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls")
# picotls.h includes "wincompat.h" on Windows but picotls's own CMakeLists.txt
# does not add picotlsvs/picotls to its include path. Inject it globally so
# the file is found when picotls compiles under FetchContent inside picoquic.
include_directories(BEFORE "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls")
mondain and others added 3 commits May 8, 2026 10:16
picotls calls FIND_PACKAGE(PkgConfig REQUIRED) unconditionally, which
fails on the GitHub Actions Windows runner where pkg-config is not
pre-installed. Add pkgconfiglite via choco in the Windows setup step
(both ci.yml and release.yml) so picotls can probe for brotli (which
won't be found, but the configure step completes successfully).

Also document the pkgconfiglite requirement in the README Windows
build section alongside the existing OpenSSL guidance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
$env:OPENSSL_ROOT_DIR is never set in the current PowerShell session —
only the GITHUB_ENV file is written. The old conditional always fell
through to choco install even when OpenSSL was already present, then
used a hardcoded path that didn't match the actual install location.

Replace with a local $opensslFound boolean and re-scan candidates after
any choco install. Applies to both ci.yml and release.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MSVC places test executables under build/Debug/ and ctest needs -C Debug
to locate them. Without it every test reports "Not Run" and exits 1.
Single-config generators (Makefile, Ninja) ignore the -C flag harmlessly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Comment thread .github/workflows/ci.yml Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt
Comment thread README.md Outdated
Comment thread README.md Outdated
mondain and others added 3 commits May 8, 2026 11:57
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
mondain and others added 2 commits May 8, 2026 12:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot finished work on behalf of mondain May 8, 2026 19:03
@mondain
mondain merged commit 605cc1b into main May 8, 2026
@mondain
mondain deleted the feature/windows-build branch May 8, 2026 19:06
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.

3 participants