From c0e32b659528d9da7967b3d5aaf5139298aa2cda Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 08:37:30 -0700 Subject: [PATCH 01/12] Add Windows build support to CI, release, and CMake - 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 --- .github/workflows/ci.yml | 42 ++++++++++++++++++++---- .github/workflows/release.yml | 62 ++++++++++++++++++++++++++++------- CMakeLists.txt | 12 +++++-- 3 files changed, 95 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ad7ad7..044e4e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: os: - ubuntu-latest - macos-latest + - windows-latest steps: - name: Checkout @@ -38,16 +39,45 @@ jobs: submodules: recursive - name: Show toolchain + shell: bash run: | cmake --version - c++ --version + if command -v c++ >/dev/null 2>&1; then c++ --version; fi + if command -v cl >/dev/null 2>&1; then cl; fi + + - name: Locate OpenSSL (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + foreach ($candidate in @( + "C:\Program Files\OpenSSL", + "C:\Program Files\OpenSSL-Win64", + "C:\OpenSSL-Win64" + )) { + if (Test-Path "$candidate\include\openssl\ssl.h") { + "OPENSSL_ROOT_DIR=$candidate" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Write-Host "OpenSSL found at $candidate" + break + } + } + 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 + } - 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 + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + "-DOPENMOQ_PICOQUIC_SOURCE_DIR=${{ github.workspace }}/third_party/picoquic" + "-DOPENMOQ_PICOTLS_SOURCE_DIR=${{ github.workspace }}/third_party/picotls" + ) + if [ -n "${OPENSSL_ROOT_DIR:-}" ]; then + args+=("-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}") + fi + "${args[@]}" - name: Build run: cmake --build build --parallel diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd66cbe..d151eec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: os: - ubuntu-latest - macos-latest + - windows-latest steps: - name: Checkout @@ -45,14 +46,41 @@ jobs: path: third_party/picotls submodules: recursive + - name: Locate OpenSSL (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + foreach ($candidate in @( + "C:\Program Files\OpenSSL", + "C:\Program Files\OpenSSL-Win64", + "C:\OpenSSL-Win64" + )) { + if (Test-Path "$candidate\include\openssl\ssl.h") { + "OPENSSL_ROOT_DIR=$candidate" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Write-Host "OpenSSL found at $candidate" + break + } + } + 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 + } + - 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 + -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 + ) + if [ -n "${OPENSSL_ROOT_DIR:-}" ]; then + args+=("-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}") + fi + "${args[@]}" - name: Build run: cmake --build build --config Release --parallel @@ -71,12 +99,22 @@ jobs: package_root="openmoq-publisher-${version}-${RUNNER_OS}" mkdir -p "${package_root}" - cp build/openmoq-publisher "${package_root}/" - cp README.md LICENSE "${package_root}/" - cp -R docs "${package_root}/docs" - archive="${package_root}.tar.gz" - tar -czf "${archive}" "${package_root}" + 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}/" + cp -R docs "${package_root}/docs" + archive="${package_root}.zip" + 7z a "${archive}" "${package_root}" + else + cp build/openmoq-publisher "${package_root}/" + cp README.md LICENSE "${package_root}/" + cp -R docs "${package_root}/docs" + archive="${package_root}.tar.gz" + tar -czf "${archive}" "${package_root}" + fi + if [[ "${version}" == v* ]]; then echo "release_enabled=true" >> "${GITHUB_ENV}" else diff --git a/CMakeLists.txt b/CMakeLists.txt index 3aa080d..77d5f57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ option(OPENMOQ_BUILD_TESTS "Build OpenMOQ publisher tests" ON) option(OPENMOQ_ENABLE_PICOQUIC "Enable picoquic transport integration when picoquic is available" ON) option(OPENMOQ_RUN_PICOQUIC_SMOKE_TESTS "Build and run picoquic loopback smoke tests" OFF) -set(OPENMOQ_PICOQUIC_SOURCE_DIR "/media/mondain/terrorbyte/workspace/github/picoquic" CACHE PATH +set(OPENMOQ_PICOQUIC_SOURCE_DIR "" CACHE PATH "Path to a picoquic source checkout") set(OPENMOQ_HAS_PICOQUIC OFF) @@ -101,20 +101,26 @@ target_compile_features(openmoq_publisher_lib PUBLIC cxx_std_20) if(OPENMOQ_HAS_PICOQUIC) target_compile_definitions(openmoq_publisher_lib PRIVATE OPENMOQ_HAS_PICOQUIC=1) - if(TARGET picohttp-core AND TARGET picoquic-log AND NOT APPLE AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") + if(TARGET picohttp-core AND TARGET picoquic-log AND NOT APPLE AND NOT WIN32 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") + # Linux with modern CMake: RESCAN resolves circular deps between picohttp/picoquic via --start-group/--end-group. target_link_libraries(openmoq_publisher_lib PRIVATE "$") target_include_directories(openmoq_publisher_lib PRIVATE "${OPENMOQ_PICOQUIC_SOURCE_DIR}/picohttp") else() target_link_libraries(openmoq_publisher_lib PRIVATE picoquic-core) endif() - if(TARGET picohttp-core AND (APPLE OR CMAKE_VERSION VERSION_LESS "3.24")) + if(TARGET picohttp-core AND (APPLE OR WIN32 OR CMAKE_VERSION VERSION_LESS "3.24")) target_link_libraries(openmoq_publisher_lib PRIVATE picohttp-core) target_include_directories(openmoq_publisher_lib PRIVATE "${OPENMOQ_PICOQUIC_SOURCE_DIR}/picohttp") endif() + if(WIN32) + target_link_libraries(openmoq_publisher_lib PRIVATE ws2_32 iphlpapi) + endif() endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") target_compile_options(openmoq_publisher_lib PRIVATE -Wall -Wextra -Wpedantic) +elseif(MSVC) + target_compile_options(openmoq_publisher_lib PRIVATE /W4 /WX- /utf-8) endif() add_executable(openmoq-publisher src/main.cpp) From 99da6b9fba11bba4a5cdc487f27b1c1e70429be6 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 08:59:52 -0700 Subject: [PATCH 02/12] Fix Windows build: resolve picotls POSIX/platform gaps 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 ( 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 --- CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77d5f57..80401ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,12 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists set(BUILD_PQBENCH OFF CACHE BOOL "" FORCE) set(BUILD_LOGLIB ON CACHE BOOL "" FORCE) set(BUILD_LOGREADER OFF CACHE BOOL "" FORCE) + 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") + endif() if(APPLE) # picotls appends literal "(" and ")" list items when Brotli is # discovered via pkg-config. On macOS, CMake rejects the resulting @@ -73,6 +79,35 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists # directories list when Brotli is discovered via pkg-config. CMake on # macOS rejects those malformed source-prefixed paths during generate. openmoq_sanitize_target_link_directories(picotls-core) + if(WIN32) + # picotls's cli, bench, and test executables use POSIX headers not available + # on Windows. Exclude them from the default build; the libraries we need + # (picotls-core, picotls-openssl, picotls-fusion) are unaffected. + foreach(_picotls_exe IN ITEMS + cli + test-openssl.t + test-minicrypto.t + test-fusion.t + test-mbedtls.t + ptlsbench + fuzz-asn1 + fuzz-server-hello + fuzz-client-hello) + if(TARGET "${_picotls_exe}") + set_target_properties("${_picotls_exe}" PROPERTIES EXCLUDE_FROM_ALL ON) + endif() + endforeach() + # picotls-core calls wintimeofday() which is only compiled inside the VS + # project files; add it explicitly for CMake Windows builds. + if(TARGET picotls-core AND EXISTS "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls/wintimeofday.c") + target_sources(picotls-core PRIVATE + "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls/wintimeofday.c") + endif() + # picotls-minicrypto uses the Windows BCrypt API for random bytes. + if(TARGET picotls-minicrypto) + target_link_libraries(picotls-minicrypto bcrypt) + endif() + endif() set(OPENMOQ_HAS_PICOQUIC ON) else() message(STATUS "picoquic checkout found, but picotls source was not found; building without picoquic integration") From 2f15ba6234ecda6dbc9a1726a066483994474678 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 09:09:14 -0700 Subject: [PATCH 03/12] Update docs for Windows build support - 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 --- README.md | 62 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index d928d86..93348a3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenMOQ Publisher -`moqxr` is a C++20 OpenMOQ publisher contribution project for Linux and macOS. +`moqxr` is a C++20 OpenMOQ publisher contribution project for Linux, macOS, and Windows. It packages MP4 input into CMSF-style publishable objects, supports MOQT draft-specific framing for drafts 14 and 16, and can either inspect the generated publish plan locally or publish it over a picoquic-backed transport when local `picoquic` and `picotls` checkouts are available. @@ -42,7 +42,7 @@ This keeps the project aligned with CMAF-style publication while reusing the sam - `draft-ietf-moq-transport-14` is the primary target - `draft-ietf-moq-transport-16` is represented as a secondary compatibility profile -- draft-specific assumptions are documented in [docs/protocol-mapping.md](/media/mondain/terrorbyte/workspace/github/moqxr/docs/protocol-mapping.md) +- draft-specific assumptions are documented in [docs/protocol-mapping.md](docs/protocol-mapping.md) ## Repository layout @@ -51,23 +51,24 @@ This keeps the project aligned with CMAF-style publication while reusing the sam - `tests`: CTest-based unit coverage - `docs`: protocol notes and design references - `docs/transport-plan.md`: picoquic integration plan and implementation checklist -- `.github/workflows/ci.yml`: GitHub Actions build and test workflow for Linux and macOS -- `.github/workflows/release.yml`: GitHub Actions release-build workflow that uploads Linux and macOS archives +- `.github/workflows/ci.yml`: GitHub Actions build and test workflow for Linux, macOS, and Windows +- `.github/workflows/release.yml`: GitHub Actions release-build workflow that uploads Linux, macOS, and Windows archives ## Release builds -For users who just want a prebuilt binary, GitHub Actions publishes release archives for Linux and macOS: +For users who just want a prebuilt binary, GitHub Actions publishes release archives for Linux, macOS, and Windows: - pushing a `v*` tag builds release artifacts and attaches them to the matching GitHub Release - running the `Release Builds` workflow manually uploads the same archives as workflow artifacts - manual runs can also publish a GitHub Release when you provide a `release_tag` such as `v0.1.0` - both CI and release workflows check out `private-octopus/picoquic` plus `private-octopus/picotls`, so published binaries include the picoquic transport path instead of falling back to a local-inspection-only build +- Linux and macOS archives are `.tar.gz`; Windows archives are `.zip` and contain `openmoq-publisher.exe` ## Build ### Baseline build -This is the default path for local development: +This is the default path for local development. It works on Linux, macOS, and Windows: ```bash cmake -S . -B build -DOPENMOQ_RUN_PICOQUIC_SMOKE_TESTS=OFF @@ -75,38 +76,60 @@ cmake --build build ctest --test-dir build --output-on-failure ``` -### Build with local picoquic and picotls - -If you have local checkouts at: - -- `/media/mondain/terrorbyte/workspace/github/picoquic` -- `/media/mondain/terrorbyte/workspace/github/picotls` +On Windows with the Visual Studio generator, the binary lands in `build\Release\` or `build\Debug\` depending on the config passed to `--build`. -then the project will automatically compile against them. +### Build with local picoquic and picotls -Required picotls setup: +Clone picoquic and picotls to any convenient location and initialise the picotls submodules: ```bash -git -C /media/mondain/terrorbyte/workspace/github/picotls submodule update --init --recursive +git clone https://github.com/private-octopus/picoquic.git /path/to/picoquic +git clone --recurse-submodules https://github.com/private-octopus/picotls.git /path/to/picotls ``` -Then configure and build normally: +Then point CMake at them: ```bash -cmake -S . -B build -DOPENMOQ_RUN_PICOQUIC_SMOKE_TESTS=OFF +cmake -S . -B build \ + -DOPENMOQ_PICOQUIC_SOURCE_DIR=/path/to/picoquic \ + -DOPENMOQ_PICOTLS_SOURCE_DIR=/path/to/picotls \ + -DOPENMOQ_RUN_PICOQUIC_SMOKE_TESTS=OFF cmake --build build ctest --test-dir build --output-on-failure ``` +**Windows additional requirement — OpenSSL** + +picotls requires OpenSSL headers and libraries. On Windows you need to provide them separately and tell CMake where they are: + +```powershell +# One-time: install OpenSSL (skip if already present) +choco install openssl + +cmake -S . -B build ` + -DOPENMOQ_PICOQUIC_SOURCE_DIR=C:\path\to\picoquic ` + -DOPENMOQ_PICOTLS_SOURCE_DIR=C:\path\to\picotls ` + -DOPENSSL_ROOT_DIR="C:\Program Files\OpenSSL-Win64" ` + -DOPENMOQ_RUN_PICOQUIC_SMOKE_TESTS=OFF +cmake --build build --config Release +ctest --test-dir build -C Release --output-on-failure +``` + +The GitHub Actions release workflow locates OpenSSL automatically from the runner's pre-installed copy, so no manual step is needed in CI. + Useful CMake options: - `-DOPENMOQ_ENABLE_PICOQUIC=ON|OFF` - `-DOPENMOQ_PICOQUIC_SOURCE_DIR=/path/to/picoquic` +- `-DOPENMOQ_PICOTLS_SOURCE_DIR=/path/to/picotls` +- `-DOPENSSL_ROOT_DIR=/path/to/openssl` (Windows only, when OpenSSL is not on the system path) - `-DOPENMOQ_RUN_PICOQUIC_SMOKE_TESTS=ON|OFF` ## Quick Start -If you already have a sample MP4 and just want to see what the publisher does, these are the most useful first commands: +If you already have a sample MP4 and just want to see what the publisher does, these are the most useful first commands. + +> **Windows note**: replace `./build/openmoq-publisher` with `build\Release\openmoq-publisher.exe` in the examples below, and use `set OPENMOQ_PICOQUIC_TRACE=1` instead of the shell prefix form. Inspect the publish plan with the default settings: @@ -556,8 +579,9 @@ GitHub Actions is configured to build and test the project on: - `ubuntu-latest` - `macos-latest` +- `windows-latest` -The workflow runs the same CMake configure, build, and CTest steps on both platforms. +The workflow runs the same CMake configure, build, and CTest steps on all three platforms. On Windows, OpenSSL is located automatically from the runner's pre-installed copy and passed to CMake via `OPENSSL_ROOT_DIR`. ## Transport Notes From a9d8a3a08d6d5fab130d1b84cfd1bade629f72ee Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 10:03:16 -0700 Subject: [PATCH 04/12] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7484eba..d6162d4 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ moqxr.code-workspace run.log run-trace*.log openmoq-publisher-trace.csv +/.claude +/third_party From f51f01734c634b598706bdaa5cfeddc24fba48ee Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 10:16:39 -0700 Subject: [PATCH 05/12] Fix Windows CI: install pkgconfiglite before configure 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 --- .github/workflows/ci.yml | 6 +++++- .github/workflows/release.yml | 6 +++++- README.md | 8 ++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 044e4e3..a5d5ff7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,10 +45,14 @@ jobs: if command -v c++ >/dev/null 2>&1; then c++ --version; fi if command -v cl >/dev/null 2>&1; then cl; fi - - name: Locate OpenSSL (Windows) + - name: Set up Windows dependencies if: runner.os == 'Windows' shell: pwsh run: | + # picotls requires pkg-config at configure time (even on Windows where + # brotli is absent); install the lightweight pkgconfiglite shim. + choco install pkgconfiglite --no-progress -y + foreach ($candidate in @( "C:\Program Files\OpenSSL", "C:\Program Files\OpenSSL-Win64", diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d151eec..8ffedf8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,10 +46,14 @@ jobs: path: third_party/picotls submodules: recursive - - name: Locate OpenSSL (Windows) + - name: Set up Windows dependencies if: runner.os == 'Windows' shell: pwsh run: | + # picotls requires pkg-config at configure time (even on Windows where + # brotli is absent); install the lightweight pkgconfiglite shim. + choco install pkgconfiglite --no-progress -y + foreach ($candidate in @( "C:\Program Files\OpenSSL", "C:\Program Files\OpenSSL-Win64", diff --git a/README.md b/README.md index 93348a3..b23dbd0 100644 --- a/README.md +++ b/README.md @@ -98,13 +98,13 @@ cmake --build build ctest --test-dir build --output-on-failure ``` -**Windows additional requirement — OpenSSL** +**Windows additional requirements — pkg-config and OpenSSL** -picotls requires OpenSSL headers and libraries. On Windows you need to provide them separately and tell CMake where they are: +picotls requires both `pkg-config` (to probe for optional brotli) and OpenSSL headers and libraries. On Windows you need to install both and tell CMake where OpenSSL is: ```powershell -# One-time: install OpenSSL (skip if already present) -choco install openssl +# One-time: install pkg-config shim and OpenSSL (skip if already present) +choco install pkgconfiglite openssl cmake -S . -B build ` -DOPENMOQ_PICOQUIC_SOURCE_DIR=C:\path\to\picoquic ` From 6e9557b653f8308fed86187790b3f4cd565337e6 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 10:32:19 -0700 Subject: [PATCH 06/12] Fix Windows OpenSSL detection using local boolean instead of env var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $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 --- .github/workflows/ci.yml | 17 +++++++++++++---- .github/workflows/release.yml | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5d5ff7..7721a39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,20 +53,29 @@ jobs: # brotli is absent); install the lightweight pkgconfiglite shim. choco install pkgconfiglite --no-progress -y - foreach ($candidate in @( + $candidates = @( "C:\Program Files\OpenSSL", "C:\Program Files\OpenSSL-Win64", "C:\OpenSSL-Win64" - )) { + ) + $opensslFound = $false + foreach ($candidate in $candidates) { if (Test-Path "$candidate\include\openssl\ssl.h") { "OPENSSL_ROOT_DIR=$candidate" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append Write-Host "OpenSSL found at $candidate" + $opensslFound = $true break } } - if (-not $env:OPENSSL_ROOT_DIR) { + if (-not $opensslFound) { choco install openssl --no-progress -y - "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + foreach ($candidate in $candidates) { + if (Test-Path "$candidate\include\openssl\ssl.h") { + "OPENSSL_ROOT_DIR=$candidate" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Write-Host "OpenSSL installed at $candidate" + break + } + } } - name: Configure diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ffedf8..5433d3b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,20 +54,29 @@ jobs: # brotli is absent); install the lightweight pkgconfiglite shim. choco install pkgconfiglite --no-progress -y - foreach ($candidate in @( + $candidates = @( "C:\Program Files\OpenSSL", "C:\Program Files\OpenSSL-Win64", "C:\OpenSSL-Win64" - )) { + ) + $opensslFound = $false + foreach ($candidate in $candidates) { if (Test-Path "$candidate\include\openssl\ssl.h") { "OPENSSL_ROOT_DIR=$candidate" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append Write-Host "OpenSSL found at $candidate" + $opensslFound = $true break } } - if (-not $env:OPENSSL_ROOT_DIR) { + if (-not $opensslFound) { choco install openssl --no-progress -y - "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + foreach ($candidate in $candidates) { + if (Test-Path "$candidate\include\openssl\ssl.h") { + "OPENSSL_ROOT_DIR=$candidate" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Write-Host "OpenSSL installed at $candidate" + break + } + } } - name: Configure From fe345c21e26e0004a1864639209871a73e9a4797 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 10:52:08 -0700 Subject: [PATCH 07/12] Fix ctest config for MSVC multi-config generator 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 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7721a39..66f38d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,4 +96,4 @@ jobs: run: cmake --build build --parallel - name: Test - run: ctest --test-dir build --output-on-failure + run: ctest --test-dir build -C Debug --output-on-failure From fa1313760e0b9abe475227be1f0315646004dd29 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 11:57:31 -0700 Subject: [PATCH 08/12] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b23dbd0..b92e6f2 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ Useful CMake options: If you already have a sample MP4 and just want to see what the publisher does, these are the most useful first commands. -> **Windows note**: replace `./build/openmoq-publisher` with `build\Release\openmoq-publisher.exe` in the examples below, and use `set OPENMOQ_PICOQUIC_TRACE=1` instead of the shell prefix form. +> **Windows note**: replace `./build/openmoq-publisher` with `build\Release\openmoq-publisher.exe` in the examples below. For trace-enabled examples, use `set OPENMOQ_PICOQUIC_TRACE=1` in `cmd.exe` or `$env:OPENMOQ_PICOQUIC_TRACE=1` in PowerShell instead of the shell prefix form. Inspect the publish plan with the default settings: From 1e0bfd4853dc813de95e49ff23c5f9e7c7e58624 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 11:57:54 -0700 Subject: [PATCH 09/12] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b92e6f2..408820b 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ cmake --build build --config Release ctest --test-dir build -C Release --output-on-failure ``` -The GitHub Actions release workflow locates OpenSSL automatically from the runner's pre-installed copy, so no manual step is needed in CI. +On Windows, GitHub Actions workflows (including CI and release) set `OPENSSL_ROOT_DIR` automatically from the runner's pre-installed OpenSSL, so no manual step is needed there. Useful CMake options: From a21a9bd1fa4a8e22994e10d64fde35bf9e41007a Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 11:58:28 -0700 Subject: [PATCH 10/12] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80401ce..00a22ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,7 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists endif() # picotls-minicrypto uses the Windows BCrypt API for random bytes. if(TARGET picotls-minicrypto) - target_link_libraries(picotls-minicrypto bcrypt) + target_link_libraries(picotls-minicrypto PRIVATE bcrypt) endif() endif() set(OPENMOQ_HAS_PICOQUIC ON) From 19e0d38414f833bc1a3d7670e3d76bf936aabf78 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 8 May 2026 12:00:33 -0700 Subject: [PATCH 11/12] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66f38d5..100d135 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,4 +96,10 @@ jobs: run: cmake --build build --parallel - name: Test - run: ctest --test-dir build -C Debug --output-on-failure + shell: bash + run: | + if [ "${{ runner.os }}" = "Windows" ]; then + ctest --test-dir build -C Debug --output-on-failure + else + ctest --test-dir build --output-on-failure + fi From 48b6ce4729d0ef40724be20e9937f76792608b29 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 19:02:02 +0000 Subject: [PATCH 12/12] Scope picotls Windows include to target and fix bcrypt link signature Agent-Logs-Url: https://github.com/mondain/moqxr/sessions/d77bcc6d-5b75-4332-8dba-fde579dacefb Co-authored-by: mondain <510557+mondain@users.noreply.github.com> --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00a22ca..3521ee8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,12 +51,6 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists set(BUILD_PQBENCH OFF CACHE BOOL "" FORCE) set(BUILD_LOGLIB ON CACHE BOOL "" FORCE) set(BUILD_LOGREADER OFF CACHE BOOL "" FORCE) - 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") - endif() if(APPLE) # picotls appends literal "(" and ")" list items when Brotli is # discovered via pkg-config. On macOS, CMake rejects the resulting @@ -97,6 +91,12 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists set_target_properties("${_picotls_exe}" PROPERTIES EXCLUDE_FROM_ALL ON) endif() endforeach() + # picotls.h includes "wincompat.h" on Windows but picotls's own CMakeLists.txt + # does not add picotlsvs/picotls to picotls-core's include path. + if(TARGET picotls-core AND EXISTS "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls") + target_include_directories(picotls-core PRIVATE + "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls") + endif() # picotls-core calls wintimeofday() which is only compiled inside the VS # project files; add it explicitly for CMake Windows builds. if(TARGET picotls-core AND EXISTS "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls/wintimeofday.c") @@ -105,7 +105,7 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists endif() # picotls-minicrypto uses the Windows BCrypt API for random bytes. if(TARGET picotls-minicrypto) - target_link_libraries(picotls-minicrypto PRIVATE bcrypt) + target_link_libraries(picotls-minicrypto bcrypt) endif() endif() set(OPENMOQ_HAS_PICOQUIC ON)