Closed lizziemac closed 2 months ago
Yes, I don't think LUA is supported due to some additional requirements. Yocto/Bitbake is currently best effort support - we can't test it in CI at the moment to verify anything or officially release it.
@tarruda may be able to help with the specific requirements of building LUA but my understanding is it was not possible on Bitbake at the time it was last tried. If it is then feel free to submit a PR.
In the file:
lib/luajit-cmake/host/minilua/CMakeLists.txt
There is an if to add LIBM:
find_library(LIBM_LIBRARIES NAMES m)
...
if(LIBM_LIBRARIES)
target_link_libraries(minilua ${LIBM_LIBRARIES})
endif()
But it does not fail if it can't find LIBM_LIBRARIES
(find_library(LIBM_LIBRARIES NAMES m)
)
I tried to inherit pkg-config
in the recipe but it still couldn't find it.
LIBM is a very primitive library, so I tried to force the linking
- if(LIBM_LIBRARIES)
- target_link_libraries(minilua ${LIBM_LIBRARIES})
-endif()
+ target_link_libraries(minilua libm.so)
And it worked for me.
I think that is for the luajit project though so it would need patching there if we wanted to import it but hopefully gives @lizziemac some info. A docs PR on it would be good too if it works: https://github.com/fluent/fluent-bit-docs/blob/master/installation/yocto-embedded-linux.md
Be good to update the minimum version there as well.
I was able to build with the above patch (applied to the fluent-bit recipe) and also by setting the number of parallel processes to 1, because there was an issue with luajit compiling dependencies after they were needed. I will look into creating a PR
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale
label.
This issue was closed because it has been stalled for 5 days with no activity.
Bug Report
Describe the bug All of the
.bb
examples I've found have had the-DFLB_LUAJIT
and-DFLB_FILTER_LUA
defines set toOff
. When I set them both toOn
, I see the below linker error.
# Fluent Bit - Yocto / Bitbake # ============================ # The following Bitbake package the latest Fluent Bit stable release. SUMMARY = "Fast Log processor and Forwarder" DESCRIPTION = "Fluent Bit is a data collector, processor and \ forwarder for Linux. It supports several input sources and \ backends (destinations) for your data. \ " HOMEPAGE = "http://fluentbit.io" BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" SECTION = "net" PR = "r0" PV = "2.2.2" SRCREV = "eeea396e88da26f586a7cc39df8017ab97f06939" SRC_URI = "git://github.com/fluent/fluent-bit.git;protocol=https;nobranch=1" S = "${WORKDIR}/git" DEPENDS = "zlib bison-native flex-native" DEPENDS += " libyaml curl " RDEPENDS:${PN} += " libcurl " INSANE_SKIP:${PN}-dev += "dev-elf" # Use CMake 'Unix Makefiles' generator OECMAKE_GENERATOR ?= "Unix Makefiles" # Fluent Bit build options # ======================== # Host related setup EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} " # Enable LuaJIT and filter_lua support (for redacting sensitive data) EXTRA_OECMAKE += "-DFLB_LUAJIT=On -DFLB_FILTER_LUA=On " # Disable Library and examples EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off -DFLB_EXAMPLES=Off " # Systemd support (optional) DEPENDS += "systemd" EXTRA_OECMAKE += "-DFLB_IN_SYSTEMD=On " # Kafka Output plugin (disabled by default): note that when # enabling Kafka output plugin, the backend library librdkafka # requires 'openssl' as a dependency. # # DEPENDS += "openssl " # EXTRA_OECMAKE += "-DFLB_OUT_KAFKA=On " inherit cmake systemd SYSTEMD_SERVICE:${PN} = "fluent-bit.service" TARGET_CC_ARCH:append = " ${SELECTED_OPTIMIZATION}"fluent-bit_2.2.2.bb
To Reproduce
EXTRA_OECMAKE += "-DFLB_LUAJIT=On -DFLB_FILTER_LUA=On "
Expected behavior When compiling fluentbit with Lua support, it succeeds, and I can add Lua filters like the following to my setup:
Your Environment
Additional context
-DFLB_LUAJIT=Off
, but fluentbit will report that the lua plugin is still missing: