Skip to content

Commit 896734e

Browse files
authored
Merge branch 'master' into fix-storage-inherit-test
Signed-off-by: Jorge Niedbalski <[email protected]>
2 parents 739e32d + b491682 commit 896734e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2559
-472
lines changed

.github/workflows/call-build-windows.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,16 @@ jobs:
8282
config:
8383
- name: "Windows 32bit"
8484
arch: x86
85-
openssl_dir: C:\vcpkg\packages\openssl_x86-windows-static
8685
cmake_additional_opt: ""
8786
vcpkg_triplet: x86-windows-static
8887
cmake_version: "3.31.6"
8988
- name: "Windows 64bit"
9089
arch: x64
91-
openssl_dir: C:\vcpkg\packages\openssl_x64-windows-static
9290
cmake_additional_opt: ""
9391
vcpkg_triplet: x64-windows-static
9492
cmake_version: "3.31.6"
9593
- name: "Windows 64bit (Arm64)"
9694
arch: amd64_arm64
97-
openssl_dir: C:\vcpkg\packages\openssl_arm64-windows-static
9895
cmake_additional_opt: "-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_SYSTEM_PROCESSOR=ARM64"
9996
vcpkg_triplet: arm64-windows-static
10097
cmake_version: "3.31.6"
@@ -143,10 +140,10 @@ jobs:
143140
uses: actions/cache/restore@v4
144141
with:
145142
path: |
146-
C:\vcpkg\packages
147-
key: ${{ runner.os }}-${{ matrix.config.arch }}-vcpkg-${{ steps.get-date.outputs.date }}
143+
C:\vcpkg\installed
144+
key: ${{ runner.os }}-${{ matrix.config.arch }}-vcpkg-installed-${{ steps.get-date.outputs.date }}
148145
restore-keys: |
149-
${{ runner.os }}-${{ matrix.config.arch }}-vcpkg-
146+
${{ runner.os }}-${{ matrix.config.arch }}-vcpkg-installed-
150147
enableCrossOsArchive: false
151148

152149
- name: Build openssl with vcpkg
@@ -159,12 +156,17 @@ jobs:
159156
C:\vcpkg\vcpkg install --recurse libyaml --triplet ${{ matrix.config.vcpkg_triplet }}
160157
shell: cmd
161158

159+
- name: Upgrade any outdated vcpkg packages
160+
run: |
161+
C:\vcpkg\vcpkg upgrade --no-dry-run
162+
shell: cmd
163+
162164
- name: Save packages of vcpkg
163165
id: save-vcpkg-sources
164166
uses: actions/cache/save@v4
165167
with:
166168
path: |
167-
C:\vcpkg\packages
169+
C:\vcpkg\installed
168170
key: ${{ steps.cache-vcpkg-sources.outputs.cache-primary-key }}
169171
enableCrossOsArchive: false
170172

@@ -174,7 +176,7 @@ jobs:
174176
# This is only supposed to be a workaround for now so can be easily removed later.
175177
if: ${{ matrix.config.arch != 'amd64_arm64' || needs.call-build-windows-get-meta.outputs.armSupported == 'true' }}
176178
run: |
177-
cmake -G "NMake Makefiles" -DFLB_NIGHTLY_BUILD='${{ inputs.unstable }}' -DOPENSSL_ROOT_DIR='${{ matrix.config.openssl_dir }}' ${{ matrix.config.cmake_additional_opt }} -DFLB_LIBYAML_DIR=C:\vcpkg\packages\libyaml_${{ matrix.config.vcpkg_triplet }} ../
179+
cmake -G "NMake Makefiles" -DFLB_NIGHTLY_BUILD='${{ inputs.unstable }}' -DOPENSSL_ROOT_DIR='C:\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}' ${{ matrix.config.cmake_additional_opt }} -DFLB_LIBYAML_DIR='C:\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}' ../
178180
cmake --build .
179181
cpack
180182
working-directory: build

.github/workflows/call-windows-unit-tests.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ jobs:
3636
config:
3737
- name: "Windows 32bit"
3838
arch: x86
39-
openssl_dir: C:\vcpkg\packages\openssl_x86-windows-static
4039
cmake_additional_opt: ""
4140
vcpkg_triplet: x86-windows-static
4241
cmake_version: "3.31.6"
4342
- name: "Windows 64bit"
4443
arch: x64
45-
openssl_dir: C:\vcpkg\packages\openssl_x64-windows-static
4644
cmake_additional_opt: ""
4745
vcpkg_triplet: x64-windows-static
4846
cmake_version: "3.31.6"
@@ -91,10 +89,10 @@ jobs:
9189
uses: actions/cache/restore@v4
9290
with:
9391
path: |
94-
C:\vcpkg\packages
95-
key: ${{ runner.os }}-${{ matrix.config.arch }}-wintest-vcpkg-${{ steps.get-date.outputs.date }}
92+
C:\vcpkg\installed
93+
key: ${{ runner.os }}-${{ matrix.config.arch }}-wintest-vcpkg-installed-${{ steps.get-date.outputs.date }}
9694
restore-keys: |
97-
${{ runner.os }}-${{ matrix.config.arch }}-wintest-vcpkg-
95+
${{ runner.os }}-${{ matrix.config.arch }}-wintest-vcpkg-installed-
9896
enableCrossOsArchive: false
9997

10098
- name: Build openssl with vcpkg
@@ -107,12 +105,17 @@ jobs:
107105
C:\vcpkg\vcpkg install --recurse libyaml --triplet ${{ matrix.config.vcpkg_triplet }}
108106
shell: cmd
109107

108+
- name: Upgrade any outdated vcpkg packages
109+
run: |
110+
C:\vcpkg\vcpkg upgrade --no-dry-run
111+
shell: cmd
112+
110113
- name: Save packages of vcpkg
111114
id: save-vcpkg-sources
112115
uses: actions/cache/save@v4
113116
with:
114117
path: |
115-
C:\vcpkg\packages
118+
C:\vcpkg\installed
116119
key: ${{ steps.cache-unit-test-vcpkg-sources.outputs.cache-primary-key }}
117120
enableCrossOsArchive: false
118121

@@ -121,9 +124,9 @@ jobs:
121124
cmake -G "NMake Makefiles" `
122125
-D FLB_TESTS_INTERNAL=On `
123126
-D FLB_NIGHTLY_BUILD='${{ inputs.unstable }}' `
124-
-D OPENSSL_ROOT_DIR='${{ matrix.config.openssl_dir }}' `
127+
-D OPENSSL_ROOT_DIR='C:\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}' `
125128
${{ matrix.config.cmake_additional_opt }} `
126-
-D FLB_LIBYAML_DIR=C:\vcpkg\packages\libyaml_${{ matrix.config.vcpkg_triplet }} `
129+
-D FLB_LIBYAML_DIR='C:\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}' `
127130
-D FLB_WITHOUT_flb-rt-out_elasticsearch=On `
128131
-D FLB_WITHOUT_flb-rt-out_td=On `
129132
-D FLB_WITHOUT_flb-rt-out_forward=On `

CMakeLists.txt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
88
# Fluent Bit Version
99
set(FLB_VERSION_MAJOR 4)
1010
set(FLB_VERSION_MINOR 0)
11-
set(FLB_VERSION_PATCH 2)
11+
set(FLB_VERSION_PATCH 3)
1212
set(FLB_VERSION_STR "${FLB_VERSION_MAJOR}.${FLB_VERSION_MINOR}.${FLB_VERSION_PATCH}")
1313

1414
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -67,9 +67,16 @@ if (MSVC)
6767
# /wd4100 .. C4100 (unreferenced formal parameter)
6868
# /wd5045 .. C5045 (Spectre mitigation)
6969
#
70+
# Restore /OPT:REF after setting /Debug, enable /OPT:ICF for 64-bit
71+
# builds per Microsoft recommended best practices.
7072
set(CMAKE_C_FLAGS "/DWIN32 /D_WINDOWS /DNDEBUG /O2 /Zi /wd4100 /wd4711 /wd5045")
71-
set(CMAKE_EXE_LINKER_FLAGS "/Debug /INCREMENTAL:NO")
73+
set(CMAKE_EXE_LINKER_FLAGS "/DEBUG /OPT:REF /INCREMENTAL:NO")
74+
set(CMAKE_SHARED_LINKER_FLAGS "/DEBUG /OPT:REF /INCREMENTAL:NO")
7275
set(CMAKE_BUILD_TYPE None)
76+
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
77+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:ICF")
78+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:ICF")
79+
endif()
7380

7481
# Use add_compile_options() to set /MT since Visual Studio
7582
# Generator does not notice /MT in CMAKE_C_FLAGS.
@@ -882,6 +889,18 @@ if(FLB_HAVE_GMTOFF)
882889
FLB_DEFINITION(FLB_HAVE_GMTOFF)
883890
endif()
884891

892+
# tm_zone support
893+
check_c_source_compiles("
894+
#include <time.h>
895+
int main() {
896+
struct tm tm;
897+
tm.tm_zone = \"GMT\";
898+
return 0;
899+
}" FLB_HAVE_TIME_ZONE)
900+
if(FLB_HAVE_TIME_ZONE)
901+
FLB_DEFINITION(FLB_HAVE_TIME_ZONE)
902+
endif()
903+
885904
# clock_get_time() support for macOS.
886905
check_c_source_compiles("
887906
#include <mach/clock.h>
@@ -1029,12 +1048,8 @@ else()
10291048
set(AUTOCONF_HOST_OPT "--host=${GNU_HOST}")
10301049
endif()
10311050

1032-
if(CMAKE_GENERATOR MATCHES "Ninja")
1033-
if(FLB_SYSTEM_WINDOWS)
1034-
MESSAGE(FATAL_ERROR "Building with Ninja is not supported on Windows")
1035-
else()
1036-
set(EXTERNAL_BUILD_TOOL "make")
1037-
endif()
1051+
if(CMAKE_GENERATOR MATCHES "Ninja" AND NOT FLB_SYSTEM_WINDOWS)
1052+
set(EXTERNAL_BUILD_TOOL "make")
10381053
else()
10391054
set(EXTERNAL_BUILD_TOOL "$(MAKE)")
10401055
endif()

dockerfiles/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7,linux/s390x" -f ./dockerfiles/Dockerfile.multiarch --build-arg FLB_TARBALL=https://github.com/fluent/fluent-bit/archive/v1.8.11.tar.gz ./dockerfiles/
1414

1515
# Set this to the current release version: it gets done so as part of the release.
16-
ARG RELEASE_VERSION=4.0.2
16+
ARG RELEASE_VERSION=4.0.3
1717

1818
# For multi-arch builds - assumption is running on an AMD64 host
1919
FROM multiarch/qemu-user-static:x86_64-arm AS qemu-arm32

fluent-bit-4.0.2.bb renamed to fluent-bit-4.0.3.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
1616
SECTION = "net"
1717

1818
PR = "r0"
19-
PV = "4.0.2"
19+
PV = "4.0.3"
2020

2121
SRCREV = "v${PV}"
2222
SRC_URI = "git://github.com/fluent/fluent-bit.git;nobranch=1"

include/fluent-bit/flb_gzip.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ int flb_gzip_compress(void *in_data, size_t in_len,
3131
int flb_gzip_uncompress(void *in_data, size_t in_len,
3232
void **out_data, size_t *out_size);
3333

34+
/*
35+
* Uncompress a gzip payload with trailing data. On success in_remaining is set to the number
36+
* of input bits not part of the first gzip payload.
37+
*/
38+
int flb_gzip_uncompress_multi(void *in_data, size_t in_len,
39+
void **out_data, size_t *out_size, size_t *in_remaining);
40+
3441
void *flb_gzip_decompression_context_create();
3542
void flb_gzip_decompression_context_destroy(void *context);
3643

3744
int flb_gzip_decompressor_dispatch(struct flb_decompression_context *context,
3845
void *out_data, size_t *out_size);
3946

4047
int flb_is_http_session_gzip_compressed(struct mk_http_session *session);
41-
size_t flb_gzip_count(const char *data, size_t len, size_t **out_borders, size_t border_count);
4248

4349
#endif

include/fluent-bit/flb_log.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <fluent-bit/flb_worker.h>
2929
#include <fluent-bit/flb_config.h>
3030
#include <fluent-bit/flb_sds.h>
31+
#include <cmetrics/cmetrics.h>
32+
#include <cmetrics/cmt_counter.h>
3133
#include <inttypes.h>
3234
#include <errno.h>
3335
#include <stdarg.h>
@@ -72,6 +74,7 @@ struct flb_log {
7274
pthread_t tid; /* thread ID */
7375
struct flb_worker *worker; /* non-real worker reference */
7476
struct mk_event_loop *evl;
77+
struct flb_log_metrics *metrics;
7578

7679
/* Initialization variables */
7780
int pth_init;
@@ -92,6 +95,14 @@ struct flb_log_cache {
9295
struct mk_list entries; /* list for entries */
9396
};
9497

98+
/* Global metrics for logging calls. */
99+
struct flb_log_metrics {
100+
struct cmt *cmt;
101+
102+
/* cmetrics */
103+
struct cmt_counter *logs_total_counter; /* total number of logs (by message type) */
104+
};
105+
95106
/*
96107
* This function is used by plugins interface to check if an incoming log message
97108
* should be logged or not based in the log levels defined.

include/fluent-bit/flb_mem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
/*
5151
* Return 1 or 0 based on a probability.
5252
*/
53-
int flb_malloc_p;
54-
int flb_malloc_mod;
53+
extern int flb_malloc_p;
54+
extern int flb_malloc_mod;
5555

5656
static inline int flb_fuzz_get_probability(int val) {
5757
flb_malloc_p += 1;

include/fluent-bit/flb_time.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ struct flb_time {
3232

3333
struct flb_tm {
3434
struct tm tm;
35+
#ifndef FLB_HAVE_TIME_ZONE
36+
char *tm_zone;
37+
#endif
3538
#ifndef FLB_HAVE_GMTOFF
3639
long int tm_gmtoff;
3740
#endif
@@ -43,6 +46,12 @@ struct flb_tm {
4346
#define flb_tm_gmtoff(x) (x)->tm.tm_gmtoff
4447
#endif
4548

49+
#ifndef FLB_HAVE_TIME_ZONE
50+
#define flb_tm_zone(x) (x)->tm_zone
51+
#else
52+
#define flb_tm_zone(x) (x)->tm.tm_zone
53+
#endif
54+
4655
/*
4756
to represent eventtime of fluentd
4857
see also

lib/cfl/.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
steps:
141141
- uses: actions/checkout@v4
142142
- name: Build on ${{ matrix.os }} with ${{ matrix.compiler }}
143-
uses: uraimo/[email protected].0
143+
uses: uraimo/[email protected].1
144144
with:
145145
arch: aarch64
146146
distro: ubuntu_latest

0 commit comments

Comments
 (0)