From 3d6ece5702b33d9cd557ee43eb6a75d7ce18afdd Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Tue, 20 Oct 2026 17:44:05 +0200 Subject: [PATCH 1/8] Add Windows release workflow for x86/x64 packages Build libModSecurity for Windows x86 and x64, run the test suite and package the DLL, import library and public headers into one zip per architecture. On v3.* tags the zips are attached to the GitHub release. Refs #3313 --- .github/workflows/release-windows.yml | 153 ++++++++++++++++++++++++++ build/win32/CMakeLists.txt | 24 +++- 2 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-windows.yml diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml new file mode 100644 index 000000000..cfc10521c --- /dev/null +++ b/.github/workflows/release-windows.yml @@ -0,0 +1,153 @@ +name: Windows release packages + +# Builds libModSecurity for Windows (x86 and x64), runs the test suite and +# packages the DLL, import library and public headers into one zip per arch. +# On a v3.* tag the zips are attached to the GitHub release of that tag. +# See issue #3313. + +on: + push: + tags: ['v3.*'] + # TEMPORARY: build on every push to the test branch, remove before upstreaming + branches: ['win-release'] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: Windows ${{ matrix.platform.label }} + runs-on: windows-2022 + # x86 has no prebuilt Conan binaries, so every dependency builds from source + timeout-minutes: 150 + + strategy: + fail-fast: false + matrix: + platform: + - { label: "x64", arch: "x86_64", msvc: "x64" } + - { label: "x86", arch: "x86", msvc: "x86" } + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set up MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.platform.msvc }} + + - name: Install Conan package manager + run: | + pip3 install conan --upgrade + conan profile detect --force + + # ImageVersion is a runner env var, not visible to the env context + - name: Get runner image version + id: image + shell: pwsh + run: '"version=$env:ImageVersion" >> $env:GITHUB_OUTPUT' + + - name: Restore Conan cache + uses: actions/cache@v4 + with: + path: ~/.conan2/p + key: conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ hashFiles('build/win32/conanfile.txt') }} + restore-keys: | + conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}- + + - uses: ammaraskar/msvc-problem-matcher@master + + - name: Build project + shell: cmd + run: vcbuild.bat Release ${{ matrix.platform.arch }} NO_ASAN + + # Test steps below mirror the build-windows job in ci_new.yml + - name: Prepare test environment + working-directory: build\win32\build\Release + env: + BASE_DIR: ..\..\..\.. + shell: cmd + run: | + copy unit_tests.exe %BASE_DIR%\test + copy regression_tests.exe %BASE_DIR%\test + copy libModSecurity.dll %BASE_DIR%\test + copy %BASE_DIR%\unicode.mapping %BASE_DIR%\test + md \tmp + md \bin + copy "C:\Program Files\Git\usr\bin\echo.exe" \bin + copy "C:\Program Files\Git\usr\bin\echo.exe" \bin\echo + + - name: Disable unsupported tests on Windows + working-directory: test\test-cases\regression + shell: cmd + run: | + jq "map(if .title == \"Test match variable (1/n)\" then .enabled = 0 else . end)" issue-2423-msg-in-chain.json > tmp.json && move /Y tmp.json issue-2423-msg-in-chain.json + jq "map(if .title == \"Test match variable (2/n)\" then .enabled = 0 else . end)" issue-2423-msg-in-chain.json > tmp.json && move /Y tmp.json issue-2423-msg-in-chain.json + jq "map(if .title == \"Test match variable (3/n)\" then .enabled = 0 else . end)" issue-2423-msg-in-chain.json > tmp.json && move /Y tmp.json issue-2423-msg-in-chain.json + jq "map(if .title == \"Variable offset - FILES_NAMES\" then .enabled = 0 else . end)" offset-variable.json > tmp.json && move /Y tmp.json offset-variable.json + + - name: Run tests + working-directory: build\win32\build + run: ctest -C Release --output-on-failure + + - name: Package + id: package + shell: pwsh + run: | + if ("${{ github.ref_type }}" -eq "tag") { + $version = "${{ github.ref_name }}" + } else { + $version = (git describe --tags --always).Trim() + } + $name = "libmodsecurity-$version-windows-${{ matrix.platform.label }}" + cmake --install build\win32\build --config Release --prefix "dist\$name" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + # the DLL must not depend on anything beyond system DLLs and the VC++ runtime + dumpbin /nologo /dependents "dist\$name\bin\libModSecurity.dll" + + Compress-Archive -Path "dist\$name" -DestinationPath "dist\$name.zip" + $hash = (Get-FileHash "dist\$name.zip" -Algorithm SHA256).Hash.ToLower() + "$hash $name.zip" | Out-File "dist\$name.zip.sha256" -Encoding ascii -NoNewline + Get-ChildItem -Recurse "dist\$name" | Select-Object -ExpandProperty FullName + + - uses: actions/upload-artifact@v4 + with: + name: libmodsecurity-windows-${{ matrix.platform.label }} + path: | + dist/*.zip + dist/*.zip.sha256 + if-no-files-found: error + + publish: + name: Attach packages to release + needs: build + if: github.ref_type == 'tag' + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/download-artifact@v4 + with: + pattern: libmodsecurity-windows-* + merge-multiple: true + + - name: Upload to release + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ github.ref_name }} + run: | + ls -l + # the release is normally created by hand with the source tarball; + # if it does not exist yet, create it as a draft + if ! gh release view "$TAG" -R "$GITHUB_REPOSITORY" > /dev/null 2>&1; then + gh release create "$TAG" -R "$GITHUB_REPOSITORY" --draft --verify-tag \ + --title "$TAG" --notes "Windows packages built by the release-windows workflow." + fi + gh release upload "$TAG" -R "$GITHUB_REPOSITORY" --clobber \ + libmodsecurity-*-windows-*.zip libmodsecurity-*-windows-*.zip.sha256 diff --git a/build/win32/CMakeLists.txt b/build/win32/CMakeLists.txt index 399d4727c..a6f09e0d4 100644 --- a/build/win32/CMakeLists.txt +++ b/build/win32/CMakeLists.txt @@ -94,7 +94,7 @@ message("-- Detecting Mbed TLS version - ${MBEDTLS_VERSION}") project(libModSecurity VERSION - 3.0.14 + 3.0.17 LANGUAGES CXX ) @@ -292,3 +292,25 @@ setExampleTargetProperties(multithread) add_executable(rules_check ${BASE_DIR}/tools/rules-check/rules-check.cc) target_include_directories(rules_check PRIVATE ${BASE_DIR} ${BASE_DIR}/headers) target_link_libraries(rules_check PRIVATE libModSecurity) + +# install +# +# Layout used by the Windows release packages (see .github/workflows/release-windows.yml): +# bin/ libModSecurity.dll, rules_check.exe +# lib/ libModSecurity.lib (import library) +# include/ public headers +# + +install(TARGETS libModSecurity + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib +) +install(TARGETS rules_check RUNTIME DESTINATION bin) +install(DIRECTORY ${BASE_DIR}/headers/modsecurity DESTINATION include FILES_MATCHING PATTERN "*.h") +install(FILES + ${BASE_DIR}/LICENSE + ${BASE_DIR}/README.md + ${BASE_DIR}/modsecurity.conf-recommended + ${BASE_DIR}/unicode.mapping + DESTINATION . +) From 710d362871063b8c1b9797f0329431b59efa6811 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Tue, 20 Oct 2026 21:51:55 +0200 Subject: [PATCH 2/8] Restrict snapshot version names to v3 tags --- .github/workflows/release-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index cfc10521c..32e5753b7 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -101,7 +101,7 @@ jobs: if ("${{ github.ref_type }}" -eq "tag") { $version = "${{ github.ref_name }}" } else { - $version = (git describe --tags --always).Trim() + $version = (git describe --tags --match "v3.*" --always).Trim() } $name = "libmodsecurity-$version-windows-${{ matrix.platform.label }}" cmake --install build\win32\build --config Release --prefix "dist\$name" From 42361e4cdb639bdc65b77dbe56352f353a2c8532 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Wed, 21 Oct 2026 22:26:19 +0200 Subject: [PATCH 3/8] Add Debug builds to the Windows release packages Build Release (/MD) and Debug (/MDd) packages for both x86 and x64. Debug packages include the PDB of libModSecurity.dll. --- .github/workflows/release-windows.yml | 24 ++++++++++++++---------- build/win32/CMakeLists.txt | 3 ++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 32e5753b7..917729920 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -1,7 +1,8 @@ name: Windows release packages -# Builds libModSecurity for Windows (x86 and x64), runs the test suite and -# packages the DLL, import library and public headers into one zip per arch. +# Builds libModSecurity for Windows (x86 and x64, Release and Debug), runs the +# test suite and packages the DLL, import library and public headers into one +# zip per arch and configuration. All builds use the dynamic CRT (/MD, /MDd). # On a v3.* tag the zips are attached to the GitHub release of that tag. # See issue #3313. @@ -17,7 +18,7 @@ permissions: jobs: build: - name: Windows ${{ matrix.platform.label }} + name: Windows ${{ matrix.platform.label }} ${{ matrix.configuration }} runs-on: windows-2022 # x86 has no prebuilt Conan binaries, so every dependency builds from source timeout-minutes: 150 @@ -28,6 +29,7 @@ jobs: platform: - { label: "x64", arch: "x86_64", msvc: "x64" } - { label: "x86", arch: "x86", msvc: "x86" } + configuration: [Release, Debug] steps: - uses: actions/checkout@v6 @@ -55,19 +57,19 @@ jobs: uses: actions/cache@v4 with: path: ~/.conan2/p - key: conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ hashFiles('build/win32/conanfile.txt') }} + key: conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}-${{ hashFiles('build/win32/conanfile.txt') }} restore-keys: | - conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}- + conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}- - uses: ammaraskar/msvc-problem-matcher@master - name: Build project shell: cmd - run: vcbuild.bat Release ${{ matrix.platform.arch }} NO_ASAN + run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform.arch }} NO_ASAN # Test steps below mirror the build-windows job in ci_new.yml - name: Prepare test environment - working-directory: build\win32\build\Release + working-directory: build\win32\build\${{ matrix.configuration }} env: BASE_DIR: ..\..\..\.. shell: cmd @@ -92,7 +94,7 @@ jobs: - name: Run tests working-directory: build\win32\build - run: ctest -C Release --output-on-failure + run: ctest -C ${{ matrix.configuration }} --output-on-failure - name: Package id: package @@ -104,10 +106,12 @@ jobs: $version = (git describe --tags --match "v3.*" --always).Trim() } $name = "libmodsecurity-$version-windows-${{ matrix.platform.label }}" - cmake --install build\win32\build --config Release --prefix "dist\$name" + if ("${{ matrix.configuration }}" -eq "Debug") { $name += "-debug" } + cmake --install build\win32\build --config ${{ matrix.configuration }} --prefix "dist\$name" if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # the DLL must not depend on anything beyond system DLLs and the VC++ runtime + # (the debug VC++ runtime for Debug builds) dumpbin /nologo /dependents "dist\$name\bin\libModSecurity.dll" Compress-Archive -Path "dist\$name" -DestinationPath "dist\$name.zip" @@ -117,7 +121,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: libmodsecurity-windows-${{ matrix.platform.label }} + name: libmodsecurity-windows-${{ matrix.platform.label }}-${{ matrix.configuration }} path: | dist/*.zip dist/*.zip.sha256 diff --git a/build/win32/CMakeLists.txt b/build/win32/CMakeLists.txt index a6f09e0d4..0251c927d 100644 --- a/build/win32/CMakeLists.txt +++ b/build/win32/CMakeLists.txt @@ -296,7 +296,7 @@ target_link_libraries(rules_check PRIVATE libModSecurity) # install # # Layout used by the Windows release packages (see .github/workflows/release-windows.yml): -# bin/ libModSecurity.dll, rules_check.exe +# bin/ libModSecurity.dll (+ .pdb for Debug), rules_check.exe # lib/ libModSecurity.lib (import library) # include/ public headers # @@ -305,6 +305,7 @@ install(TARGETS libModSecurity RUNTIME DESTINATION bin ARCHIVE DESTINATION lib ) +install(FILES $ DESTINATION bin CONFIGURATIONS Debug RelWithDebInfo OPTIONAL) install(TARGETS rules_check RUNTIME DESTINATION bin) install(DIRECTORY ${BASE_DIR}/headers/modsecurity DESTINATION include FILES_MATCHING PATTERN "*.h") install(FILES From 679aaaeef500f39f91a0c6871b8282f82e0b84dc Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Thu, 22 Oct 2026 09:57:22 +0200 Subject: [PATCH 4/8] Remove temporary branch trigger from Windows release workflow --- .github/workflows/release-windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 917729920..c5aee8c7d 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -9,8 +9,6 @@ name: Windows release packages on: push: tags: ['v3.*'] - # TEMPORARY: build on every push to the test branch, remove before upstreaming - branches: ['win-release'] workflow_dispatch: permissions: From f3525f02df53338474bfda129fb1e05092106a6e Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Thu, 22 Oct 2026 11:27:57 +0200 Subject: [PATCH 5/8] Harden Windows release workflow Pin all actions to commit SHAs, pass the ref name through env instead of template expansion, publish only on tag pushes, and do not persist checkout credentials. --- .github/workflows/release-windows.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index c5aee8c7d..2b87ac546 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -30,13 +30,14 @@ jobs: configuration: [Release, Debug] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: + persist-credentials: false fetch-depth: 0 submodules: recursive - name: Set up MSVC environment - uses: ilammy/msvc-dev-cmd@v1 + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: arch: ${{ matrix.platform.msvc }} @@ -52,14 +53,14 @@ jobs: run: '"version=$env:ImageVersion" >> $env:GITHUB_OUTPUT' - name: Restore Conan cache - uses: actions/cache@v4 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.conan2/p key: conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}-${{ hashFiles('build/win32/conanfile.txt') }} restore-keys: | conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}- - - uses: ammaraskar/msvc-problem-matcher@master + - uses: ammaraskar/msvc-problem-matcher@47189a176388253d16c6f0b79eee6274512b761a # master (2026-09-05) - name: Build project shell: cmd @@ -97,9 +98,12 @@ jobs: - name: Package id: package shell: pwsh + env: + REF_TYPE: ${{ github.ref_type }} + REF_NAME: ${{ github.ref_name }} run: | - if ("${{ github.ref_type }}" -eq "tag") { - $version = "${{ github.ref_name }}" + if ($env:REF_TYPE -eq "tag") { + $version = $env:REF_NAME } else { $version = (git describe --tags --match "v3.*" --always).Trim() } @@ -117,7 +121,7 @@ jobs: "$hash $name.zip" | Out-File "dist\$name.zip.sha256" -Encoding ascii -NoNewline Get-ChildItem -Recurse "dist\$name" | Select-Object -ExpandProperty FullName - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: libmodsecurity-windows-${{ matrix.platform.label }}-${{ matrix.configuration }} path: | @@ -128,13 +132,14 @@ jobs: publish: name: Attach packages to release needs: build - if: github.ref_type == 'tag' + # a workflow_dispatch run on a tag ref only builds, it must not publish + if: github.event_name == 'push' && github.ref_type == 'tag' runs-on: ubuntu-latest permissions: contents: write steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: pattern: libmodsecurity-windows-* merge-multiple: true From e02c38a41017e1cbb0f8fdf791555adb1a477d16 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Thu, 22 Oct 2026 21:01:44 +0200 Subject: [PATCH 6/8] Address review of the Windows release workflow Drop the Conan cache from the release build (cache poisoning), pin Conan, fail on DLL dependencies outside an allowlist, attest build provenance, publish only for v3.X.Y tags, and ship a PDB with the Release packages. Leave the project version in build/win32/CMakeLists.txt as it was; #3653 replaces it with the version read from modsecurity.h. --- .github/workflows/release-windows.yml | 44 +++++++++++++++------------ build/win32/CMakeLists.txt | 11 +++++-- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 2b87ac546..ee609af9a 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -3,12 +3,13 @@ name: Windows release packages # Builds libModSecurity for Windows (x86 and x64, Release and Debug), runs the # test suite and packages the DLL, import library and public headers into one # zip per arch and configuration. All builds use the dynamic CRT (/MD, /MDd). -# On a v3.* tag the zips are attached to the GitHub release of that tag. -# See issue #3313. +# On a release tag (v3.X.Y) the zips are attached to the GitHub release of that +# tag, with a build provenance attestation. See issue #3313. on: push: - tags: ['v3.*'] + # release tags only; test or pre-release tags (v3.X.Y-suffix) do not match + tags: ['v3.[0-9]+.[0-9]+'] workflow_dispatch: permissions: @@ -43,22 +44,11 @@ jobs: - name: Install Conan package manager run: | - pip3 install conan --upgrade + pip3 install conan==2.33.0 conan profile detect --force - # ImageVersion is a runner env var, not visible to the env context - - name: Get runner image version - id: image - shell: pwsh - run: '"version=$env:ImageVersion" >> $env:GITHUB_OUTPUT' - - - name: Restore Conan cache - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ~/.conan2/p - key: conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}-${{ hashFiles('build/win32/conanfile.txt') }} - restore-keys: | - conan-${{ runner.os }}-${{ steps.image.outputs.version }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}- + # no Conan cache on purpose: these binaries are published, and a restored + # cache could inject modified dependency packages into them - uses: ammaraskar/msvc-problem-matcher@47189a176388253d16c6f0b79eee6274512b761a # master (2026-09-05) @@ -113,8 +103,17 @@ jobs: if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # the DLL must not depend on anything beyond system DLLs and the VC++ runtime - # (the debug VC++ runtime for Debug builds) - dumpbin /nologo /dependents "dist\$name\bin\libModSecurity.dll" + # (the debug VC++ runtime for Debug builds); a dependency that became shared + # would pass the tests in the build tree but fail to load for users + $allowed = '^(kernel32|advapi32|user32|ws2_32|iphlpapi|crypt32|bcrypt|msvcp140d?|vcruntime140(_1)?d?|ucrtbased?|api-ms-win-crt-[a-z0-9-]+)\.dll$' + $deps = dumpbin /nologo /dependents "dist\$name\bin\libModSecurity.dll" | + ForEach-Object { $_.Trim() } | Where-Object { $_ -match '^[^\s\\]+\.dll$' } + $deps + $unexpected = $deps | Where-Object { $_ -notmatch $allowed } + if (-not $deps -or $unexpected) { + Write-Error "Unexpected DLL dependencies: $($unexpected -join ', ')" + exit 1 + } Compress-Archive -Path "dist\$name" -DestinationPath "dist\$name.zip" $hash = (Get-FileHash "dist\$name.zip" -Algorithm SHA256).Hash.ToLower() @@ -137,6 +136,8 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + id-token: write + attestations: write steps: - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 @@ -144,6 +145,11 @@ jobs: pattern: libmodsecurity-windows-* merge-multiple: true + - name: Attest build provenance + uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: libmodsecurity-*-windows-*.zip + - name: Upload to release env: GH_TOKEN: ${{ github.token }} diff --git a/build/win32/CMakeLists.txt b/build/win32/CMakeLists.txt index 0251c927d..11454f114 100644 --- a/build/win32/CMakeLists.txt +++ b/build/win32/CMakeLists.txt @@ -94,7 +94,7 @@ message("-- Detecting Mbed TLS version - ${MBEDTLS_VERSION}") project(libModSecurity VERSION - 3.0.17 + 3.0.14 LANGUAGES CXX ) @@ -162,6 +162,11 @@ target_compile_definitions(libModSecurity PRIVATE WITH_PCRE2) target_include_directories(libModSecurity PRIVATE ${BASE_DIR} ${BASE_DIR}/headers ${BASE_DIR}/others ${MBEDTLS_DIR}/include ${TF_PSA_CRYPTO_DIR}/include ${TF_PSA_CRYPTO_DIR}/drivers/builtin/include) target_link_libraries(libModSecurity PRIVATE pcre2::pcre2 libinjection mbedcrypto Poco::Poco Iphlpapi.lib) +# generate a PDB for Release too, so crash dumps of the released DLL can be symbolized; +# /DEBUG turns off /OPT:REF and /OPT:ICF, so turn them back on +target_compile_options(libModSecurity PRIVATE $<$:/Zi>) +target_link_options(libModSecurity PRIVATE $<$:/DEBUG /OPT:REF /OPT:ICF>) + macro(add_package_dependency project compile_definition link_library flag) if(${flag}) target_compile_definitions(${project} PRIVATE ${compile_definition}) @@ -296,7 +301,7 @@ target_link_libraries(rules_check PRIVATE libModSecurity) # install # # Layout used by the Windows release packages (see .github/workflows/release-windows.yml): -# bin/ libModSecurity.dll (+ .pdb for Debug), rules_check.exe +# bin/ libModSecurity.dll, libModSecurity.pdb, rules_check.exe # lib/ libModSecurity.lib (import library) # include/ public headers # @@ -305,7 +310,7 @@ install(TARGETS libModSecurity RUNTIME DESTINATION bin ARCHIVE DESTINATION lib ) -install(FILES $ DESTINATION bin CONFIGURATIONS Debug RelWithDebInfo OPTIONAL) +install(FILES $ DESTINATION bin CONFIGURATIONS Debug Release RelWithDebInfo OPTIONAL) install(TARGETS rules_check RUNTIME DESTINATION bin) install(DIRECTORY ${BASE_DIR}/headers/modsecurity DESTINATION include FILES_MATCHING PATTERN "*.h") install(FILES From 9ee3564fd3296be9d9ebb50045dfc058671189d7 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Thu, 22 Oct 2026 21:11:27 +0200 Subject: [PATCH 7/8] Use one generator expression per Release linker option --- build/win32/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/win32/CMakeLists.txt b/build/win32/CMakeLists.txt index 11454f114..f9382d4fe 100644 --- a/build/win32/CMakeLists.txt +++ b/build/win32/CMakeLists.txt @@ -165,7 +165,10 @@ target_link_libraries(libModSecurity PRIVATE pcre2::pcre2 libinjection mbedcrypt # generate a PDB for Release too, so crash dumps of the released DLL can be symbolized; # /DEBUG turns off /OPT:REF and /OPT:ICF, so turn them back on target_compile_options(libModSecurity PRIVATE $<$:/Zi>) -target_link_options(libModSecurity PRIVATE $<$:/DEBUG /OPT:REF /OPT:ICF>) +target_link_options(libModSecurity PRIVATE + $<$:/DEBUG> + $<$:/OPT:REF> + $<$:/OPT:ICF>) macro(add_package_dependency project compile_definition link_library flag) if(${flag}) From 41865cdd625bd77d12e7bd4b740c75048f6f4f38 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Thu, 22 Oct 2026 21:47:44 +0200 Subject: [PATCH 8/8] Retry rate-limited dependency downloads in the Windows release build Without the Conan cache, dependency sources are downloaded from their upstream hosts on every release run; git.openldap.org answered the parallel jobs with HTTP 429, and Conan gave up after 2 retries. --- .github/workflows/release-windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index ee609af9a..c858a389b 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -46,6 +46,11 @@ jobs: run: | pip3 install conan==2.33.0 conan profile detect --force + # without a cache, dependency sources are downloaded from their upstream + # hosts on every run, and some (git.openldap.org) rate limit with HTTP 429 + $conf = Join-Path (conan config home) "global.conf" + Add-Content $conf "tools.files.download:retry=10" + Add-Content $conf "tools.files.download:retry_wait=30" # no Conan cache on purpose: these binaries are published, and a restored # cache could inject modified dependency packages into them