🏅 Sync 2026-04-06 15:50:29

This commit is contained in:
github-actions[bot] committed 2026-04-06 15:50:29 +08:00
1 parent 4efb1fc79b
commit ba9c51e89c
16 files changed
+568 -12

No files matched your search

@@ -0,0 +1,20 @@
From 51571c36d02c9ccdb26156bd56a2298c69bc110f Mon Sep 17 00:00:00 2001
From: Tiago Gaspar <tiagogaspar8@gmail.com>
Date: Thu, 7 Nov 2024 22:00:16 +0000
Subject: [PATCH] Update python.d.conf
---
src/collectors/python.d.plugin/python.d.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/collectors/python.d.plugin/python.d.conf
+++ b/src/collectors/python.d.plugin/python.d.conf
@@ -7,7 +7,7 @@
##
## Enable / disable the whole python.d.plugin (all its modules)
-enabled: yes
+enabled: no
## ----------------------------------------------------------------------
## Enable / Disable python.d.plugin modules
@@ -0,0 +1,192 @@
diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2024-11-08 03:07:57.000000000 +0700
+++ b/CMakeLists.txt 2024-11-12 14:58:32.937729200 +0700
@@ -191,6 +191,7 @@
option(ENABLE_BUNDLED_JSONC "Force use of a vendored copy of JSON-C" False)
option(ENABLE_BUNDLED_YAML "Force use of a vendored copy of libyaml" False)
option(ENABLE_BUNDLED_PROTOBUF "Use a vendored copy of protobuf" False)
+cmake_dependent_option(ENABLE_BUNDLED_ABSEIL "Use a vendored copy of Abseil" False "NOT ENABLE_BUNDLED_PROTOBUF" True)
# Experimental features
option(ENABLE_WEBRTC "Enable WebRTC dashboard communications (experimental)" False)
diff -Naur a/packaging/cmake/Modules/NetdataAbseil.cmake b/packaging/cmake/Modules/NetdataAbseil.cmake
--- a/packaging/cmake/Modules/NetdataAbseil.cmake 1970-01-01 07:00:00.000000000 +0700
+++ b/packaging/cmake/Modules/NetdataAbseil.cmake 2024-11-12 14:57:35.211610700 +0700
@@ -0,0 +1,128 @@
+# Macros and functions for handling of Abseil
+#
+# To use:
+# - Include the NetdataAbseil module
+# - Call netdata_detect_abseil() with a list of the Abseil components you need.
+# - Call netdata_add_abseil_to_target() with the name of the target that needs to link against Abseil.
+#
+# Copyright (c) 2024 Netdata Inc.
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Prepare a vendored copy of Abseil for use with Netdata
+function(netdata_bundle_abseil)
+ include(FetchContent)
+ include(NetdataFetchContentExtra)
+
+ set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)
+
+ string(REPLACE "-fsanitize=address" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+ string(REPLACE "-fsanitize=address" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+ # ignore debhelper
+ set(FETCHCONTENT_FULLY_DISCONNECTED Off)
+
+ set(ABSL_PROPAGATE_CXX_STD On)
+ set(ABSL_ENABLE_INSTALL Off)
+ set(BUILD_SHARED_LIBS Off)
+
+ message(STATUS "Preparing bundled Abseil")
+ FetchContent_Declare(absl
+ GIT_REPOSITORY https://github.com/abseil/abseil-cpp
+ GIT_TAG 2f9e432cce407ce0ae50676696666f33a77d42ac # 20240116.1
+ CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
+ )
+ FetchContent_MakeAvailable_NoInstall(absl)
+ message(STATUS "Finished preparing bundled Abseil")
+ set(BUNDLED_ABSEIL PARENT_SCOPE)
+endfunction()
+
+# Look for a system copy of Abseil, and if we can’t find it bundle a copy.
+#
+# _components is a list of Abseil component libraries to look for,
+# without the `absl_` prefix. All of them must be found to use a system copy.
+#
+# If called multiple times with different lists of components, the
+# end result will be as if it was called once with the union of the sets
+# of components.
+function(netdata_detect_abseil _components)
+ set(_components_found "${ENABLE_BUNDLED_ABSEIL}")
+ set(_cflags_other "${NETDATA_ABSEIL_CFLAGS_OTHER}")
+ set(_include_dirs "${NETDATA_ABSEIL_INCLUDE_DIRS}")
+ set(_libs "${NETDATA_ABSEIL_LIBS}")
+ set(_bundled "${BUNDLED_ABSEIL}")
+
+ if(NOT BUNDLED_ABSEIL)
+ if(NOT ENABLE_BUNDLED_ABSEIL)
+ foreach(_c LISTS _components)
+ set(_component_name "absl_${_c}")
+ pkg_check_modules("${_component_name}")
+
+ if(${_component_name}_FOUND)
+ list(APPEND _cflags_other "${${_component_name}_CFLAGS_OTHER}")
+ list(APPEND _include_dirs "${${_component_name}_INCLUDE_DIRS}")
+ list(APPEND _libs "${${_component_name}_LIBRARIES}")
+ else()
+ set(_components_found FALSE)
+ break()
+ endif()
+ endforeach()
+ endif()
+
+ if(NOT _components_found)
+ set(_cflags_other "${NETDATA_ABSEIL_CFLAGS_OTHER}")
+ set(_include_dirs "${NETDATA_ABSEIL_INCLUDE_DIRS}")
+ set(_libs "${NETDATA_ABSEIL_LIBS}")
+ set(_bundled TRUE)
+ message(WARNING "Could not find all required Abseil components, vendoring it instead")
+ netdata_bundle_abseil()
+ endif()
+ endif()
+
+ if(BUNDLED_ABSEIL)
+ foreach(_c LISTS _components)
+ set(_target "absl::${_c}")
+
+ if(NOT TARGET ${_target})
+ message(FATAL_ERROR "Abseil component ${_c} was not provided by the vendored copy of Abseil.")
+ endif()
+
+ get_target_property(${_c}_cflags_other ${_target} INTERFACE_COMPILE_DEFINITIONS)
+
+ if(NOT ${_c}_cflags_other STREQUAL ${_c}_cflags_other-NOTFOUND)
+ list(APPEND _cflags_other "${${_c}_cflags_other}")
+ endif()
+
+ get_target_property(${_c}_include_dirs ${_target} INTERFACE_INCLUDE_DIRECTORIES)
+
+ if(NOT ${_c}_include_dirs STREQUAL ${_c}_include_dirs-NOTFOUND)
+ list(APPEND _include_dirs "${${_c}_include_dirs}")
+ endif()
+
+ list(APPEND _libs ${_target})
+ endforeach()
+ endif()
+
+ foreach(_var ITEMS _cflags_other _include_dirs _libs)
+ list(REMOVE_ITEM ${_var} "")
+ list(REMOVE_DUPLICATES ${_var})
+ endforeach()
+
+ set(NETDATA_ABSEIL_CFLAGS_OTHER "${_cflags_other}" PARENT_SCOPE)
+ set(NETDATA_ABSEIL_INCLUDE_DIRS "${_include_dirs}" PARENT_SCOPE)
+ set(NETDATA_ABSEIL_LIBS "${_libs}" PARENT_SCOPE)
+ set(HAVE_ABSEIL TRUE PARENT_SCOPE)
+ set(BUNDLED_ABSEIL "${_bundled}" PARENT_SCOPE)
+endfunction()
+
+# Add Abseil to a specified target
+#
+# The _scope argument is optional, if not specified Abseil will be added as a PRIVATE dependency.
+function(netdata_add_abseil_to_target _target _scope)
+ if(NOT _scope)
+ set(_scope PRIVATE)
+ endif()
+
+ target_compile_definitions(${_target} ${_scope} ${NETDATA_ABSEIL_CFLAGS_OTHER})
+ target_include_directories(${_target} ${_scope} ${NETDATA_ABSEIL_INCLUDE_DIRS})
+ target_link_libraries(${_target} ${_scope} ${NETDATA_ABSEIL_LIBS})
+endfunction()
\ No newline at end of file
diff --git a/packaging/cmake/Modules/NetdataProtobuf.cmake b/packaging/cmake/Modules/NetdataProtobuf.cmake
index 5375d13970aa3a..42bf42446be025 100644
--- a/packaging/cmake/Modules/NetdataProtobuf.cmake
+++ b/packaging/cmake/Modules/NetdataProtobuf.cmake
@@ -24,38 +24,12 @@ function(netdata_bundle_protobuf)
set(FETCHCONTENT_FULLY_DISCONNECTED Off)
if(NEED_ABSL)
- set(ABSL_PROPAGATE_CXX_STD On)
- set(ABSL_ENABLE_INSTALL Off)
- set(BUILD_SHARED_LIBS Off)
- set(ABSL_BUILD_TESTING Off)
- set(absl_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/absl-src")
-
- message(STATUS "Preparing bundled Abseil (required by bundled Protobuf)")
- find_program(PATCH patch REQUIRED)
- if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
- FetchContent_Declare(absl
- GIT_REPOSITORY https://github.com/abseil/abseil-cpp
- GIT_TAG ${ABSL_TAG}
- SOURCE_DIR ${absl_SOURCE_DIR}
- PATCH_COMMAND ${CMAKE_SOURCE_DIR}/packaging/cmake/patches/apply-patches.sh
- ${absl_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}/packaging/cmake/patches/abseil
- CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
- EXCLUDE_FROM_ALL
- )
- else()
- FetchContent_Declare(absl
- GIT_REPOSITORY https://github.com/abseil/abseil-cpp
- GIT_TAG ${ABSL_TAG}
- SOURCE_DIR ${absl_SOURCE_DIR}
- PATCH_COMMAND ${CMAKE_SOURCE_DIR}/packaging/cmake/patches/apply-patches.sh
- ${absl_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}/packaging/cmake/patches/abseil
- CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
- )
+ if(HAVE_ABSEIL AND NOT BUNDLED_ABSEIL)
+ message(FATAL_ERROR "Using a system copy of Abseil is not supported if vendoring Protobuf")
endif()
- FetchContent_MakeAvailable_NoInstall(absl)
- message(STATUS "Finished preparing bundled Abseil")
+
+ netdata_bundle_abseil()
+ set(BUNDLED_ABSEIL PARENT_SCOPE)
endif()
set(protobuf_INSTALL Off)
+12
View File
@@ -0,0 +1,12 @@
diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2024-11-08 03:09:18.000000000 +0700
+++ b/CMakeLists.txt 2024-11-10 05:54:38.197675500 +0700
@@ -33,7 +33,7 @@
set(CMAKE_INSTALL_MESSAGE LAZY)
set(CMAKE_C_STANDARD 11)
-set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD 17)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "netdata")
option(USE_CXX_11 "Use C++11 instead of C++14 (should only be used on legacy systems that cannot support C++14, may disable some features)" False)
@@ -0,0 +1,20 @@
From dcefaf8fb607889d7acc60a68448bf6b040dfb87 Mon Sep 17 00:00:00 2001
From: Tiago Gaspar <tiagogaspar8@gmail.com>
Date: Thu, 7 Nov 2024 22:02:49 +0000
Subject: [PATCH] Update loaders.py
---
src/collectors/python.d.plugin/python_modules/bases/loaders.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/collectors/python.d.plugin/python_modules/bases/loaders.py
+++ b/src/collectors/python.d.plugin/python_modules/bases/loaders.py
@@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
try:
- from pyyaml3 import SafeLoader as YamlSafeLoader
+ from yaml import SafeLoader as YamlSafeLoader
except ImportError:
from yaml import SafeLoader as YamlSafeLoader
+17
View File
@@ -0,0 +1,17 @@
--- a/packaging/cmake/Modules/NetdataDashboard.cmake
+++ b/packaging/cmake/Modules/NetdataDashboard.cmake
@@ -32,13 +32,8 @@ function(bundle_dashboard)
message(STATUS "Preparing local agent dashboard code")
message(STATUS " Fetching ${DASHBOARD_URL}")
- file(DOWNLOAD
- "${DASHBOARD_URL}"
- "${CMAKE_BINARY_DIR}/dashboard.tar.gz"
- TIMEOUT 180
- STATUS fetch_status)
- list(GET fetch_status 0 result)
+ set(result 0)
if(result)
message(FATAL_ERROR "Failed to fetch dashboard code")