From 12e6efa55f9a1a758362614be7dec66e5db31bd4 Mon Sep 17 00:00:00 2001 From: Seth Grover Date: Wed, 25 Oct 2023 07:57:44 -0600 Subject: [PATCH] fix zeek build in sensor (hopefully) --- sensor-iso/config/hooks/normal/0169-pip-installs.hook.chroot | 2 ++ sensor-iso/config/hooks/normal/0910-sensor-build.hook.chroot | 5 +++++ .../config/hooks/normal/0990-remove-unwanted-pkg.hook.chroot | 2 +- sensor-iso/config/package-lists/build.list.chroot | 3 ++- sensor-iso/zeek/Dockerfile | 3 ++- sensor-iso/zeek/build-zeek-deb.sh | 5 ++++- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sensor-iso/config/hooks/normal/0169-pip-installs.hook.chroot b/sensor-iso/config/hooks/normal/0169-pip-installs.hook.chroot index fc48f7cbf..a1b67dde1 100755 --- a/sensor-iso/config/hooks/normal/0169-pip-installs.hook.chroot +++ b/sensor-iso/config/hooks/normal/0169-pip-installs.hook.chroot @@ -4,6 +4,8 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 +export PYTHONDONTWRITEBYTECODE=1 +export PYTHONUNBUFFERED=1 # python 3 pip3 install --break-system-packages --no-compile --no-cache-dir --force-reinstall --upgrade \ diff --git a/sensor-iso/config/hooks/normal/0910-sensor-build.hook.chroot b/sensor-iso/config/hooks/normal/0910-sensor-build.hook.chroot index df0280d07..a13c7c9a0 100755 --- a/sensor-iso/config/hooks/normal/0910-sensor-build.hook.chroot +++ b/sensor-iso/config/hooks/normal/0910-sensor-build.hook.chroot @@ -5,6 +5,11 @@ # some environment variables needed for build export CCACHE_DIR="/var/spool/ccache" export CCACHE_COMPRESS=1 +export CMAKE_C_COMPILER="clang-14" +export CMAKE_CXX_COMPILER="clang++-14" +export CXXFLAGS="-stdlib=libc++ -lc++abi" +export PYTHONDONTWRITEBYTECODE=1 +export PYTHONUNBUFFERED=1 # we'll use cURL to get release information and assets from GitHub using the GitHub API GITHUB_API_CURL_ARGS=() diff --git a/sensor-iso/config/hooks/normal/0990-remove-unwanted-pkg.hook.chroot b/sensor-iso/config/hooks/normal/0990-remove-unwanted-pkg.hook.chroot index 187939205..09adb6273 100755 --- a/sensor-iso/config/hooks/normal/0990-remove-unwanted-pkg.hook.chroot +++ b/sensor-iso/config/hooks/normal/0990-remove-unwanted-pkg.hook.chroot @@ -9,7 +9,7 @@ apt-get -y --purge remove \ libc6-dbg \ ninja-build \ sparse \ - $(dpkg --get-selections | grep -Pv "(^(dpkg|libbroker|libc\+\+|libc6|libcrypt|libdbus|libffi|libfl|libgcc|libmaxminddb|libncurses|libnsl|libobjc|libomp|libpcap|libssl|libstdc|libtinfo|libtirpc|libxml|libyaml|libz|linux-libc|zeek|zlib1g)|deinstall$)" | cut -f1 | grep -P -- '-dev(:\w+)?$') || true + $(dpkg --get-selections | grep -Pv "(^(dpkg|libbroker|libc\+\+(abi)?|libc6|libclang|libcrypt|libdbus|libffi|libfl|libgoogle-perftools|libgcc|libkrb5|libmaxminddb|libncurses|libnsl|libobjc|libomp|libpcap|libssl|libstdc|libtinfo|libtirpc|libunwind|libxml|libyaml|libz|linux-libc|python3|zeek|zlib1g)|deinstall$)" | cut -f1 | grep -P -- '-dev(:\w+)?$') || true rm -rf /var/spool/ccache # remove unwanted packages diff --git a/sensor-iso/config/package-lists/build.list.chroot b/sensor-iso/config/package-lists/build.list.chroot index e316d4003..041096945 100644 --- a/sensor-iso/config/package-lists/build.list.chroot +++ b/sensor-iso/config/package-lists/build.list.chroot @@ -9,6 +9,7 @@ libc++abi-dev libfl-dev libgoogle-perftools-dev libjansson-dev +libkrb5-dev libmagic-dev libmaxminddb-dev libnl-3-dev @@ -20,4 +21,4 @@ make ninja-build patch swig -zlib1g-dev \ No newline at end of file +zlib1g-dev diff --git a/sensor-iso/zeek/Dockerfile b/sensor-iso/zeek/Dockerfile index 55b2f1291..3e07130ee 100644 --- a/sensor-iso/zeek/Dockerfile +++ b/sensor-iso/zeek/Dockerfile @@ -22,11 +22,12 @@ RUN apt-get -q update && \ cmake \ curl \ flex \ + git \ libc++-dev \ libc++abi-dev \ libfl-dev \ - libgoogle-perftools4 \ libgoogle-perftools-dev \ + libgoogle-perftools4 \ libkrb5-3 \ libkrb5-dev \ libmaxminddb-dev \ diff --git a/sensor-iso/zeek/build-zeek-deb.sh b/sensor-iso/zeek/build-zeek-deb.sh index 104b7bbee..d16c552db 100755 --- a/sensor-iso/zeek/build-zeek-deb.sh +++ b/sensor-iso/zeek/build-zeek-deb.sh @@ -2,8 +2,11 @@ # Copyright (c) 2023 Battelle Energy Alliance, LLC. All rights reserved. -export CCACHE_DIR=/var/spool/ccache +export CCACHE_DIR="/var/spool/ccache" export CCACHE_COMPRESS=1 +export CMAKE_C_COMPILER="clang-14" +export CMAKE_CXX_COMPILER="clang++-14" +export CXXFLAGS="-stdlib=libc++ -lc++abi" export PYTHONDONTWRITEBYTECODE=1 export PYTHONUNBUFFERED=1