-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: enable compiling fluentd-bit static binary #2558
base: master
Are you sure you want to change the base?
Conversation
|
Implementation breaks valgrind result, some help would be welcomed.
|
There some discussion that suggests |
…IC_BINARY cmake option This can be useful when fluentd-bit is running on a limited-access host missing the latest libraries. Note: The following options are not compatible when using FLB_STATIC_BINARY: - FLB_BACKTRACE - FLB_EXAMPLES - FLB_LUAJIT - FLB_SQLDB Signed-off-by: Bence Sztankovszky <[email protected]>
Thanks @nigels-com . Finally I found some time to check this issue. Maybe there won't be a solution for the Valgind report due to this: https://stackoverflow.com/questions/7506134/valgrind-errors-when-linked-with-static-why?rq=1 To summarize, these issues are coming from glibc. These issues are ignored by default by Valgrind when glibc is linked dynamically. In case of static linking it can't ignore these problem. I've been using this binary for a month with no problem anyway. Travis fails due to timeout. |
I'm trying to get this build using the docker image.. I'm getting: /usr/bin/ld: ../library/libfluent-bit.a(flb_plugin.c.o): in function How did you get your branch to build? |
Merge from upstream
@dmarkey, I have checked the issue, it's failing for me as well in Docker. Actually, I compile it on the host machine with the build tools installed. There's some difference between the linux distros and the package versions:
In the Docker image:
This could be one issue, I'll check it eventually (libsystemd is installed in the Docker image, so this shouldn't be the problem). Please note, that I had a chat with Eduardo Silva earlier this year about this change. He had some concerns about the legal aspects of this change. Static linking can raise some non-technical issues regarding the GPL licensing. I'm not a legal expert to judge this, so it can happen that this PR will never get merged. However, I'll leave this PR open, as it's a valid technical solution for a real problem - so if your use-case is GPL compliant then you can still use it. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
if anyone needs to build docker images with statically linked fluent-bit based on scratch or on distroless/static, I have an ugly patched branch of fluent-bit-docker-image at https://github.com/sambercovici/fluent-bit-docker-image. |
I'm doing automated fully-statically-linked multi-arch Docker images as well as making the bare binaries available (which is how I actually use it for my Alpine Linux ARM use case). My builds are available at https://github.com/brian-maloney/fluent-bit-static |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Enable compiling fluentd-bit static binary by using -DFLB_STATIC_BINARY cmake option
CMakeLists.txt extended with a new option
FLB_STATIC_BINARY
. This adds link-time compiler switches to have a statically linked binary.Example use:
Fixes #2561
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Documentation
I need guidance where to put the following extension to the documentation:
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.