-
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
flb_lib: allow public-API use without dependencies via fluent-bit-minimal.h #8248
base: master
Are you sure you want to change the base?
Conversation
Test OutputOutput of the modified unit test:
Snippet from running
Verified hello_world.c still compiles and runs:
|
PackagingI assume this counts as a change to packages, since there is a new additional file, but I couldn't get the packaging script to run.
|
DocumentationAssuming the change is accepted, the documentation at https://docs.fluentbit.io/manual/development/ingest-records-manually should be updated to refer to Back-portingCurrently, libfluent-bit.so is not usable for compilation on any platform (afaik), due to the missing headers. It wouldn't hurt to back-port these header changes to past versions, if that would help it get into package repositories where a past version is considered stable. That would allow people to compile new software using libfluent-bit.so on those platforms. However, since it hasn't been possible so far, there probably isn't much demand for that. |
…imal.h Currently, fluent-bit.h and flb_lib.h are un-usable by third-parties becuase the fluent-bit build process does not install all of the required header files for fluent-bit's dependencies into the Debian packages. Skipping that problem for the moment, I'm proposing that users of the public API don't actually need or want all the headers required for the interenals of fluent-bit, and there should just be a simple header that declares the public API. This new header sets a preprocessor variable and then includes the normal flb_lib.h, which defines the public API. flb_lib.h sees the preprocessor variable and skips loading any of the dependency headers, instead just declaring the referenced types without defining them. This is an improvement over [an earlier version I proposed][1] where fluent-bit-minimal.h re-defined all the exported symbols of the public API. This new mechanism avoids code duplication and the need to maintain two headers in tandem. [1]: fluent#7165 Signed-off-by: Michael Conrad <[email protected]>
…mal.h To verify that fluent-bit-minimal.h works, I updated one of the existing unit tests to use it. Many more unit tests could be switched, or a new unit test entirely could be added, but this seemed like the simplest solution for testing. I also updated the examples to use the new header, since this is what third party users will be looking at first. Signed-off-by: Michael Conrad <[email protected]>
9016ad8
to
5d0e4a0
Compare
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. |
I'd still appreciate it if this got merged. |
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. |
Anyone able to review this yet? |
I'd still appreciate it if this work didn't go to waste. |
Currently, fluent-bit.h and flb_lib.h are un-usable by third-parties
becuase the fluent-bit build process does not install all of the
required header files for fluent-bit's dependencies into the Debian
packages. Skipping that problem for the moment, I'm proposing that
users of the public API don't actually need or want all the headers
required for the interenals of fluent-bit, and there should just be
a simple header that declares the public API.
This new header sets a preprocessor variable and then includes the
normal flb_lib.h, which defines the public API. flb_lib.h sees the
preprocessor variable and skips loading any of the dependency
headers, instead just declaring the referenced types without
defining them.
To verify that fluent-bit-minimal.h works, I updated one of the
existing unit tests to use it. Many more unit tests could be
switched, or a new unit test entirely could be added, but this
seemed like the simplest solution for testing.
I also updated the examples to use the new header, since this
is what third party users will be looking at first.
Fixes #7165
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:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
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.