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.
* 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.
* 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 #17584, 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.
* 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.
`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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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>