Skip to contentSkip to conversation

fluentbit: set UPSTREAM_CHECK_GITTAGREGEX

PATCH New Peter Marko 1 participant 7 messages Mar 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 fluentbit: set UPSTREAM_CHECK_GITTAGREGEX

From: Peter Marko <[email protected]>

"devtool latest-version fluentbit" shows currently:
INFO: Latest version: 20220215
which is something old.

This change switches it to:
INFO: Latest version: 3.2.8
which was released on 2025-02-27.

---
 meta-oe/recipes-extended/fluentbit/fluentbit_3.2.1.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-extended/fluentbit/fluentbit_3.2.1.bb +3 -0
index b895c7da0d..30a62dbc12 100644
@@ -31,6 +31,9 @@ SRC_URI:append:libc-musl = "\
     file://0005-Use-posix-strerror_r-with-musl.patch \
 "
 
+# prefix tag with "v" to avoid upgrade to random tags like "20220215"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>(\d+(\.\d+)+))"
+
 S = "${WORKDIR}/git"
 
 PACKAGECONFIG ??= "\
#1 lore raw

PATCH 2/7 fluentbit: upgrade 3.2.1 -> 3.2.8

From: Peter Marko <[email protected]>

Handle CVE-2024-50608 and CVE-2024-50609 (in 3.2.7).

Drop two patches addressed upstream.
Refresh remaining patches.
zstd is now bundled without possibility to unbundle.

---
 ...rivate-makefile-targets-in-CMakelist.patch | 10 ++--
 ...ts.txt-Revise-init-manager-deduction.patch |  4 +-
 ...d-cmake-try_run-when-cross-compiling.patch | 42 --------------
 ..._text.c-fix-wrong-pointer-assignment.patch | 56 -------------------
 ...{fluentbit_3.2.1.bb => fluentbit_3.2.8.bb} | 11 ++--
 5 files changed, 11 insertions(+), 112 deletions(-)
 delete mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch
 delete mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/0005-cprof_encode_text.c-fix-wrong-pointer-assignment.patch
 rename meta-oe/recipes-extended/fluentbit/{fluentbit_3.2.1.bb => fluentbit_3.2.8.bb} (94%)
meta-oe/recipes-extended/fluentbit/fluentbit/0001-lib-Do-not-use-private-makefile-targets-in-CMakelist.patch +5 -5
index 642a73dac2..fae98f1f5d 100644
@@ -70,8 +70,8 @@ diff --git a/lib/ctraces/CMakeLists.txt b/lib/ctraces/CMakeLists.txt
 index e47ba022d..0ddfd5f97 100644
 --- a/lib/ctraces/CMakeLists.txt
 +++ b/lib/ctraces/CMakeLists.txt
-@@ -30,12 +30,8 @@ set(CTR_VERSION_MINOR  5)
- set(CTR_VERSION_PATCH  7)
+@@ -30,12 +30,8 @@ set(CTR_VERSION_MINOR  6)
+ set(CTR_VERSION_PATCH  0)
  set(CTR_VERSION_STR "${CTR_VERSION_MAJOR}.${CTR_VERSION_MINOR}.${CTR_VERSION_PATCH}")
  
 -# Define __FILENAME__ consistently across Operating Systems
@@ -95,9 +95,9 @@ index 028240bcc..b386cb726 100644
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra")
 -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$$(subst ${CMAKE_SOURCE_DIR}/,,$$(abspath \$$<))\"'")
 -else()
--set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
- endif()
-+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
++endif()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
+-endif()
  
  # Monkey Version
  set(MK_VERSION_MAJOR  1)
meta-oe/recipes-extended/fluentbit/fluentbit/0003-CMakeLists.txt-Revise-init-manager-deduction.patch +2 -2
index 4da1650bc1..8dd4da47ec 100644
@@ -18,7 +18,7 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
 index 8404b65c1..0c7876058 100644
 --- a/src/CMakeLists.txt
 +++ b/src/CMakeLists.txt
-@@ -540,7 +540,7 @@ if(FLB_BINARY)
+@@ -546,7 +546,7 @@ if(FLB_BINARY)
      set(SYSTEMD_UNITDIR  /lib/systemd/system)
    endif()
  
@@ -27,7 +27,7 @@ index 8404b65c1..0c7876058 100644
      set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service")
      configure_file(
        "${PROJECT_SOURCE_DIR}/init/systemd.in"
-@@ -548,7 +548,7 @@ if(FLB_BINARY)
+@@ -554,7 +554,7 @@ if(FLB_BINARY)
        )
      install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION ${SYSTEMD_UNITDIR})
      install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR} COMPONENT binary)
meta-oe/recipes-extended/fluentbit/fluentbit/0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch deleted +0 -42

42 lines not on this page · raw message

meta-oe/recipes-extended/fluentbit/fluentbit/0005-cprof_encode_text.c-fix-wrong-pointer-assignment.patch deleted +0 -56

56 lines not on this page · raw message

meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb renamed from meta-oe/recipes-extended/fluentbit/fluentbit_3.2.1.bb +4 -7
similarity index 94%
rename from meta-oe/recipes-extended/fluentbit/fluentbit_3.2.1.bb
rename to meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb
index 30a62dbc12..fbaee9e121 100644
@@ -17,14 +17,12 @@ DEPENDS = "\
 "
 DEPENDS:append:libc-musl = " fts"
 
-SRCREV = "600b5a955b5ef7b9d025e0c128432260d0c6a5f1"
+SRCREV = "d13e8e4ab2029fa92600b7d1d0da28f8dcc350eb"
 SRC_URI = "\
-    git://github.com/fluent/fluent-bit.git;branch=master;protocol=https \
+    git://github.com/fluent/fluent-bit.git;branch=3.2;protocol=https \
     file://0001-lib-Do-not-use-private-makefile-targets-in-CMakelist.patch \
     file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \
     file://0003-CMakeLists.txt-Revise-init-manager-deduction.patch \
-    file://0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch \
-    file://0005-cprof_encode_text.c-fix-wrong-pointer-assignment.patch \
 "
 SRC_URI:append:libc-musl = "\
     file://0004-chunkio-Link-with-fts-library-with-musl.patch \
@@ -114,9 +112,8 @@ PACKAGECONFIG[windows-defaults] = "-DFLB_WINDOWS_DEFAULTS=Yes,-DFLB_WINDOWS_DEFA
 # individual plugins then to enable (e.g. using EXTRA_OECMAKE:append = " -DFLB_FOOBAR=ON")
 PACKAGECONFIG[minimal] = "-DFLB_MINIMAL=Yes,-DFLB_MINIMAL=No"
 
-# Without zstd dependency, kafka plugin build fails at link attempt against native libzstd.so
-PACKAGECONFIG[in-kafka] = "-DFLB_IN_KAFKA=ON,-DFLB_IN_KAFKA=OFF,librdkafka zstd curl"
-PACKAGECONFIG[out-kafka] = "-DFLB_OUT_KAFKA=ON,-DFLB_OUT_KAFKA=OFF,librdkafka zstd curl"
+PACKAGECONFIG[in-kafka] = "-DFLB_IN_KAFKA=ON,-DFLB_IN_KAFKA=OFF,librdkafka curl"
+PACKAGECONFIG[out-kafka] = "-DFLB_OUT_KAFKA=ON,-DFLB_OUT_KAFKA=OFF,librdkafka curl"
 
 SYSTEMD_SERVICE:${PN} = "fluent-bit.service"
 
#2 lore raw

PATCH 3/7 fluentbit: drop compiler optimization package configs

In reply to Peter Marko

From: Peter Marko <[email protected]>

These manipulate compiler flags instead of using what yocto provides.
* "coverage" adds paths to binaries and thus causes buildpaths errors
* "small" strips binaries, so causes already-stripped error.
* DEBUG_BUILD is the correct way to enable debug/release flags in yocto

---
 meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb +4 -5
index fbaee9e121..94fbed0962 100644
@@ -48,7 +48,6 @@ PACKAGECONFIG ??= "\
     proxy-go \
     record-accessor \
     regex \
-    release \
     signv4 \
     sqldb \
     stream-processor \
@@ -73,9 +72,7 @@ PACKAGECONFIG[backtrace] = "-DFLB_BACKTRACE=Yes,-DFLB_BACKTRACE=No"
 PACKAGECONFIG[binary] = "-DFLB_BINARY=Yes,-DFLB_BINARY=No"
 PACKAGECONFIG[chunk-trace] = "-DFLB_CHUNK_TRACE=Yes,-DFLB_CHUNK_TRACE=No"
 PACKAGECONFIG[config-yaml] = "-DFLB_CONFIG_YAML=Yes,-DFLB_CONFIG_YAML=No,libyaml"
-PACKAGECONFIG[coverage] = "-DFLB_COVERAGE=Yes,-DFLB_COVERAGE=No"
 PACKAGECONFIG[custom-calyptia] = "-DFLB_CUSTOM_CALYPTIA=Yes,-DFLB_CUSTOM_CALYPTIA=No"
-PACKAGECONFIG[debug] = "-DFLB_DEBUG=Yes,-DFLB_DEBUG=No"
 PACKAGECONFIG[enforce-alignment] = "-DFLB_ENFORCE_ALIGNMENT=Yes,-DFLB_ENFORCE_ALIGNMENT=No"
 PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=Yes,-DFLB_EXAMPLES=No"
 PACKAGECONFIG[http-client-debug] = "-DFLB_HTTP_CLIENT_DEBUG=Yes,-DFLB_HTTP_CLIENT_DEBUG=No"
@@ -91,11 +88,9 @@ PACKAGECONFIG[posix-tls] = "-DFLB_POSIX_TLS=Yes,-DFLB_POSIX_TLS=No"
 PACKAGECONFIG[proxy-go] = "-DFLB_PROXY_GO=Yes,-DFLB_PROXY_GO=No"
 PACKAGECONFIG[record-accessor] = "-DFLB_RECORD_ACCESSOR=Yes,-DFLB_RECORD_ACCESSOR=No"
 PACKAGECONFIG[regex] = "-DFLB_REGEX=Yes,-DFLB_REGEX=No"
-PACKAGECONFIG[release] = "-DFLB_RELEASE=Yes,-DFLB_RELEASE=No"
 PACKAGECONFIG[run-ldconfig] = "-DFLB_RUN_LDCONFIG=Yes,-DFLB_RUN_LDCONFIG=No"
 PACKAGECONFIG[shared-lib] = "-DFLB_SHARED_LIB=Yes,-DFLB_SHARED_LIB=No"
 PACKAGECONFIG[signv4] = "-DFLB_SIGNV4=Yes,-DFLB_SIGNV4=No"
-PACKAGECONFIG[small] = "-DFLB_SMALL=Yes,-DFLB_SMALL=No"
 PACKAGECONFIG[sqldb] = "-DFLB_SQLDB=Yes,-DFLB_SQLDB=No"
 PACKAGECONFIG[stream-processor] = "-DFLB_STREAM_PROCESSOR=Yes,-DFLB_STREAM_PROCESSOR=No"
 PACKAGECONFIG[tests-runtime] = "-DFLB_TESTS_RUNTIME=Yes,-DFLB_TESTS_RUNTIME=No"
@@ -119,6 +114,10 @@ SYSTEMD_SERVICE:${PN} = "fluent-bit.service"
 
 inherit cmake systemd pkgconfig
 
+# disable manipulation of compiler flags and CMAKE_BUILD_TYPE
+# release and coverage are off by default, disable also debug
+EXTRA_OECMAKE += "-DFLB_DEBUG=No"
+
 FULL_OPTIMIZATION:remove = "${@'-O2' if bb.data.inherits_class('clang', d) else ''}"
 TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}"
 TARGET_CC_ARCH:remove = "-D_FORTIFY_SOURCE=2"
#3 lore raw

PATCH 4/7 fluentbit: fix valgrind package config

In reply to Peter Marko

From: Peter Marko <[email protected]>

Add valgrind dependency to fix:
fatal error: valgrind/valgrind.h: No such file or directory

---
 meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb +1 -1
index 94fbed0962..cd4cba6a14 100644
@@ -97,7 +97,7 @@ PACKAGECONFIG[tests-runtime] = "-DFLB_TESTS_RUNTIME=Yes,-DFLB_TESTS_RUNTIME=No"
 PACKAGECONFIG[tls] = "-DFLB_TLS=Yes,-DFLB_TLS=No"
 PACKAGECONFIG[trace] = "-DFLB_TRACE=Yes,-DFLB_TRACE=No"
 PACKAGECONFIG[utf8-encoder] = "-DFLB_UTF8_ENCODER=Yes,-DFLB_UTF8_ENCODER=No"
-PACKAGECONFIG[valgrind] = "-DFLB_VALGRIND=Yes,-DFLB_VALGRIND=No"
+PACKAGECONFIG[valgrind] = "-DFLB_VALGRIND=Yes,-DFLB_VALGRIND=No,valgrind"
 PACKAGECONFIG[wamrc] = "-DFLB_WAMRC=Yes,-DFLB_WAMRC=No"
 PACKAGECONFIG[wasm-stack-protect] = "-DFLB_WASM_STACK_PROTECT=Yes,-DFLB_WASM_STACK_PROTECT=No"
 PACKAGECONFIG[wasm] = "-DFLB_WASM=Yes,-DFLB_WASM=No"
#4 lore raw

PATCH 5/7 fluentbit: fix shared-lib package config

In reply to Peter Marko

From: Peter Marko <[email protected]>

Add library to packaged files to fix:

ERROR: fluentbit-3.2.8-r0 do_package: QA Issue: fluentbit: Files/directories were installed but not shipped in any package:
/usr/lib/fluent-bit
/usr/lib/fluent-bit/libfluent-bit.so
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
fluentbit: 2 installed and not shipped files. [installed-vs-shipped]

---
 meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb +3 -0
index cd4cba6a14..c7fc7d1e19 100644
@@ -139,3 +139,6 @@ do_configure:prepend() {
 do_compile:append() {
     find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|${TARGET_DBGSRC_DIR}/|g'
 }
+
+# needed for shared-lib package config
+FILES:${PN} += "${libdir}/fluent-bit"
#5 lore raw

PATCH 6/7 fluentbit: add profiles package config

In reply to Peter Marko

From: Peter Marko <[email protected]>

Since the recipe tries to list every single option, add this one which is missing. It is enabled by default in cmake to enabling it by default in package config retains current settings.

---
 meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb +2 -0
index c7fc7d1e19..406a5b7b9e 100644
@@ -45,6 +45,7 @@ PACKAGECONFIG ??= "\
     metrics \
     parser \
     prefer-system-libs \
+    profiles \
     proxy-go \
     record-accessor \
     regex \
@@ -85,6 +86,7 @@ PACKAGECONFIG[metrics] = "-DFLB_METRICS=Yes,-DFLB_METRICS=No"
 PACKAGECONFIG[mtrace] = "-DFLB_MTRACE=Yes,-DFLB_MTRACE=No"
 PACKAGECONFIG[parser] = "-DFLB_PARSER=Yes,-DFLB_PARSER=No"
 PACKAGECONFIG[posix-tls] = "-DFLB_POSIX_TLS=Yes,-DFLB_POSIX_TLS=No"
+PACKAGECONFIG[profiles] = "-DFLB_PROFILES=Yes,-DFLB_PROFILES=No"
 PACKAGECONFIG[proxy-go] = "-DFLB_PROXY_GO=Yes,-DFLB_PROXY_GO=No"
 PACKAGECONFIG[record-accessor] = "-DFLB_RECORD_ACCESSOR=Yes,-DFLB_RECORD_ACCESSOR=No"
 PACKAGECONFIG[regex] = "-DFLB_REGEX=Yes,-DFLB_REGEX=No"
#6 lore raw

PATCH 7/7 fluentbit: fix aws-error-reporter package config

In reply to Peter Marko

From: Peter Marko <[email protected]>

Compilation fails with several errors in flb_aws_error_reporter.c

---
 meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-extended/fluentbit/fluentbit_3.2.8.bb +1 -0
index 406a5b7b9e..59e23567b1 100644
@@ -129,6 +129,7 @@ EXTRA_OECMAKE:append:powerpc = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic"
 EXTRA_OECMAKE:append:riscv32 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic"
 EXTRA_OECMAKE:append:riscv64 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic"
 EXTRA_OECMAKE:append:x86 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic"
+SECURITY_STRINGFORMAT:remove = "${@bb.utils.contains('PACKAGECONFIG', 'aws-error-reporter', '-Werror=format-security', '', d)}"
 
 do_configure:prepend() {
     sed -i \