0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-15 01:58:34 +00:00
Commit graph

64 commits

Author SHA1 Message Date
Austin S. Hemmelgarn
787cfeed1a
Significantly simplify the protobuf handling in CMake. () 2024-05-01 07:04:28 -04:00
Austin S. Hemmelgarn
cc33fbe673
Clean up handling of compiler flags in CMake. ()
* Move all handling of compilation flags inot compiler flags module.

Also, make including the module do all the required compiler flag
changes.

* Switch compiler flag handling to (mostly) use properties.

This makes it easier to override individual flags on a per-target
basis and also results in slightly simpler CMake code.

* Fix typos in compiler flag handling.

* Fix missing quotes.
2024-05-01 07:04:04 -04:00
vkalintiris
5973417027
Use CPack to generate Debian packages ()
* CPack

* Add script to build all artifacts.

* Add infrastructure to run package builds via CPack in CI.

* Fix typos in distro config.

* Fix permissions on package-build script.

* Control files for netdata package

* pre/post inst files for debugfs.

* Fix directory name handling for package build.

* pre/post inst scripts for cups

* pre/post inst scripts for xenstat

* pre/post inst scripts for slabinfo

* pre/post inst scripts for apps

* pre/post inst scripts for network-viewer

* pre/post inst script for nfacct

* pre/post inst scripts for freeipmi

* pre/post inst scripts for logs-management

* pre/post inst perf

* pre/post inst scripts for systemd-journal

* pre/post init scripts for go.d

* pre/post inst scripts for ebpf

* pre/post init files for charts.d & python.d

* Skip eBPF in packaging.

* Fix most of the package names

* Add copyright

* etc/default/netdata

* Bump

* Enable all packages except for ebpf.

* Add log2journal to netdata component.

* Produce pretty-much the same RFS.

- No README.md docs
- /var/run/netdat missing on CPack's side
- No ebpf
- No changelogs

* Enable ebpf plugin

* Fix runtime path

* Build debug symbol packages

* Update package directory

* Fix eBPF and Xenstat conditionals.

* Fixes for package build process.

* Package version for cpack

* Add ebpf-code-legacy package

* Update extraction logic

* Fix control info for netdata package

* Fix control file for chartsd plugin package

* Fix typos in package build script.

* Update dependencies

* Add python3

* Fix verbose option to cpack

* Add whitespace in package description field.

* SKip adding files that might break rpm packages

* Final fixups to package handling.

* Fix architecture matching for package build options.

* Fix dependency handling.

* Remove top-level scripts

---------

Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud>
2024-04-30 07:45:23 -04:00
Austin S. Hemmelgarn
9b3b4816c1
Move handling of legacy eBPF programs into CMake. ()
* Move handling of legacy eBPF programs into CMake.

* Fix typos.

* Fix more typos

* Fix up packaging code.
2024-04-25 09:21:03 +03:00
Austin S. Hemmelgarn
e63cc315b5
Fix handling of kernel version detection in CMake. () 2024-04-24 14:31:00 +03:00
Austin S. Hemmelgarn
aa6d30384d
Move libbpf and eBPF CO-RE bundling into CMake. ()
* Move libbpf and eBPF CO-RE bundling into CMake.

* Silence CMP0135 warnings.

* Fix handling of legacy eBPF code.

* Only enable eBPF by default on Linux.

* Correctly auto-detect the need for legacy libbpf.

* Fix include paths for libbpf linking.

* Add coreutils dependency on Alpine.

* Fix ebpf code handling.

* Fix lib path handling for libbpf.a.

* Correctly fix libbpf lib directory handling.

* Use correct comparison type.
2024-04-24 09:17:23 +03:00
Austin S. Hemmelgarn
e834982560
Move vendoring of Sentry to it’s own module and switch to using Git instead of the releases page. ()
* Move vendoring of Sentry to it’s own module.

Also, switch to pulling from the git repo instead of the release URL, as
it’s more reliable, less prone to potential tampering, and also more
consistent with all of our other vendoring.

* Actually remove the Sentry vendoring code that was in the main file.
2024-04-10 11:03:49 -04:00
Austin S. Hemmelgarn
0f5b137471
Move bundling of JSON-C to CMake. ()
* Move bundling of JSON-C to CMake.

* Fix JSON-C build option passing.

* Force CMake policy 77 to new behavior for JSON-C build.

This is required to ensure that options we set are propagated correctly
into the sub-project.

* Fix include path selection and handling for bundled JSON-C.

* Fix include ordering again.

* Fixup JSON header compat link handling.
2024-04-10 08:30:17 -04:00
Ilya Mashchenko
ec01c7665c
go.d: set User-Agent automatically when creating HTTP req () 2024-03-29 09:27:51 +02:00
Austin S. Hemmelgarn
7da059a24f
Assorted macOS build fixes. ()
* Use zlib provided by the system itself on macOS.

Searching for it with find_package() should always work on macOS since
it will find the system copy, which is always going to be there.

* Use native libuuid on macOS.

Much like zlib, macOS provides a libuuid implementation that (should)
work for us, so just use that instead of fighting with brew to find one.

* Don’t prepend system include paths.

* Skip Linux-specific checks on macOS.

This isn’t technically broken, but not making these checks makes
debugging of the build system easier.

* Minor CMake restructure.
2024-03-26 07:43:03 -04:00
Austin S. Hemmelgarn
8128af5210
Move bundling of libyaml to CMake. () 2024-03-20 14:03:15 -04:00
Austin S. Hemmelgarn
804fd4ce54
Prefer Protobuf’s own CMake config over CMake's FindProtobuf. ()
* Prefer Protobuf’s own CMake config over CMake's FindProtobuf.

The FindProtobuf CMake module shipped by upstream CMake is broken for
Protobuf version 22.0 and newer because it does not correctly pull in
the new Abseil dependencies. Protobuf itself sometimes ships a CMake
Package Configuration module that _does_ work correctly, so use that in
preference to the Find module shipped with CMake.

Upstream bug reference: https://gitlab.kitware.com/cmake/cmake/-/issues/24321

* Properly handle protoc executable.

* Restructure to explicitly handle fallback case ourselves.

This allows proper handling of compatibility code in a way that actually
works for us without us needing to ship a special module to handle the
compatibility case.

* Switch to bundling protobuf via CMake instead of an external script.

* Fix handling of Protobuf inclusion.

- Add correct include directories for protoc.
- Skip installing protobuf when installing the agent.

* Drop spurious quotation marks.

* Properly fix generator expression for protoc include paths.

* Properly default to bundling protobuf in installer code.

* Disable ASAN in unit tests.

It doesn’t work with the modified protobuf handling and per discussion
with the team is non-critical.

* Change comment based on review.

* Revert "Disable ASAN in unit tests."

This reverts commit 6cb98b1b59.

* Disable IPMI and NFACCT plugins for unit tests.

We don’t actually have any unit tests for them, and they cause issues
building reliably in the unit testing environment.

* Disable ASAN for Abseil and Protobuf when vendoring them.

* Switch to commit hashes for protobuf/abseil.

* Restructure to better encapsulate protobuf handling as it’s own module.

* Fix up bundled protobuf version handling.

Google has complicated rules for C++ build environment support, so we
really need to be checking compiler versions and not _just_ C++ standard
version.

* Fix warnings about invalid defines.
2024-03-20 07:13:44 -04:00
Austin S. Hemmelgarn
4b7d920b44
Integrate Go plugin with build system. ()
* Integrate Go plugin with build system.

* Fix Debian packaging rules.

* Add FreeBSD support to Go toolchain handling.

* Add Go ldflags handling.

* Fix version detection when GCCGO is used.

* Fix Go ldflags handling.

* Correctly fix Go toolchain version detection.

* Properly mark Go as a required dependency in CMake.

* Disable VCS stamping as it does not work correctly on some platforms.

* Autodetect minimum required Go version from go.mod files.

This allows us to avoid needing to update the CMakeLists.txt file when
the required version changes in a Go component’s go.mod file.

* Prefix GoTools module name with Netdata to ensure we get our local module.

* Update integrations code to use new Go plugin location.

* Remove old go packaging files.

* keep old logic for initial cleanup that is working

* Re-sync Go plugin sources.

* Fix search order for finding Go toolchain.

* update module name

* fix /usr/local/go overwrite condition

---------

Co-authored-by: Fotis Voutsas <fotis@netdata.cloud>
Co-authored-by: ilyam8 <ilya@netdata.cloud>
2024-02-26 09:10:14 -05:00
Austin S. Hemmelgarn
ca016406c3
More concretely utilize local modules in our CMake code. ()
* Properly handle systemd.cmake as a module.

* Split CMake compiler flag handling functions to their own module.

* Add include guards to modules.

* Prefix module names with Netdata.

This ensures that we end up using our local modules instead of possibly
using a system module with the same name.

* Drop include guards.

And shift systemd detection code to a macro so it’s less dangerous to
import the module multiple times.
2024-02-26 08:47:02 -05:00