Merge remote-tracking branch 'origin/topic/timw/windows-zeromq-support'

* origin/topic/timw/windows-zeromq-support:
  Reword comment about when ZeroMQ is required for the build
  CI: Add label for enabling the Windows build in PRs
  Enable building ZeroMQ support on Windows
This commit is contained in:
Tim Wojtulewicz 2025-09-16 13:31:39 -07:00
commit 067c257480
7 changed files with 34 additions and 14 deletions

View file

@ -143,6 +143,12 @@ skip_if_pr_not_full_or_zeekctl: &SKIP_IF_PR_NOT_FULL_OR_ZEEKCTL
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" ) ( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
) )
skip_if_pr_not_full_or_windows: &SKIP_IF_PR_NOT_FULL_OR_WINDOWS
skip: >
( ( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS !=~ ".*CI: (Full|Windows).*" ) ||
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
)
ci_template: &CI_TEMPLATE ci_template: &CI_TEMPLATE
# Default timeout is 60 minutes, Cirrus hard limit is 120 minutes for free # Default timeout is 60 minutes, Cirrus hard limit is 120 minutes for free
# tasks, so may as well ask for full time. # tasks, so may as well ask for full time.
@ -633,7 +639,7 @@ windows_task:
build_script: ci/windows/build.cmd build_script: ci/windows/build.cmd
test_script: ci/windows/test.cmd test_script: ci/windows/test.cmd
<< : *ONLY_IF_PR_MASTER_RELEASE << : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI << : *SKIP_IF_PR_NOT_FULL_OR_WINDOWS
env: env:
ZEEK_CI_CPUS: 8 ZEEK_CI_CPUS: 8
# Give verbose error output on a test failure. # Give verbose error output on a test failure.

View file

@ -1,3 +1,11 @@
8.1.0-dev.552 | 2025-09-16 13:31:39 -0700
* Reword comment about when ZeroMQ is required for the build (Tim Wojtulewicz, Corelight)
* CI: Add label for enabling the Windows build in PRs (Tim Wojtulewicz)
* Enable building ZeroMQ support on Windows (Tim Wojtulewicz)
8.1.0-dev.548 | 2025-09-16 12:41:52 -0700 8.1.0-dev.548 | 2025-09-16 12:41:52 -0700
* Force SQLite to be in thread-safe mode during CMake (Tim Wojtulewicz, Corelight) * Force SQLite to be in thread-safe mode during CMake (Tim Wojtulewicz, Corelight)

View file

@ -1 +1 @@
8.1.0-dev.548 8.1.0-dev.552

View file

@ -7,5 +7,5 @@ call "c:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliar
mkdir build mkdir build
cd build cd build
cmake.exe .. -DCMAKE_BUILD_TYPE=release -DVCPKG_TARGET_TRIPLET="x64-windows-static" -DENABLE_ZEEK_UNIT_TESTS=yes -DENABLE_CLUSTER_BACKEND_ZEROMQ=no -G Ninja cmake.exe .. -DCMAKE_BUILD_TYPE=release -DVCPKG_TARGET_TRIPLET="x64-windows-static" -DENABLE_ZEEK_UNIT_TESTS=yes -G Ninja
cmake.exe --build . cmake.exe --build .

View file

@ -1,14 +1,16 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/zeromq/cmake") # Default to building ZeroMQ, but add an option that allows it to be disabled
# via CMake.
find_package(ZeroMQ)
# Default to building ZeroMQ only if ZeroMQ was found.
#
# If a user enabled the cluster backend explicitly (-D ENABLE_CLUSTER_BACKEND_ZEROMQ:bool=ON),
# but ZeroMQ wasn' found, hard bail.
option(ENABLE_CLUSTER_BACKEND_ZEROMQ "Enable the ZeroMQ cluster backend" ON) option(ENABLE_CLUSTER_BACKEND_ZEROMQ "Enable the ZeroMQ cluster backend" ON)
if (ENABLE_CLUSTER_BACKEND_ZEROMQ) if (ENABLE_CLUSTER_BACKEND_ZEROMQ)
if (MSVC)
find_package(ZeroMQ CONFIG REQUIRED)
else ()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/zeromq/cmake")
find_package(ZeroMQ REQUIRED)
endif ()
if (NOT ZeroMQ_FOUND) if (NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ENABLE_CLUSTER_BACKEND_ZEROMQ set, but ZeroMQ library not available") message(FATAL_ERROR "ENABLE_CLUSTER_BACKEND_ZEROMQ set, but ZeroMQ library not available")
endif () endif ()

View file

@ -1,6 +1,8 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # On MSVC, ZeroMQ_LIBRARIES may not be set by find_package() earlier in the
# process. If it isn't, set it to the static target generated by vcpkg.
find_package(ZeroMQ REQUIRED) if (MSVC AND NOT ZeroMQ_LIBRARIES)
set(ZeroMQ_LIBRARIES libzmq-static)
endif ()
zeek_add_plugin( zeek_add_plugin(
Zeek Cluster_Backend_ZeroMQ Zeek Cluster_Backend_ZeroMQ

View file

@ -3,7 +3,9 @@
"version-string": "latest", "version-string": "latest",
"dependencies": [ "dependencies": [
"c-ares", "c-ares",
"cppzmq",
"libpcap", "libpcap",
"zeromq",
"zlib" "zlib"
] ]
} }