Add Windows build support - #9
Merged
Merged
Conversation
- 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>
Contributor
There was a problem hiding this comment.
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.zippackaging. - Update
CMakeLists.txtto close Windows build gaps in the picoquic/picotls integration and add MSVC compile/link options. - Update
README.mdwith 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 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 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 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") |
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>
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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mondain/moqxr/sessions/d77bcc6d-5b75-4332-8dba-fde579dacefb Co-authored-by: mondain <510557+mondain@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
windows-latestto CI and release workflow matrices (MSVC / Visual Studio 2022)wincompat.hinclude path, missingwintimeofday.csource, and missingbcrypt.liblinkageLINK_GROUP:RESCAN(GNU ld-specific) from Windows; use separatepicohttp-corelink insteadws2_32andiphlpapifor Winsock2 when building with picoquic on Windows/W4 /WX- /utf-8compile options for MSVC.zipwithopenmoq-publisher.exefrombuild/Release/OPENMOQ_PICOQUIC_SOURCE_DIRdefaultTest plan
cmake --build --config Releaseexits 0 with no errorspackaging,cli,transport,webtransport)windows-latest,ubuntu-latest,macos-latest(triggered by this PR)?? Generated with Claude Code