From 837e6c6fdb73b8478b811ed481093f6826479848 Mon Sep 17 00:00:00 2001 From: David Bensoussan Date: Thu, 3 Nov 2022 19:32:03 +0100 Subject: [PATCH] feat: add Fluent Bit vendor package With this package, we don't need to install Fluent Bit beforehand --- fluent_bit_vendor/CMakeLists.txt | 136 +++++++ .../cmake/Modules/Findfluent_bit.cmake | 38 ++ .../fluentbit_vendor-extras.cmake | 3 + fluent_bit_vendor/mpack.patch | 356 ++++++++++++++++++ fluent_bit_vendor/package.xml | 21 ++ 5 files changed, 554 insertions(+) create mode 100644 fluent_bit_vendor/CMakeLists.txt create mode 100644 fluent_bit_vendor/cmake/Modules/Findfluent_bit.cmake create mode 100644 fluent_bit_vendor/fluentbit_vendor-extras.cmake create mode 100644 fluent_bit_vendor/mpack.patch create mode 100644 fluent_bit_vendor/package.xml diff --git a/fluent_bit_vendor/CMakeLists.txt b/fluent_bit_vendor/CMakeLists.txt new file mode 100644 index 00000000..4a8a1794 --- /dev/null +++ b/fluent_bit_vendor/CMakeLists.txt @@ -0,0 +1,136 @@ +cmake_minimum_required(VERSION 3.5) + +project(fluent_bit_vendor) + +find_package(ament_cmake REQUIRED) +find_package(dc_interfaces REQUIRED) + +set(cmake_commands) +set(cmake_configure_args -Wno-dev) + +if(WIN32) + if(DEFINED CMAKE_GENERATOR) + list(APPEND cmake_configure_args -G ${CMAKE_GENERATOR}) + endif() + if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(x86_|x86-|AMD|amd|x)64$") + list(APPEND cmake_configure_args -A x64) + endif() +endif() + +if(DEFINED CMAKE_BUILD_TYPE) + if(WIN32) + build_command(_build_command CONFIGURATION ${CMAKE_BUILD_TYPE}) + list(APPEND cmake_commands "BUILD_COMMAND ${_build_command}") + else() + list(APPEND cmake_configure_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) + endif() +endif() + +if(DEFINED CMAKE_TOOLCHAIN_FILE) + list(APPEND cmake_configure_args "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") + if(ANDROID) + if(DEFINED ANDROID_ABI) + list(APPEND cmake_configure_args "-DANDROID_ABI=${ANDROID_ABI}") + endif() + if(DEFINED ANDROID_CPP_FEATURES) + list(APPEND cmake_configure_args "-DANDROID_CPP_FEATURES=${ANDROID_CPP_FEATURES}") + endif() + if(DEFINED ANDROID_FUNCTION_LEVEL_LINKING) + list(APPEND cmake_configure_args "-DANDROID_FUNCTION_LEVEL_LINKING=${ANDROID_FUNCTION_LEVEL_LINKING}") + endif() + if(DEFINED ANDROID_NATIVE_API_LEVEL) + list(APPEND cmake_configure_args "-DANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL}") + endif() + if(DEFINED ANDROID_NDK) + list(APPEND cmake_configure_args "-DANDROID_NDK=${ANDROID_NDK}") + endif() + if(DEFINED ANDROID_STL) + list(APPEND cmake_configure_args "-DANDROID_STL=${ANDROID_STL}") + endif() + if(DEFINED ANDROID_TOOLCHAIN_NAME) + list(APPEND cmake_configure_args "-DANDROID_TOOLCHAIN_NAME=${ANDROID_TOOLCHAIN_NAME}") + endif() + endif() +else() + list(APPEND cmake_configure_args "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}") +endif() +set(fluent_bit_external_project_dir ${CMAKE_CURRENT_BINARY_DIR}/fluent_bit) +include(ExternalProject) +set(fluent_bit_version "1ab360f79c73627a0789551287c074aa2016bf26") +# message(${CMAKE_CURRENT_LIST_DIR}) +ExternalProject_Add(fluent_bit_src + GIT_REPOSITORY https://github.com/fluent/fluent-bit + GIT_TAG ${fluent_bit_version} + GIT_CONFIG advice.detachedHead=false + PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/mpack.patch + # Suppress git update due to https://gitlab.kitware.com/cmake/cmake/-/issues/16419 + UPDATE_COMMAND "" + TIMEOUT 6000 + BUILD_IN_SOURCE On + ${cmake_commands} + CMAKE_ARGS + -DBUILD_TESTING=Off + -DCMAKE_INSTALL_PREFIX=${fluent_bit_external_project_dir}/install/ + -DCMAKE_INSTALL_LIBDIR=lib/ + -DFLB_EXAMPLES=Off + -DFLB_OUT_PGSQL=On + -DFLB_SHARED_LIB=On + -DFLB_PROXY_GO=On + ${cmake_configure_args} +) + +externalproject_get_property(fluent_bit_src INSTALL_DIR) +set(fluent_bit_INCLUDE_DIR "${INSTALL_DIR}/../fluent_bit/install/include") +set(fluent_bit_LIB_DIR "${INSTALL_DIR}/../fluent_bit/install/lib/fluent-bit") + +set(FB_SRC_LIB_INCLUDE_DIR "${INSTALL_DIR}/src/fluent_bit_src/lib") + +set(ares_INCLUDE_FILES + "${FB_SRC_LIB_INCLUDE_DIR}/c-ares-1.18.1/include/ares.h" + "${FB_SRC_LIB_INCLUDE_DIR}/c-ares-1.18.1/include/ares_build.h" + "${FB_SRC_LIB_INCLUDE_DIR}/c-ares-1.18.1/include/ares_rules.h" + "${FB_SRC_LIB_INCLUDE_DIR}/c-ares-1.18.1/include/ares_version.h" +) +set(cfl_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/cfl/include/cfl") +set(cmetrics_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/cmetrics/include/cmetrics") +set(ctraces_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/ctraces/include/ctraces") +set(jsmn_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/jsmn") +set(mkcore_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/monkey/include/monkey/mk_core") +set(mpack_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/mpack-amalgamation-1.1/src/mpack") +set(msgpack_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/msgpack-c/include/msgpack") +set(msgpack_INCLUDE_FILES + "${FB_SRC_LIB_INCLUDE_DIR}/msgpack-c/include/msgpack.h" +) +set(prometheus_remote_write_INCLUDE_DIR "${FB_SRC_LIB_INCLUDE_DIR}/cmetrics/include/prometheus_remote_write") +set(xxhash_INCLUDE_FILES + "${FB_SRC_LIB_INCLUDE_DIR}/cfl/lib/xxhash/xxhash.h" + "${FB_SRC_LIB_INCLUDE_DIR}/cfl/lib/xxhash/xxh3.h" +) + +install(DIRECTORY ${fluent_bit_INCLUDE_DIR}/ DESTINATION include) +install(FILES ${ares_INCLUDE_FILES} DESTINATION include) +install(DIRECTORY ${cfl_INCLUDE_DIR}/ DESTINATION include/cfl) +install(DIRECTORY ${cmetrics_INCLUDE_DIR}/ DESTINATION include/cmetrics) +install(DIRECTORY ${ctraces_INCLUDE_DIR}/ DESTINATION include/ctraces) +install(DIRECTORY ${jsmn_INCLUDE_DIR}/ DESTINATION include/jsmn) +install(DIRECTORY ${mkcore_INCLUDE_DIR}/ DESTINATION include/mk_core) +install(DIRECTORY ${mpack_INCLUDE_DIR}/ DESTINATION include/mpack) +install(DIRECTORY ${msgpack_INCLUDE_DIR}/ DESTINATION include/msgpack) +install(FILES ${msgpack_INCLUDE_FILES} DESTINATION include) +install(DIRECTORY ${prometheus_remote_write_INCLUDE_DIR}/ DESTINATION include/prometheus_remote_write) +install(FILES ${xxhash_INCLUDE_FILES}/ DESTINATION include) + +install(FILES ${fluent_bit_LIB_DIR}/libfluent-bit.so DESTINATION lib) +install(FILES ${INSTALL_DIR}/src/fluent_bit_src/library/libmsgpack-c-static.a DESTINATION lib) +install(FILES ${INSTALL_DIR}/src/fluent_bit_src/library/libfluent-bit.a DESTINATION lib) + +install(DIRECTORY cmake DESTINATION share/${PROJECT_NAME}) + +install( + DIRECTORY ${INSTALL_DIR}/src/fluent_bit_src/cmake + DESTINATION share/${PROJECT_NAME} +) + +ament_export_include_directories(include) +ament_export_libraries(libfluent-bit.so fluent-bit) +ament_package(CONFIG_EXTRAS fluentbit_vendor-extras.cmake) diff --git a/fluent_bit_vendor/cmake/Modules/Findfluent_bit.cmake b/fluent_bit_vendor/cmake/Modules/Findfluent_bit.cmake new file mode 100644 index 00000000..40214725 --- /dev/null +++ b/fluent_bit_vendor/cmake/Modules/Findfluent_bit.cmake @@ -0,0 +1,38 @@ +if(NOT fluent_bit_ROOT_DIR AND DEFINED ENV{fluent_bit_ROOT_DIR}) + set(fluent_bit_ROOT_DIR "$ENV{fluent_bit_ROOT_DIR}" CACHE PATH + "fluent_bit base directory location (optional, used for nonstandard installation paths)") +endif() + +set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a") +if(fluent_bit_ROOT_DIR) + set(fluent_bit_INCLUDE_PATH PATHS "${fluent_bit_ROOT_DIR}/include" NO_DEFAULT_PATH) + set(fluent_bit_LIBRARY_PATH PATHS "${fluent_bit_ROOT_DIR}/lib/fluent-bit" NO_DEFAULT_PATH) +else() + set(fluent_bit_INCLUDE_PATH "") + set(fluent_bit_LIBRARY_PATH "") +endif() + +# Search for headers and the library +find_path(fluent_bit_INCLUDE_DIR NAMES "fluent-bit.h" ${fluent_bit_INCLUDE_PATH}) +find_library(fluent_bit_LIBRARY NAMES fluent-bit ${fluent_bit_LIBRARY_PATH}) + +mark_as_advanced(fluent_bit_INCLUDE_DIR fluent_bit_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + fluent_bit + DEFAULT_MSG + fluent_bit_INCLUDE_DIR + fluent_bit_LIBRARY +) + +if(${fluent_bit_FOUND}) + set(fluent_bit_INCLUDE_DIRS ${fluent_bit_INCLUDE_DIR} ${msgpack_INCLUDE_DIR} ${monkey_INCLUDE_DIR} ${cmetrics_INCLUDE_DIR} ${prometheus_remote_write_INCLUDE_DIR}) + set(fluent_bit_LIBRARIES ${fluent_bit_LIBRARY}) + + add_library(fluent_bit::fluent_bit UNKNOWN IMPORTED) + set_property(TARGET fluent_bit::fluent_bit PROPERTY IMPORTED_LOCATION ${fluent_bit_LIBRARY} ${msgpack_INCLUDE_DIR}) + set_property(TARGET fluent_bit::fluent_bit PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${fluent_bit_INCLUDE_DIR} ${msgpack_INCLUDE_DIR} ${monkey_INCLUDE_DIR} ${cmetrics_INCLUDE_DIR} ${prometheus_remote_write_INCLUDE_DIR}) + list(APPEND fluent_bit_TARGETS fluent_bit::fluent_bit) + +endif() diff --git a/fluent_bit_vendor/fluentbit_vendor-extras.cmake b/fluent_bit_vendor/fluentbit_vendor-extras.cmake new file mode 100644 index 00000000..a4f2669b --- /dev/null +++ b/fluent_bit_vendor/fluentbit_vendor-extras.cmake @@ -0,0 +1,3 @@ +list(INSERT CMAKE_MODULE_PATH 0 "${fluent_bit_vendor_DIR}/Modules") +list(INSERT CMAKE_MODULE_PATH 0 "${fluent_bit_vendor_DIR}/cmake") +list(INSERT CMAKE_MODULE_PATH 0 "${fluent_bit_vendor_DIR}/sanitizers-cmake/cmake") diff --git a/fluent_bit_vendor/mpack.patch b/fluent_bit_vendor/mpack.patch new file mode 100644 index 00000000..9817f65d --- /dev/null +++ b/fluent_bit_vendor/mpack.patch @@ -0,0 +1,356 @@ +diff --git a/include/fluent-bit/flb_lib.h b/include/fluent-bit/flb_lib.h +index 7e9275297..1ce70cfab 100644 +--- a/include/fluent-bit/flb_lib.h ++++ b/include/fluent-bit/flb_lib.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + + /* Lib engine status */ + #define FLB_LIB_ERROR -1 +@@ -79,4 +80,10 @@ FLB_EXPORT int flb_loop(flb_ctx_t *ctx); + FLB_EXPORT int flb_lib_push(flb_ctx_t *ctx, int ffd, const void *data, size_t len); + FLB_EXPORT int flb_lib_config_file(flb_ctx_t *ctx, const char *path); + ++/* Flb plugin */ ++FLB_EXPORT int flb_plugin_load_wr(char *path, struct flb_plugins *ctx, struct flb_config *config); ++FLB_EXPORT int flb_plugin_load_router_wr(char *path, struct flb_config *config); ++FLB_EXPORT int flb_plugin_load_config_file_wr(const char *file, struct flb_config *config); ++FLB_EXPORT void flb_plugin_destroy_wr(struct flb_plugins *ctx); ++ + #endif +diff --git a/lib/cmetrics/lib/mpack/src/mpack/mpack.h b/lib/cmetrics/lib/mpack/src/mpack/mpack.h +index 7c0b3f17e..cfe860eb4 100644 +--- a/lib/cmetrics/lib/mpack/src/mpack/mpack.h ++++ b/lib/cmetrics/lib/mpack/src/mpack/mpack.h +@@ -3271,129 +3271,6 @@ MPACK_EXTERN_C_END + #undef mpack_write_kv + #endif + +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int8_t value) { +- mpack_write_i8(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int16_t value) { +- mpack_write_i16(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int32_t value) { +- mpack_write_i32(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int64_t value) { +- mpack_write_i64(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint8_t value) { +- mpack_write_u8(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint16_t value) { +- mpack_write_u16(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint32_t value) { +- mpack_write_u32(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint64_t value) { +- mpack_write_u64(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, bool value) { +- mpack_write_bool(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, float value) { +- mpack_write_float(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, double value) { +- mpack_write_double(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, char *value) { +- mpack_write_cstr_or_nil(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, const char *value) { +- mpack_write_cstr_or_nil(writer, value); +-} +- +-/* C++ generic write for key-value pairs */ +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int8_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i8(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int16_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i16(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int32_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i32(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int64_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i64(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint8_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u8(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint16_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u16(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint32_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u32(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint64_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u64(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, bool value) { +- mpack_write_cstr(writer, key); +- mpack_write_bool(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, float value) { +- mpack_write_cstr(writer, key); +- mpack_write_float(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, double value) { +- mpack_write_cstr(writer, key); +- mpack_write_double(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, char *value) { +- mpack_write_cstr(writer, key); +- mpack_write_cstr_or_nil(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, const char *value) { +- mpack_write_cstr(writer, key); +- mpack_write_cstr_or_nil(writer, value); +-} +- +-/** +- * @} +- */ +- + #endif /* __cplusplus */ + + /** +diff --git a/lib/mpack-amalgamation-1.1/src/mpack/mpack.h b/lib/mpack-amalgamation-1.1/src/mpack/mpack.h +index 803f03e41..7c2ceb338 100644 +--- a/lib/mpack-amalgamation-1.1/src/mpack/mpack.h ++++ b/lib/mpack-amalgamation-1.1/src/mpack/mpack.h +@@ -4104,7 +4104,7 @@ MPACK_INLINE void mpack_finish_type(mpack_writer_t* writer, mpack_type_t type) { + * @} + */ + +-#if MPACK_HAS_GENERIC && !defined(__cplusplus) ++#if MPACK_HAS_GENERIC + + /** + * @name Type-Generic Writers +@@ -4183,146 +4183,6 @@ MPACK_INLINE void mpack_finish_type(mpack_writer_t* writer, mpack_type_t type) { + // The rest of this file contains C++ overloads, so we end extern "C" here. + MPACK_EXTERN_C_END + +-#if defined(__cplusplus) || defined(MPACK_DOXYGEN) +- +-/** +- * @name C++ write overloads +- * @{ +- */ +- +-/* +- * C++ generic writers for primitive values +- */ +- +-#ifdef MPACK_DOXYGEN +-#undef mpack_write +-#undef mpack_write_kv +-#endif +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int8_t value) { +- mpack_write_i8(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int16_t value) { +- mpack_write_i16(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int32_t value) { +- mpack_write_i32(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, int64_t value) { +- mpack_write_i64(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint8_t value) { +- mpack_write_u8(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint16_t value) { +- mpack_write_u16(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint32_t value) { +- mpack_write_u32(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, uint64_t value) { +- mpack_write_u64(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, bool value) { +- mpack_write_bool(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, float value) { +- mpack_write_float(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, double value) { +- mpack_write_double(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, char *value) { +- mpack_write_cstr_or_nil(writer, value); +-} +- +-MPACK_INLINE void mpack_write(mpack_writer_t* writer, const char *value) { +- mpack_write_cstr_or_nil(writer, value); +-} +- +-/* C++ generic write for key-value pairs */ +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int8_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i8(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int16_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i16(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int32_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i32(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, int64_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_i64(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint8_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u8(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint16_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u16(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint32_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u32(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, uint64_t value) { +- mpack_write_cstr(writer, key); +- mpack_write_u64(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, bool value) { +- mpack_write_cstr(writer, key); +- mpack_write_bool(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, float value) { +- mpack_write_cstr(writer, key); +- mpack_write_float(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, double value) { +- mpack_write_cstr(writer, key); +- mpack_write_double(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, char *value) { +- mpack_write_cstr(writer, key); +- mpack_write_cstr_or_nil(writer, value); +-} +- +-MPACK_INLINE void mpack_write_kv(mpack_writer_t* writer, const char *key, const char *value) { +- mpack_write_cstr(writer, key); +- mpack_write_cstr_or_nil(writer, value); +-} +- +-/** +- * @} +- */ +- +-#endif /* __cplusplus */ + + /** + * @} +diff --git a/src/flb_lib.c b/src/flb_lib.c +index 996816e23..a81c64924 100644 +--- a/src/flb_lib.c ++++ b/src/flb_lib.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -66,6 +67,26 @@ static inline int flb_socket_init_win32(void) + } + #endif + ++int flb_plugin_load_wr(char *path, struct flb_plugins *ctx, struct flb_config *config) ++{ ++ return flb_plugin_load(path,ctx,config); ++} ++ ++int flb_plugin_load_router_wr(char *path, struct flb_config *config) ++{ ++ return flb_plugin_load_router(path, config); ++} ++ ++int flb_plugin_load_config_file_wr(const char *file, struct flb_config *config) ++{ ++ return flb_plugin_load_config_file(file, config); ++} ++ ++void flb_plugin_destroy_wr(struct flb_plugins *ctx) ++{ ++ flb_plugin_destroy(ctx); ++} ++ + static inline struct flb_input_instance *in_instance_get(flb_ctx_t *ctx, + int ffd) + { diff --git a/fluent_bit_vendor/package.xml b/fluent_bit_vendor/package.xml new file mode 100644 index 00000000..194439ac --- /dev/null +++ b/fluent_bit_vendor/package.xml @@ -0,0 +1,21 @@ + + + + fluent_bit_vendor + 2.0.0 + A vendor package for An End to End Observability Pipeline + David Bensoussan + MPL-2.0 + + ament_cmake + dc_interfaces + git + flex + bison + libpq-dev + rclc + + + ament_cmake + +