Skip to content

Commit d295dab

Browse files
Merge branch 'fluent:master' into port-config-kinesis-plugin
2 parents 098d944 + 7256406 commit d295dab

File tree

21 files changed

+123
-23
lines changed

21 files changed

+123
-23
lines changed

.github/workflows/pr-compile-check.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,46 @@ jobs:
3030
push: false
3131
load: false
3232
provenance: false
33+
34+
# Sanity check for compilation using system libraries
35+
pr-compile-system-libs:
36+
runs-on: ubuntu-20.04
37+
timeout-minutes: 60
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
flb_option:
42+
- "-DFLB_PREFER_SYSTEM_LIBS=On"
43+
compiler:
44+
- gcc
45+
- clang
46+
steps:
47+
- name: Setup environment
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev libluajit-5.1-dev
51+
sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
52+
53+
- name: Checkout Fluent Bit code
54+
uses: actions/checkout@v4
55+
56+
- name: ${{ matrix.compiler }} - ${{ matrix.flb_option }}
57+
run: |
58+
export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) ))
59+
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
60+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
61+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
62+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
63+
cmake $GLOBAL_OPTS $FLB_OPT ../
64+
make -j $nparallel
65+
working-directory: build
66+
env:
67+
CC: ${{ matrix.compiler }}
68+
CXX: ${{ matrix.compiler }}
69+
FLB_OPT: ${{ matrix.flb_option }}
70+
GLOBAL_OPTS: "-DFLB_BACKTRACE=Off -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"
71+
72+
- name: Display dependencies w/ ldd
73+
run: |
74+
ldd ./bin/fluent-bit
75+
working-directory: build

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ option(FLB_HTTP_CLIENT_DEBUG "Enable HTTP Client debug callbacks" No)
178178
# Run ldconfig on package post-install
179179
option(FLB_RUN_LDCONFIG "Enable execution of ldconfig after installation" No)
180180

181+
# Prefer system libraries if available
182+
option(FLB_PREFER_SYSTEM_LIBS "Prefer system libraries" No)
183+
option(FLB_PREFER_SYSTEM_LIB_LUAJIT "Prefer the libluajit system library" ${FLB_PREFER_SYSTEM_LIBS})
184+
181185
# Enable all features
182186
if(FLB_ALL)
183187
# Global
@@ -940,7 +944,16 @@ endif()
940944
# LuaJIT (Scripting Support)
941945
# ==========================
942946
if(FLB_LUAJIT)
943-
include(cmake/luajit.cmake)
947+
if(FLB_PREFER_SYSTEM_LIB_LUAJIT)
948+
find_package(PkgConfig)
949+
pkg_check_modules(LUAJIT luajit>=2.1.0)
950+
endif()
951+
if(LUAJIT_FOUND)
952+
include_directories(${LUAJIT_INCLUDE_DIRS})
953+
link_directories(${LUAJIT_LIBRARY_DIRS})
954+
else()
955+
include(cmake/luajit.cmake)
956+
endif()
944957
FLB_DEFINITION(FLB_HAVE_LUAJIT)
945958
endif()
946959

cmake/headers.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ include_directories(
2222
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CHUNKIO}/include
2323
${CMAKE_CURRENT_BINARY_DIR}/lib/chunkio/include
2424

25-
# LuaJIT
26-
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_LUAJIT}/src
27-
${CMAKE_CURRENT_BINARY_DIR}/lib/luajit-cmake
28-
2925
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MONKEY}/include
3026
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MONKEY}/include/monkey
3127
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MBEDTLS}/include

cmake/luajit.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22
option(LUAJIT_DIR "Path of LuaJIT 2.1 source dir" ON)
33
option(LUAJIT_SETUP_INCLUDE_DIR "Setup include dir if parent is present" OFF)
44
set(LUAJIT_DIR ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_LUAJIT})
5+
include_directories(
6+
${LUAJIT_DIR}/src
7+
${CMAKE_CURRENT_BINARY_DIR}/lib/luajit-cmake
8+
)
59
add_subdirectory("lib/luajit-cmake")
10+
set(LUAJIT_LIBRARIES "libluajit")

lib/cmetrics/.github/workflows/build.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
with:
2424
submodules: true
2525

26+
- name: Set up with Developer Command Prompt for Microsoft Visual C++
27+
uses: ilammy/msvc-dev-cmd@v1
28+
with:
29+
toolset: 14.29 # For using VS2019 C++
30+
2631
- name: Build on ${{ matrix.os }} with vs-2019
2732
run: |
2833
.\scripts\win_build.bat
@@ -39,10 +44,11 @@ jobs:
3944
steps:
4045
- name: Set up base image dependencies
4146
run: |
47+
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
48+
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
4249
yum -y update && \
4350
yum install -y ca-certificates cmake gcc gcc-c++ git make wget && \
44-
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
45-
rpm -ivh epel-release-latest-7.noarch.rpm && \
51+
yum install -y epel-release
4652
yum install -y cmake3
4753
shell: bash
4854

lib/cmetrics/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
66
# CMetrics Version
77
set(CMT_VERSION_MAJOR 0)
88
set(CMT_VERSION_MINOR 9)
9-
set(CMT_VERSION_PATCH 1)
9+
set(CMT_VERSION_PATCH 3)
1010
set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}")
1111

1212
# Include helpers
@@ -241,6 +241,12 @@ if (NOT CMT_HAVE_CFL)
241241
COMPONENT headers
242242
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
243243

244+
install(TARGETS cfl-static
245+
RUNTIME DESTINATION ${CMT_INSTALL_BINDIR}
246+
LIBRARY DESTINATION ${CMT_INSTALL_LIBDIR}
247+
ARCHIVE DESTINATION ${CMT_INSTALL_LIBDIR}
248+
COMPONENT library)
249+
244250
# xxHash
245251
install(FILES lib/cfl/lib/xxhash/xxh3.h
246252
DESTINATION ${CMT_INSTALL_INCLUDEDIR}

lib/cmetrics/scripts/win_build.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
setlocal
2-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
3-
path "C:\Program Files (x86)\MSBuild\16.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin";%path%
42
git submodule update --init --recursive
53
cd build
64
cmake -G "NMake Makefiles" -DCMT_TESTS=On ..\

lib/cmetrics/src/cmt_decode_prometheus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static int parse_uint64(const char *in, uint64_t *out)
200200
int64_t val;
201201

202202
errno = 0;
203-
val = strtol(in, &end, 10);
203+
val = strtoll(in, &end, 10);
204204
if (end == in || *end != 0 || errno) {
205205
return -1;
206206
}

lib/ctraces/.github/workflows/build.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ jobs:
3939
steps:
4040
- name: Set up base image dependencies
4141
run: |
42+
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
43+
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
4244
yum -y update && \
4345
yum install -y ca-certificates cmake curl-devel gcc gcc-c++ git make wget && \
44-
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
45-
rpm -ivh epel-release-latest-7.noarch.rpm && \
46+
yum install -y epel-release
4647
yum install -y cmake3
4748
shell: bash
4849

lib/ctraces/.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v3
3131
- name: Run markdownlint
32-
uses: actionshub/markdownlint@2.0.2
32+
uses: actionshub/markdownlint@v3.1.4

0 commit comments

Comments
 (0)