Commit graph

348 commits

Author SHA1 Message Date
Elad Solomon
f39a29435c Fixed CARES and SUPERVISOR cmake scripts 2022-11-09 18:15:34 +02:00
Elad Solomon
af656a235b Fixed cmake scripts 2022-11-09 18:15:34 +02:00
Tomer Lev
b7cbd946d6 Updating submodule to support new doctest version. Compiling without allowing doctest's multithreading which causes crashes on runtime 2022-11-09 18:15:34 +02:00
Elad Solomon
1b3719cf29 Fix libpcap usage 2022-11-09 18:15:34 +02:00
Elad Solomon
f500c4faf4 Added Compilation flags for vpack 2022-11-09 18:15:34 +02:00
Tim Wojtulewicz
216c00d7e9 Use multithreaded runtime library under MSVC 2022-11-09 18:15:34 +02:00
Tim Wojtulewicz
d352ace4d2 Add conanfile for windows builds 2022-11-09 18:15:34 +02:00
Elad Solomon
3f349b8a37 Optimize initial memory consumption 2022-11-09 18:15:34 +02:00
Elad Solomon
fde3a6b73f Added kqueue as conan package 2022-11-09 18:15:33 +02:00
Elad Solomon
3a80b79497 Compile Zeek with MSVC
Allow Zeek to be embedded in another project
2022-11-09 18:15:30 +02:00
Christian Kreibich
3237ad0ba2 Merge remote-tracking branch 'origin/topic/awelzel/builtin-af-packet'
* origin/topic/awelzel/builtin-af-packet:
  Include in Jan's AF_PACKET plugin as builtin plugin
2022-10-26 16:48:37 -07:00
Tim Wojtulewicz
0ba53de80e Surface a better CMake error if the user passes an invalid sanitizer name 2022-10-17 08:47:50 -07:00
Arne Welzel
0bc7d0905e Include in Jan's AF_PACKET plugin as builtin plugin
This has come up a few times and the motivation is mainly better "first timer"
experience with Zeek. Concretely, if one wants to run a Zeek cluster with
multiple workers and reasonable load balancing on Linux, AF_PACKET is a decent
start. Without AF_PACKET support being built into Zeek, however, a new user's
next experience is that of setting up a development environment in order
to compile an external plugin (think compiler, kernel headers, zkg, ...).
Only to get what could be termed basic functionality.

This is using the ZEEK_INCLUDE_PLUGINS infrastructure. I've used the all
upper case spelling of AF_PACKET in the help output because it seems everyone
else references/writes it like that. I think we should also write it
like that in the docs.
2022-10-13 13:29:27 +02:00
Benjamin Bannier
7774a548ea Add toplevel build dir to PATH for dev helper scripts.
We already added the toplevel build dir to the paths exposed by
`build/zeek-path-dev`, but never made the matching change for
`build/zeek-path-dev.[sh,csh]`. Due to that a shell would have never
found `zeek-config` from the build env like it would have been found for
installations, and could potentially even have picked up a different
one.
2022-10-11 14:32:35 +02:00
Benjamin Bannier
ace80793a8 Remove stray / at the end of directory name.
This variable is used to construct a path where the trailing `/` lead to
full paths like `/foo/spicy-plugin//spicyz`.
2022-10-04 11:03:24 +02:00
Benjamin Bannier
30ee2d703f Remove commented out code. 2022-10-04 11:02:10 +02:00
Benjamin Bannier
13d011da66 Use correct variable to pass existing Spicy root to spicy-plugin.
spicy-plugin can find Spicy in paths given by `SPICY_ROOT_DIR` while
`./configure` instead set `SPICY_ROOT`. With this patch we now set the
correct variable.

We also adjust variations of the previous variable name with different
capitalization which caused us to not properly configure spicy-plugin
(which triggers finding Spicy in its given prefix).

Closes #2363.
2022-08-23 09:10:57 +02:00
Tim Wojtulewicz
99bc16073a Deprecate BRO_PLUGIN_API_VERSION, create zeek::PLUGIN_API_VERSION 2022-07-12 12:01:23 -07:00
Arne Welzel
b77f5fa14c Add gulrak/filesystem to auxil, expose via zeek::filesystem
This adds https://github.com/gulrak/filesystem as a submodule into auxil
as a compiler-independent std::filesystem replacement.

The ghc::filesystem namespace is exposed as zeek::filesystem in util.h.

In the build directory, we add 3rdparty/ghc as a symlink to auxil in
order to support building from the build tree.

    <build_dir>/src/3rdparty/ghc -> /path/to/zeek/src/auxil/filesystem/include/ghc

In the installation tree, the headers are installed into include/zeek/3rdparty:

    <install_dir>/include/zeek/3rdparty/ghc

Note, this differs from how we approached rapidjson which isn't included
using a zeek/3rdparty and instead requires an additional include path of
the following form for external plugins to find and use it.

    <install_dir>/include/zeek/3rdparty/rapidjson/include/

We diverge from this approach. Placing ghc directly into 3rdparty appears
nicer and avoids changing external components (DynamicPlugin.cmake / spicyc)
2022-07-04 13:32:18 +02:00
Christian Kreibich
0be74a0aa8 Provide zeek-client by default
The user so far had to configure with --enable-zeek-client to trigger
installation of the client (from auxil/zeek-client). This flips it around to
allow disabling the installation, and removes --enable-zeek-client from the
Docker build in CI, where we've already been using it to allow the cluster
testsuite to run tests with that image.
2022-06-21 18:17:51 -07:00
Christian Kreibich
9860b5686d Ensure presence of Zeek-related directories in toplevel CMakeLists.txt
This establishes several of the Zeek installation's directories in
CMakeLists.txt, and adds a new ZEEK_STATE_DIR (via `configure --state-dir`) for
arbitrary Zeek-related variable state. It defaults to ZEEK_ROOT/var/lib.

This leaves the existing, zeekctl-related ZEEK_LOCAL_STATE_DIR unchanged and
does not use it. We'll likely deprecate it when removal of zeekctl approaches.
2022-05-23 14:16:59 -07:00
Benjamin Bannier
c68cfd8d8e Always generate helper scripts for Spicy.
We previously only generated these files if configuring a build which
included Spicy. This meant that e.g., `zeek-path-dev.*` scripts would
emit errors for non-existing paths if Spicy was not included.

We now always generate the helper scripts so we can reference them
regardless of build configuration. If Spicy is not included the files
will still be sourced, but have no actual effect.
2022-05-18 09:49:09 +02:00
Benjamin Bannier
83b36dfc54 Include headers in binary dir before other headers.
If e.g., optional dependencies are installed in the same prefix as a
previous Zeek installation, the build would have previously found
`zeek-config.h` from the external prefix instead of from the current
build.

With this patch we now include the current binary dir before any
previously configured include directories (here in particular: optional
dependencies). With that the correct `zeek-config.h` is found.
2022-05-16 09:07:11 +02:00
Benjamin Bannier
95aff9a1e3 Include spicy in build. 2022-05-16 09:07:11 +02:00
Tim Wojtulewicz
c2bf602d94 Add out_ptr, use for c-ares interface calls 2022-04-22 13:10:37 -07:00
Tim Wojtulewicz
336c6ae5c2 Replace nb_dns library with C-Ares 2022-04-22 13:10:37 -07:00
Tim Wojtulewicz
c6023774a3 Enable vptr undefined behavior check 2022-04-20 17:18:57 -07:00
Tim Wojtulewicz
1941fd80f2 Disable object-size analysis if optimization set to -O0 2022-04-14 08:59:05 -07:00
Christian Kreibich
145c7063c6 Add cmake-time reporting of bifcl, binpac, and gen-zam used for build
Cross-compilation requires providing those pre-built for the build host, so it
helps to see confirmation of the three --with-... overrides.
2022-03-21 15:30:10 -07:00
Christian Kreibich
e403dd5fe1 Build Gen-ZAM from a submodule and support use of pre-existing executable
This separates Gen-ZAM from the main Zeek distribution and places it in a
submodule at auxil/gen-zam, reflecting binpac and bifcl. Configuring with
--with-gen-zam=... allws reuse of an existing executable.
2022-03-21 15:30:07 -07:00
Robin Sommer
5f1f005142
Merge remote-tracking branch 'origin/topic/neverlord/hide-caf'
* origin/topic/neverlord/hide-caf:
  Fix GCC builds and string output for Broker errors
  Update to latest Broker without public CAF dep
2022-02-07 16:25:22 +01:00
Tim Wojtulewicz
059120003f Fix --with-jemalloc configure option on FreeBSD 2022-01-12 10:16:15 -07:00
Tim Wojtulewicz
c786dc8f48 Enable null check for UBSan 2022-01-10 11:11:04 -07:00
Craig Leres
8f2ac836f8 Make FreeBSD more flexible, don't look for jemalloc unless we were
given a specific path for it.
2022-01-04 17:19:43 -08:00
Dominik Charousset
56f30b500a Update to latest Broker without public CAF dep 2021-12-20 08:16:21 +01:00
Craig Leres
47a267130b Set JEMALLOC_FOUND when on FreeBSD (suggested by Tim Wojtulewicz) 2021-12-03 15:23:50 -08:00
Craig Leres
1778bc5fa8 FreeBSD: don't look for jemalloc as a package, it's in the base system 2021-12-03 14:46:09 -08:00
Johanna Amann
253d214126 OpenSSL 3: fix warnings and tests
This commit fixes the compile-time warnings that OpenSSL 3.0 raises for
our source-code. For the cases where this was necessary we now have two
implementations - one for OpenSSL 1.1 and earlier, and one for OpenSSL
3.0.

This also makes our testsuite pass with OpenSSL 3.0

Relates to GH-1379
2021-11-17 13:33:49 +00:00
Tim Wojtulewicz
0369ca01bc Disable the scripts.base.frameworks.logging.sqlite.simultaneous-writes test under TSan
Due to a bug (or intentional code) in SQLite, we disabled enabling the shared cache
in sqlite3 if running under ThreadSanitizer (see cf1fefbe0b0a6163b389cc92b5a6878c7fc95f1f).
Unfortunately, this has the side-effect of breaking the simultaneous-writes test because
the shared cache is disabled. This is hopefully a temporary fix until SQLite fixes the
issue on their side.
2021-09-03 10:38:15 -07:00
Tim Wojtulewicz
a9deb1bfd2 GH-1654: Exclude the .git directory when installing cmake files 2021-07-29 15:30:21 -07:00
Christian Kreibich
a6b0fde65f Add zeek-client via new submodule
The new module resides in auxil/zeek-client. It does not get installed unless
one configures with --enable-zeek-client.
2021-07-08 13:12:53 -07:00
Seth Hall
d08230ef8c Switch to more accurate source and binary references in cmake
This is mostly involved with moving CMAKE_SOURCE_DIR and
CMAKE_BINARY_DIR to PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR because it
enables zeek to be built as a subproject of another.

There is another branch in the cmake repository with the same name that
is also required for this to fully work.
2021-06-23 10:26:17 +00:00
Seth Hall
8222193525 Fixes for the builtin plugin functionality 2021-06-11 18:52:03 +00:00
Seth Hall
e399b537ca Added --include-plugins configure argument 2021-06-10 10:39:13 -07:00
Johanna Amann
f76a95a2c2 Merge remote-tracking branch 'origin/topic/christian/install-btest-tooling'
* origin/topic/christian/install-btest-tooling:
  Explain zeek-config options in help output
  Sort variables at top of zeek-config alphabetically
  Install Zeek's btest tooling with the distribution
2021-05-10 10:26:59 +01:00
Jon Siwek
444fd8ff43 GH-960: Fix include order of bundled header files
Previously, a system-wide installation of any bundled auxil/ software
(like CAF) may get found/included rather than the bundled version and
possibly break the build.
2021-03-26 16:26:49 -07:00
Vlad Grigorescu
4557b0907c Expose a configure-time option to set the plugin path.
I believe that this is the last option presented during the build summary which wasn't available to be set by the user.
2021-03-12 21:22:01 -06:00
Christian Kreibich
463d159bfc Install Zeek's btest tooling with the distribution
This creates $PREFIX/share/btest in the install tree, with the
following folders:

- scripts/ for the canonifiers
- data/ for random.seed
- data/pcaps for the test pcaps

The pcaps can be skipped by configuring with --disable-btest-pcaps.
2021-03-11 13:00:15 -08:00
Jon Siwek
8a8a983c49 Add missing zeek/ to header includes
Related to https://github.com/zeek/zeek/pull/1377
2021-01-29 19:16:29 -08:00
Christian Kreibich
a6e086b662 Install BTest with Zeek
Configuring with --disable-btest skips the installation. The main
reason for doing this is that many Zeek packages come with testsuites
that nearly always require btest, so providing btest out of the box
makes sense. Note that zkg's recent additions to its PATH environment
variable management mean that this btest instance is automatically
found also when the Zeek installation's binary folder isn't in the
path.
2021-01-20 13:52:14 -08:00