0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-07 23:05:41 +00:00
Commit graph

84 commits

Author SHA1 Message Date
vkalintiris
2d59017ba5
Fix version for go.d plugin () 2024-05-28 17:50:23 +03:00
Austin S. Hemmelgarn
e81a8d826c
Ensure that the choice of compiler and target is passed to sub-projects. ()
If not explicitly set using exported environment variables, the choice
of compilers and compiler targets used by CMake does not get propagated
to sub-porjects created with ExternalProject_Add or
FetchContent_Declare.

In most cases this does not matter, because very few people are building
using non-default compilers for their environment, but it can cause
issues in two specific cases:

- If building for the same system that the build is happening on, but
  using a non-default compiler specified using CMake arguments (instead
  of via exported environment variables), sub-projects will still use
  the default compiler for the system, which may result in linking
  errors (or runtime failures even if the link succeeds).
- If cross-compiling and not using the preferred approaches of either a
  toolchain file or exported environment variables, sub-projects may not
  even build for the correct CPU architecture, causing the build to
  fail.

This adds logic to ensure that the compiler and compiler targets get
propagated correctly even if they are just specified on the command
line, thus avoiding the above two possibilities.
2024-05-24 14:13:25 +03:00
vkalintiris
ed6d0c4542
Simplify and unify the way we are handling versions. ()
* Define a single variable to identify OS.

* Remove comments.

* Move version-detection logic to separate module.

* s/VERSION/NETDATA_VERSION/g

* Hard-code NETDATA_VERSION wherever possible.

Now `program_version` is only used for getting or
setting the host's field.

* Update version variables

* Add license, fix variable name and provide better message.
2024-05-23 14:38:51 +00:00
Austin S. Hemmelgarn
e704b912da
Clean up DEB package dependencies. ()
* Clean up DEB package dependencies.

- dpkg is an implicit dependency for all DEB packages by virtue of them
  being DEB packages, and we do not support any platforms that have an
  old enough version to be an issue, so we don’t need a versioned
  dependency on it either, so simply drop the explicit dependency on
  dpkg.
- We also don’t support any platforms that ship an old enough version of
  libcap2-bin to cause us problems, so remove the version constraint on
  that as well.
- The lsb-base predepend is only needed if the user is using a
  non-systemd init system. We don’t fully support this setup with our
  native packages, and it’s a non-default configuration for Debian and
  completely unsupported on Ubuntu, so it’s safe to assume that the
  user knows what they are doing if they need it and not explicitly
  require this.
- The apps plugin was missed in , so fix it’s conflicts line here.
- The chartsd plugin _requires_ bash to function correctly, so actually
  depend on it instead of recommending it (this will be a no-op on a
  vast majority of systems, but is still useful insurance against users
  doing stupid things).
- The CUPS and FreeIPMI plugins both pull in all the things they
  actually need via automatic dependency generation, so there is no
  reason for us to pull in full installs of CUPS or FreeIPMI as
  dependencies.
- Everything in the Go plugin that was using `sudo` has been converted
  to use `ndsudo` instead, so we don’t need to ask for `sudo` at all for
  it anymore.
- The Python plguin _requires_ Python to function correctly, so actually
  depend on it instead of recommending it.

* Fix typo.
2024-05-22 11:15:04 -04:00
Stelios Fragkakis
75792b33e2
Revert "Support to WolfSSL (Step 1)" ()
Revert "Support to WolfSSL (Step 1) ()"

This reverts commit 8d9c464de3.
2024-05-17 19:08:51 +03:00
vkalintiris
12b178cf18
Properly detect attribute format types () 2024-05-17 15:21:27 +03:00
Austin S. Hemmelgarn
7a6d0c9234
Fall back to querying libc.so.6 if ldd can’t detect libc implementation. ()
* Fall back to querying libc.so.6 if ldd can’t detect libc implementation.

Needed for correct configuration on systems that hide the libc
implementation info in `ldd` output, like Gentoo.

* Fix typo.
2024-05-17 06:59:10 -04:00
thiagoftsm
8d9c464de3
Support to WolfSSL (Step 1) () 2024-05-16 12:15:19 +00:00
Austin S. Hemmelgarn
bfdd2284a6
Correctly handle required compilation flags for dependencies. ()
`target_compile_definitions` can only be used for actual command
line _macro definitions_. But the `*_CFLAGS_OTHER` may contain flags
that are _not_ macro definitions, and when that happens, any use of
`target_compile_definitions` with the relevant `*_CFLAGS_OTHER` variable
will break the build.

Instead, we should be using `target_compile_options` for these
variables.
2024-05-16 06:47:29 -04:00
Costa Tsaousis
fe06e8495f
Windows Support Phase 1 ()
* abstraction layer for O/S

* updates

* updates

* updates

* temp fix for protobuf

* emulated waitid()

* fix

* fix

* compatibility layer

* fix for idtype

* fix for missing includes

* fix for missing includes

* added missing includes

* added missing includes

* added missing includes

* added missing includes

* added missing includes

* added missing includes

* UUID renamed to ND_UUID to avoid conflict with windows.h

* include libnetdata.h always - no conflicts

* simplify abstraction headers

* fix missing functions

* fix missing functions

* fix missing functions

* fix missing functions

* rename MSYS to WINDOWS

* moved byteorder.h

* structure for an internal windows plugin

* 1st windows plugin

* working plugin

* fix printf

* Special case windows for protobuf

* remove cygwin, compile both as windows

* log windows libraries used

* fix cmake

* fix protobuf

* compilation

* updated compilation script

* added system.ram

* windows uptime

* perflib

* working perflibdump

* minify dump

* updates to windows plugins, enable ML

* minor compatibility fixes for cygwin and msys

* perflib-dump to its own file

* perflib now indexes names

* improvements to the library; disks module WIP

* API for selectively traversing the metrics

* first working perflib chart: disk.space

* working chart on logical and physical disks

* added windows protocols

* fix datatypes for loops

* tinysleep for native smallest sleep support

* remove libuuid dependency on windows

* fix uuid functions for macos compilation

* fix uuid comparison function

* do not overwrite uuid library functions, define them as aliases to our own

* fixed uuid_unparse functions

* fixed typo

* added perflib processor charts

* updates for compiling without posix emulation

* gather common contexts together

* fix includes on linux

* perflib-memory

* windows mem.available

* Update variable names for protobuf

* network traffic

* add network adapters that have traffic as virtual interfaces

* add -pipe to windows compilation

* reset or overflow flag is now per dimension

* dpc is now counted separately

* verified all perflib fields are processed and no text fields are present in the data

* more common contexts

* fix crash

* do not add system.net multiple times

* install deps update and shortcut

* all threads are now joinable behind the scenes

* fix threads cleanup

* prepare for abstracting threads API

* netdata threads full abstraction from pthreads

* more threads abstraction and cleanup

* more compatibility changes

* fix compiler warnings

* add base-devel to packages

* removed duplicate base-devel

* check for strndup

* check headers in quotes

* fix linux compilation

* fix attribute gnu_printf on macos

* fix for threads on macos

* mingw64 compatibility

* enable compilation on windows clion

* added instructions

* enable cloud

* compatibility fixes

* compatibility fixes

* compatibility fixes

* clion works on windows

* support both MSYSTEM=MSYS and MSYSTEM=MINGW64 for configure

* cleanup and docs

* rename uuid_t to nd_uuid_t to avoid conflict with windows uuid_t

* leftovers uuid_t

* do not include uuid.h on macos

* threads signaled cancellations

* do not install v0 dashboard on windows

* script to install openssh server on windows

* update openssh installation script

* update openssh installation script

* update openssh installation script

* update openssh installation script

* update openssh installation script

* update openssh installation script

* update openssh installation script

* update openssh installation script

* update openssh installation script

* use cleanup variable instead of pthreads push and pop

* replace all calls to netdata_thread_cleanup_push() and netdata_thread_cleanup_pop() with __attribute__((cleanup(...)))

* remove left-over freez

* make sure there are no locks acquired at thread exit

* add missing parameter

* stream receivers and senders are now voluntarily cancelled

* plugins.d now voluntarily exits its threads

* uuid_t may not be aligned to word boundaries - fix the uuid_t functions to work on unaligned objects too.

* collectors evloop is now using the new threading cancellation; ml is now not using pthread_cancel; more fixes

* eliminate threads cancellability from the code base

* fix exit timings and logs; fix uv_threads tags

* use SSL_has_pending() only when it is available

* do not use SSL_has_pending()

* dyncfg files on windows escape collon and pipe characters

* fix compilation on older systems

* fix compilation on older systems

* Create windows installer.

The installer will install everything
under C:\netdata by default.

It will:
  - Install msys2 at C:\netdata
  - Install netdata dependencies with pacman
  - Install the agent itself under C:\netdata\opt

You can start the agent by running an MSYS
shell with C:\netdata\msys2_shell.cmd and
then start the agent normally with:

/opt/netdata/usr/sbin/netdata -D

There are a more couple things to work on:

  - Verify publisher.
  - Install all deps not just libuv & protobuf.
  - Figure out how we want to auto-start the agent as a service.
  - Check how to uninstall things.

* fixed typo

* code cleanup

* Create uninstaller

---------

Co-authored-by: vkalintiris <vasilis@netdata.cloud>
2024-05-16 13:33:00 +03:00
thiagoftsm
258badce5d
Update libbpf () 2024-05-14 12:08:17 +00:00
Austin S. Hemmelgarn
f8ed61efe1
Add Sentry support to new CPack packages. () 2024-05-10 10:32:10 -04:00
Austin S. Hemmelgarn
8747d882b0
Update eBPF code to v1.4.1. ()
* Bump libbpf to v1.4.1p_netdata.

* Update eBPF CO-RE code to v1.4.1

* Update legacy eBPF code to v1.4.1.
2024-05-06 08:43:10 -04:00
Austin S. Hemmelgarn
90552bd501
Fix handling of vendored eBPF code in CMake. ()
* Fix logic error in CMake code for kernel version detection.

* Force legacy libbpf for CentOS 7 and AL 2 package builds.

* Check target kernel version instead of host kernel version.

This should help when building in containers.

* Fix up handling for older versions of CMake.

* Use CMake C compiler for libbpf builds.

* Fix selection of legacy eBPF code in static builds.

* Explicitly pull in kernel headers on CentOS.

* Fix typo in FORCE_LEGACY_LIBBPF option.

* Only enable eBPF by default on x86.

* Fix detection of static builds.

* Fix libc detection logic.

* Fix handling of static builds.

* Fix musl libc detection.

* Fix check messages for libc detection.
2024-05-06 07:05:34 -04:00
Austin S. Hemmelgarn
3cf8f9fa84
Fix handling of service startup in DEB packages. () 2024-05-03 20:45:34 +03:00
Austin S. Hemmelgarn
3a8c9ed076
Fix DEB package conflict entries. () 2024-05-02 17:55:08 -04:00
Austin S. Hemmelgarn
b994cda1ab
Fix invalid item in postinst script for Netdata package. () 2024-05-02 09:05:08 -04:00
vkalintiris
00199dc9e3
Cpack fixes ()
* Fix list joining

* Fix plugin apps typo
2024-05-02 08:07:51 -04:00
Ilya Mashchenko
5007a4ebcc
remove go.d symbol/debug info with RelWithDebInfo () 2024-05-01 14:14:39 +03:00
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
Austin S. Hemmelgarn
12306a3e05
Assorted cleanup of CI/packaging related code. ()
* Drop unused Dockerfile.test.

It’s not been used for years, and it doesn’t even work at this point for
it’s intended purpose.

* Remove CodeClimate configuration.

We’re not using it anymore, so there is no point to keeping the
configuration around.

* Remove the build_external directory.

This isn’t used by any of our code AFAICT, and if it _is_ needed, it
should actually be in some sub-directory of `tests` instead of a
top-level directory whose name doesn’t even describe what it does.

* Remove .gitattributes

If there's any objection we can reinstate it.

* Move coverity-scan.sh under packaging/utils

* Move cmake files under packaging/cmake

* Remove devcontainer

* Fix up coverity script to run correctly from new location.

---------

Co-authored-by: vkalintiris <vasilis@netdata.cloud>
2024-02-14 07:01:52 -05:00