From 517b30e5ec253574a4113eeba9496e80fd85718b Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 30 Nov 2023 11:25:31 -0700 Subject: [PATCH 1/7] CI: Update to macOS 13 GitHub's action runner complains that we're still trying to use macOS 11 and is killing the builds. This requires some tinkering with the brew packages that are installed, but don't like to update cleanly (python and php specifically). --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6946d93b..717634d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,13 +113,19 @@ jobs: path: build/dist/${{env.ZA_DIST}} # TODO: Install Zeek and run Zeek tests. - release_macos_11: - runs-on: macos-11 + release_macos_13: + runs-on: macos-13 environment: ${{ (github.ref == 'refs/heads/main' || (startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-dev'))) && 'release' || '' }} steps: - name: Prepare run: | + brew update + brew unlink python + brew link --overwrite python + brew upgrade --force python + brew upgrade --force php + brew upgrade brew install ninja ccache pip3 install btest zkg @@ -341,7 +347,7 @@ jobs: contents: write runs-on: ubuntu-latest if: (startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-dev')) - needs: [debug_ubuntu_latest, release_alpine_3_15_static, release_macos_11, release_windows_2022, release_source] + needs: [debug_ubuntu_latest, release_alpine_3_15_static, release_macos_13, release_windows_2022, release_source] steps: - name: Checkout code uses: actions/checkout@v2 From adf369e29d6980cf741f619e891dcc007783b19b Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 30 Nov 2023 11:43:07 -0700 Subject: [PATCH 2/7] CI: Update github actions used across all jobs --- .github/workflows/main.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 717634d1..d7dd7ee2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,12 +30,12 @@ jobs: echo "/opt/zeek/bin:$PATH" >> $GITHUB_PATH - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.job }} @@ -54,7 +54,7 @@ jobs: # TODO: tidy fails in Broker currently # ninja -C build tidy - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: failure() with: name: Test output @@ -78,12 +78,12 @@ jobs: pip3 install btest zkg - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.job }} @@ -107,7 +107,7 @@ jobs: ninja -C build package (cd build/dist && echo "ZA_DIST=$(echo *.tar.gz)" >>$GITHUB_ENV) - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{env.ZA_DIST}} path: build/dist/${{env.ZA_DIST}} @@ -131,12 +131,12 @@ jobs: pip3 install btest zkg - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.job }} @@ -213,7 +213,7 @@ jobs: ### Back to running on all branches - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{env.ZA_DIST}} path: build/dist/${{env.ZA_DIST}} @@ -232,7 +232,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive @@ -250,7 +250,7 @@ jobs: shell: cmd - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.job }} @@ -296,7 +296,7 @@ jobs: (cd build/dist && echo "ZA_DIST=$(echo *.msi)" >>$GITHUB_ENV) shell: bash - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{env.ZA_DIST}} path: build/dist/${{env.ZA_DIST}} @@ -313,12 +313,12 @@ jobs: sudo apt-get install -y ninja-build ccache curl ca-certificates - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.job }} @@ -337,7 +337,7 @@ jobs: cat build/dist/${{env.ZA_DIST}} | (cd ${{ runner.temp }}/test-build && tar xzvf -) (cd $(echo ${{ runner.temp }}/test-build/zeek-agent*) && ./configure --generator=Ninja --enable-ccache && ninja -C build && ninja -C build test) - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{env.ZA_DIST}} path: build/dist/${{env.ZA_DIST}} @@ -350,7 +350,7 @@ jobs: needs: [debug_ubuntu_latest, release_alpine_3_15_static, release_macos_13, release_windows_2022, release_source] steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive @@ -359,7 +359,7 @@ jobs: cat CHANGES | awk '/^[0-9]+\./{ n++; next; } n < 2 { print }' >${{ runner.temp }}/release-msg echo "release_name=$(echo ${{ github.ref_name }} | sed 's/^v//')" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: path: artifacts From 3cd6c243c85eac90f22b4761d5283563c8b3011f Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 30 Nov 2023 11:58:45 -0700 Subject: [PATCH 3/7] CI: Update ubuntu builds to use zeek 5.0.9 for ubuntu22, remove zeek 4.0 build --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7dd7ee2..93d6eb3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - zeek: [{version: 4.0.4-0, tag: -lts}, {version: 5.0.0-0, tag: -rc}] + zeek: [{version: 5.0.9-0, tag: -lts}] env: ZEEK_VERSION: ${{ matrix.zeek.version }} @@ -25,7 +25,7 @@ jobs: - name: Install Zeek run: | - (cd /tmp && curl -L -O https://download.zeek.org/binary-packages/xUbuntu_20.04/amd64/zeek${ZEEK_TAG}-core_${ZEEK_VERSION}_amd64.deb) + (cd /tmp && curl -L -O https://download.zeek.org/binary-packages/xUbuntu_22.04/amd64/zeek${ZEEK_TAG}-core_${ZEEK_VERSION}_amd64.deb) sudo apt install -y /tmp/zeek${ZEEK_TAG}-core_${ZEEK_VERSION}_amd64.deb echo "/opt/zeek/bin:$PATH" >> $GITHUB_PATH From 87aeb509c9d759c6925e4e4993f9eb0e7b2e482f Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 30 Nov 2023 13:15:19 -0700 Subject: [PATCH 4/7] Update doctest to v2.4.11 This fixes, among other things, build failures on macOS due to sprintf being fully deprecated in XCode 14. --- 3rdparty/doctest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/doctest b/3rdparty/doctest index 4d8716f1..ae7a1353 160000 --- a/3rdparty/doctest +++ b/3rdparty/doctest @@ -1 +1 @@ -Subproject commit 4d8716f1efc1d14aa736ef52ee727bd4204f4c40 +Subproject commit ae7a13539fb71f270b87eb2e874fbac80bc8dda2 From 34b4f4111fc2de6a8ac6cb81ce1fbadb637ce386 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Wed, 29 Nov 2023 11:43:53 -0700 Subject: [PATCH 5/7] Update vcpkg to 2023.11.20 This fixes the build on Windows failing to find zlib. --- 3rdparty/vcpkg | 2 +- vcpkg.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/3rdparty/vcpkg b/3rdparty/vcpkg index cef0b3ec..a42af01b 160000 --- a/3rdparty/vcpkg +++ b/3rdparty/vcpkg @@ -1 +1 @@ -Subproject commit cef0b3ec767df6e83806899fe9525f6cf8d7bc91 +Subproject commit a42af01b72c28a8e1d7b48107b33e4f286a55ef6 diff --git a/vcpkg.json b/vcpkg.json index 8ad6fe08..288bd24b 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,6 +2,7 @@ "name": "main", "version-string": "latest", "dependencies": [ + "pthreads", "openssl", "zlib" ] From 79a27d774952e89d4e38793d09c82d27a3997473 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Wed, 29 Nov 2023 11:49:38 -0700 Subject: [PATCH 6/7] CI: Use correct vcpkg root for Windows builds --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93d6eb3b..b70ec268 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -273,7 +273,7 @@ jobs: - name: Configure run: > - cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_MAKE_PROGRAM=ninja.exe -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_CCACHE=yes -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TARGET_TRIPLET}} + cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_MAKE_PROGRAM=ninja.exe -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_CCACHE=yes -DCMAKE_TOOLCHAIN_FILE="3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TARGET_TRIPLET}} shell: cmd - name: Build From cd5f4432cb6a6e1210c5ce6294d6d6c5ed03d0bb Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 30 Nov 2023 10:55:13 -0700 Subject: [PATCH 7/7] Add section about building for Windows to README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index b3f9a03f..a5784f85 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,13 @@ Selected `configure` options (see `--help` for more): On macOS with Homebrew, use `--with-openssl={/usr/local,/opt/homebrew}/opt/openssl@1.1` +##### Windows + +For Windows builds, any recent version of Visual Studio will work. You will need +to pass `-DCMAKE_TOOLCHAIN_FILE="3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake"` +to the CMake invocation. This will make vcpkg install the proper dependencies for +the build. + #### Usage On all endpoints, run as `root`: