0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-14 09:38:34 +00:00
netdata_netdata/packaging/utils/compile-on-windows.sh
Costa Tsaousis 2c9bca448e
[WIP] Windows-Events Logs Explorer ()
* preparations

* work on systemd-journal to abstract the components we need to use in windows events logs

* more code reorg to reuse systemd journal

* abstracted logs query parsing and preparation

* fix help printing

* moved non-LQS fields outside logs_query_status.h

* code re-organization and cleanup

* move lqs cleanup to lqs

* code re-organization and cleanup

* support accurate and approximate data sizes printing

* support for printing durations with spaces, for clarity

* progress on windows events sources

* windows events sources, with a count of logs

* windows events sources, with duration

* windows events sources, with file size

* support for converting between unix and windows timestamps

* fixed conditions

* internal api for querying windows event logs

* extract basic fields from windows events

* fix sid and guid

* users lookup with caching

* basic structure for the netdata plugin

* decode more message fields

* event log sources are now periodically scanned

* progress on building the query for windows events

* first working version

* support external plugins with .plugin.exe suffix

* fix compilation warnings

* fix thread safety

* fixes in severity and buffers used

* match all rows and do not pass empty data to facets

* keyword should be hex

* strict type checking and more fields, including the full XML view

* restructure the code to keep caches between channel queries

* format a message using the XML event data

* message is now formatted as a dynamic field at presentation time

* extracted UserData and applied basic XML formatting on the message

* properly intent nested nodes
2024-09-10 20:03:54 +03:00

83 lines
2.7 KiB
Bash

#!/bin/sh
# On MSYS2, install these dependencies to build netdata:
install_dependencies() {
pacman -S \
git cmake ninja base-devel msys2-devel \
libyaml-devel libzstd-devel libutil-linux libutil-linux-devel \
mingw-w64-x86_64-toolchain mingw-w64-ucrt-x86_64-toolchain \
mingw64/mingw-w64-x86_64-mold ucrt64/mingw-w64-ucrt-x86_64-mold \
msys/gdb ucrt64/mingw-w64-ucrt-x86_64-gdb mingw64/mingw-w64-x86_64-gdb \
msys/zlib-devel mingw64/mingw-w64-x86_64-zlib ucrt64/mingw-w64-ucrt-x86_64-zlib \
msys/libuv-devel ucrt64/mingw-w64-ucrt-x86_64-libuv mingw64/mingw-w64-x86_64-libuv \
liblz4-devel mingw64/mingw-w64-x86_64-lz4 ucrt64/mingw-w64-ucrt-x86_64-lz4 \
openssl-devel mingw64/mingw-w64-x86_64-openssl ucrt64/mingw-w64-ucrt-x86_64-openssl \
protobuf-devel mingw64/mingw-w64-x86_64-protobuf ucrt64/mingw-w64-ucrt-x86_64-protobuf \
msys/pcre2-devel mingw64/mingw-w64-x86_64-pcre2 ucrt64/mingw-w64-ucrt-x86_64-pcre2 \
msys/brotli-devel mingw64/mingw-w64-x86_64-brotli ucrt64/mingw-w64-ucrt-x86_64-brotli \
msys/ccache ucrt64/mingw-w64-ucrt-x86_64-ccache mingw64/mingw-w64-x86_64-ccache \
mingw64/mingw-w64-x86_64-go ucrt64/mingw-w64-ucrt-x86_64-go \
mingw64/mingw-w64-x86_64-nsis \
msys/libcurl msys/libcurl-devel
}
if [ "${1}" = "install" ]
then
install_dependencies || exit 1
exit 0
fi
BUILD_FOR_PACKAGING="Off"
if [ "${1}" = "package" ]
then
BUILD_FOR_PACKAGING="On"
fi
export PATH="/usr/local/bin:${PATH}"
WT_ROOT="$(pwd)"
BUILD_TYPE="Debug"
NULL=""
if [ -z "${MSYSTEM}" ]; then
build="${WT_ROOT}/build-${OSTYPE}"
else
build="${WT_ROOT}/build-${OSTYPE}-${MSYSTEM}"
fi
if [ "$USER" = "vk" ]; then
build="${WT_ROOT}/build"
fi
set -exu -o pipefail
if [ ! -d "${build}" ]
then
/usr/bin/cmake -S "${WT_ROOT}" -B "${build}" \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="/opt/netdata" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DCMAKE_C_FLAGS="-fstack-protector-all -O0 -ggdb -Wall -Wextra -Wno-char-subscripts -Wa,-mbig-obj -pipe -DNETDATA_INTERNAL_CHECKS=1 -D_FILE_OFFSET_BITS=64 -D__USE_MINGW_ANSI_STDIO=1" \
-DBUILD_FOR_PACKAGING=${BUILD_FOR_PACKAGING} \
-DUSE_MOLD=Off \
-DNETDATA_USER="${USER}" \
-DDEFAULT_FEATURE_STATE=Off \
-DENABLE_H2O=Off \
-DENABLE_ML=On \
-DENABLE_BUNDLED_JSONC=On \
-DENABLE_BUNDLED_PROTOBUF=Off \
${NULL}
fi
ninja -v -C "${build}" install || ninja -v -C "${build}" -j 1
#echo
#echo "Compile with:"
#echo "ninja -v -C \"${build}\" install || ninja -v -C \"${build}\" -j 1"
echo "starting netdata..."
# enable JIT debug with gdb
export MSYS="error_start:$(cygpath -w /usr/bin/gdb)"
rm -rf /opt/netdata/var/log/netdata/*.log || echo
/opt/netdata/usr/bin/netdata -D