diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-12-28 00:03:21 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-12-31 11:06:23 -0800 |
commit | 0b80ef143193955300941421e16b3aa207fa6405 (patch) | |
tree | 790647622e922f8fbe1646a58e8a12cc099c4755 | |
parent | cc7eb45fb5099d64b9c468b24ab5cddbd08834ca (diff) | |
download | meta-openembedded-0b80ef143193955300941421e16b3aa207fa6405.tar.gz |
fluentbit: Upgrade to 1.3.5
Sync recipe with the one in sourcecode
Record Accessor feature requires Flex and Bison
fts dependency is needed on musl
Delete cmake_multilib.patch its fixed upstream
Use builtin nan funciton to avoid linking with libm
Signed-off-by: Khem Raj <raj.khem@gmail.com>
6 files changed, 127 insertions, 57 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch new file mode 100644 index 000000000..8ffc3be3e --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | help complier to use intrinsics, clang in few cases e.g. aarch64 can not | ||
2 | and then requires linking with libm, its the only function needed from libm then | ||
3 | its good to avoid needing it. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | |||
8 | --- a/include/fluent-bit/stream_processor/flb_sp_timeseries.h | ||
9 | +++ b/include/fluent-bit/stream_processor/flb_sp_timeseries.h | ||
10 | @@ -207,7 +207,7 @@ void cb_forecast_calc(struct timeseries | ||
11 | result = b0 + b1 * (val->f64 + *forecast->latest_x); | ||
12 | break; | ||
13 | default: | ||
14 | - result = nan(""); | ||
15 | + result = __builtin_nan(""); | ||
16 | break; | ||
17 | } | ||
18 | |||
19 | @@ -283,7 +283,7 @@ void cb_forecast_r_calc(struct timeserie | ||
20 | result = ((val->i64 - b0) / b1) - *forecast->latest_x; | ||
21 | break; | ||
22 | default: | ||
23 | - result = nan(""); | ||
24 | + result = __builtin_nan(""); | ||
25 | break; | ||
26 | } | ||
27 | |||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/cmake_multilib.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/cmake_multilib.patch deleted file mode 100644 index 8fe9f3e70..000000000 --- a/meta-oe/recipes-extended/fluentbit/fluentbit/cmake_multilib.patch +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | Use CMAKE_INSTALL_LIBDIR instead of hardcoding lib path | ||
2 | |||
3 | Helps build on platforms where libpaths are not lib/ but say lib64/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | |||
8 | --- a/src/CMakeLists.txt | ||
9 | +++ b/src/CMakeLists.txt | ||
10 | @@ -182,7 +182,7 @@ if(NOT FLB_WITHOUT_SHARED_LIB) | ||
11 | PROPERTIES OUTPUT_NAME fluent-bit) | ||
12 | |||
13 | # Library install routines | ||
14 | - install(TARGETS fluent-bit-shared LIBRARY DESTINATION lib) | ||
15 | + install(TARGETS fluent-bit-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
16 | endif() | ||
17 | |||
18 | # Static Library | ||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch new file mode 100644 index 000000000..a18578999 --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Define CMake variables to indicate init system for target | ||
2 | incase of cross compile, detecting systemd support based on | ||
3 | host directory structure is not right thing to do | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | Signed-off-by: Khem Raj <raj.kheem@gmail.com> | ||
7 | |||
8 | --- a/src/CMakeLists.txt | ||
9 | +++ b/src/CMakeLists.txt | ||
10 | @@ -317,7 +317,7 @@ if(FLB_BINARY) | ||
11 | install(TARGETS fluent-bit-bin RUNTIME DESTINATION ${FLB_INSTALL_BINDIR}) | ||
12 | |||
13 | # Detect init system, install upstart, systemd or init.d script | ||
14 | - if(IS_DIRECTORY /lib/systemd/system) | ||
15 | + if(IS_DIRECTORY /lib/systemd/system OR FLB_SYSTEMD) | ||
16 | set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service") | ||
17 | configure_file( | ||
18 | "${PROJECT_SOURCE_DIR}/init/systemd.in" | ||
19 | @@ -325,7 +325,7 @@ if(FLB_BINARY) | ||
20 | ) | ||
21 | install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system) | ||
22 | install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR}) | ||
23 | - elseif(IS_DIRECTORY /usr/share/upstart) | ||
24 | + elseif(IS_DIRECTORY /usr/share/upstart OR FLB_UPSTART) | ||
25 | set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf") | ||
26 | configure_file( | ||
27 | "${PROJECT_SOURCE_DIR}/init/upstart.in" | ||
28 | --- a/CMakeLists.txt | ||
29 | +++ b/CMakeLists.txt | ||
30 | @@ -70,6 +70,8 @@ option(FLB_RECORD_ACCESSOR "Enable re | ||
31 | option(FLB_SYSTEM_STRPTIME "Use strptime in system libc" Yes) | ||
32 | option(FLB_STATIC_CONF "Build binary using static configuration") | ||
33 | option(FLB_STREAM_PROCESSOR "Enable Stream Processor" Yes) | ||
34 | +option(FLB_SYSTEMD "Enable systemd init system" No) | ||
35 | +option(FLB_UPSTART "Enable upstart init system" No) | ||
36 | option(FLB_CORO_STACK_SIZE "Set coroutine stack size") | ||
37 | |||
38 | # Metrics: Experimental Feature, disabled by default on 0.12 series | ||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch index abaf92c05..67b3397a6 100644 --- a/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch | |||
@@ -3,16 +3,14 @@ Add --with-jemalloc-prefix=je_ so it compiles on musl | |||
3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
4 | Upstream-Status: Pending | 4 | Upstream-Status: Pending |
5 | 5 | ||
6 | Index: fluent-bit-0.12.1/CMakeLists.txt | 6 | --- a/CMakeLists.txt |
7 | =================================================================== | 7 | +++ b/CMakeLists.txt |
8 | --- fluent-bit-0.12.1.orig/CMakeLists.txt | 8 | @@ -523,7 +523,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME} |
9 | +++ fluent-bit-0.12.1/CMakeLists.txt | ||
10 | @@ -325,7 +325,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME} | ||
11 | # Link to Jemalloc as an external dependency | 9 | # Link to Jemalloc as an external dependency |
12 | ExternalProject_Add(jemalloc | 10 | ExternalProject_Add(jemalloc |
13 | SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc | 11 | SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1 |
14 | - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR> | 12 | - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR> |
15 | + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure --with-jemalloc-prefix=je_ ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR> | 13 | + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --with-jemalloc-prefix=je_ --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR> |
16 | CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops | 14 | CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops |
17 | BUILD_COMMAND ${MAKE} | 15 | BUILD_COMMAND $(MAKE) |
18 | INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/ | 16 | INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/ |
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.19.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.19.bb deleted file mode 100644 index 27b910b8b..000000000 --- a/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.19.bb +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | SUMMARY = "Fast data collector for Embedded Linux" | ||
2 | HOMEPAGE = "http://fluentbit.io" | ||
3 | BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" | ||
4 | |||
5 | SRC_URI = "http://fluentbit.io/releases/0.12/fluent-bit-${PV}.tar.gz \ | ||
6 | file://jemalloc.patch \ | ||
7 | file://cmake_multilib.patch \ | ||
8 | " | ||
9 | SRC_URI[md5sum] = "7c8708312ac9122faacf9e2a4751eb34" | ||
10 | SRC_URI[sha256sum] = "23a81087edf0e2c6f2d49411c6a82308afc5224f67bbaa45729c057af62e9241" | ||
11 | |||
12 | S = "${WORKDIR}/fluent-bit-${PV}" | ||
13 | |||
14 | LICENSE = "Apache-2.0" | ||
15 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" | ||
16 | |||
17 | DEPENDS = "zlib" | ||
18 | INSANE_SKIP_${PN}-dev += "dev-elf" | ||
19 | |||
20 | inherit cmake systemd | ||
21 | |||
22 | EXTRA_OECMAKE = "-DGNU_HOST=${HOST_SYS} -DFLB_ALL=ON -DFLB_TD=1" | ||
23 | |||
24 | # With Ninja it fails with: | ||
25 | # ninja: error: build.ninja:134: bad $-escape (literal $ must be written as $$) | ||
26 | OECMAKE_GENERATOR = "Unix Makefiles" | ||
27 | |||
28 | SYSTEMD_SERVICE_${PN} = "td-agent-bit.service" | ||
29 | |||
30 | TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}" | ||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb new file mode 100644 index 000000000..aad1499b9 --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb | |||
@@ -0,0 +1,55 @@ | |||
1 | SUMMARY = "Fast Log processor and Forwarder" | ||
2 | DESCRIPTION = "Fluent Bit is a data collector, processor and \ | ||
3 | forwarder for Linux. It supports several input sources and \ | ||
4 | backends (destinations) for your data. \ | ||
5 | " | ||
6 | |||
7 | HOMEPAGE = "http://fluentbit.io" | ||
8 | BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" | ||
9 | |||
10 | LICENSE = "Apache-2.0" | ||
11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" | ||
12 | SECTION = "net" | ||
13 | |||
14 | SRC_URI = "http://fluentbit.io/releases/1.3/fluent-bit-${PV}.tar.gz \ | ||
15 | file://jemalloc.patch \ | ||
16 | file://cross-build-init-system-detection.patch \ | ||
17 | file://builtin-nan.patch \ | ||
18 | " | ||
19 | SRC_URI[md5sum] = "6eae6dfd0a874e5dd270c36e9c68f747" | ||
20 | SRC_URI[sha256sum] = "e037c76c89269c8dc4027a08e442fefd2751b0f1e0f9c38f9a4b12d781a9c789" | ||
21 | |||
22 | S = "${WORKDIR}/fluent-bit-${PV}" | ||
23 | DEPENDS = "zlib bison-native flex-native" | ||
24 | DEPENDS_append_libc-musl = " fts " | ||
25 | |||
26 | INSANE_SKIP_${PN}-dev += "dev-elf" | ||
27 | |||
28 | # Use CMake 'Unix Makefiles' generator | ||
29 | OECMAKE_GENERATOR ?= "Unix Makefiles" | ||
30 | |||
31 | # Fluent Bit build options | ||
32 | # ======================== | ||
33 | |||
34 | # Host related setup | ||
35 | EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_ALL=ON -DFLB_TD=1" | ||
36 | |||
37 | # Disable LuaJIT and filter_lua support | ||
38 | EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off " | ||
39 | |||
40 | # Disable Library and examples | ||
41 | EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off -DFLB_EXAMPLES=Off " | ||
42 | |||
43 | EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','',d)}" | ||
44 | |||
45 | # Kafka Output plugin (disabled by default): note that when | ||
46 | # enabling Kafka output plugin, the backend library librdkafka | ||
47 | # requires 'openssl' as a dependency. | ||
48 | # | ||
49 | # DEPENDS += "openssl " | ||
50 | # EXTRA_OECMAKE += "-DFLB_OUT_KAFKA=On " | ||
51 | |||
52 | inherit cmake systemd features_check | ||
53 | |||
54 | SYSTEMD_SERVICE_${PN} = "td-agent-bit.service" | ||
55 | TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}" | ||