Skip to content

workflows: add sanity check for toolchains w/ CXX support #9277

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ThomasDevoogdt
Copy link
Contributor

@ThomasDevoogdt ThomasDevoogdt commented Aug 25, 2024

Fluent-bit is written in C. There is no reason to have a CXX compiler. (Except for some libs which are all individually optional.) So add a check that enforces a C-only toolchain. E.g. useful for buildroot which does support platforms with only a C compiler.

Upstream status:

@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch from 06b1ed2 to 7cb18ea Compare August 25, 2024 18:37
@ThomasDevoogdt ThomasDevoogdt changed the title Feature/enforce no cxx support workflows: add sanity check for toolchains w/ CXX support Aug 25, 2024
@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch 3 times, most recently from ddf2522 to a3c1402 Compare August 25, 2024 20:21
@cosmo0920
Copy link
Contributor

Hi, we don't want to modify the vendored libraries by ourselves.
Instead, could you send you patch into librdkafka repo?
https://github.com/confluentinc/librdkafka

@ThomasDevoogdt
Copy link
Contributor Author

Hi, we don't want to modify the vendored libraries by ourselves. Instead, could you send you patch into librdkafka repo? https://github.com/confluentinc/librdkafka

Understand that, see my other PR/ remark #7765 (comment). There is an upstream PR: confluentinc/librdkafka#4366, but no reply in over a year.

@ThomasDevoogdt
Copy link
Contributor Author

Hi @cosmo0920, is it possible to re-evaluate this? I don't get an answer from upstream, but the changes are relevant IMHO. So I think that we should go forward with it. I know that changes exists that this issue wrt librdkafka gets re-introduced when syncing upstream, but the added workflows will tell us about this at that time.

@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch from d734a74 to 6c93936 Compare November 17, 2024 08:02
@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch from 6c93936 to 539bf0a Compare December 15, 2024 14:20
@ThomasDevoogdt
Copy link
Contributor Author

@edsiper It has been a while. Any chance that this gets approved? I try to reduce my own patch list.

@ThomasDevoogdt
Copy link
Contributor Author

@patrick-stephens @edsiper I see that 4.0.0 has landed, this is the ideal moment to consider this PR.

@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch 4 times, most recently from c56a9ce to dfc566c Compare April 1, 2025 21:02
@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch 5 times, most recently from f9fabe2 to e14abca Compare April 22, 2025 19:01
@patrick-stephens
Copy link
Contributor

I think we have to merge the changes into the upstream dependencies rather than make them here as it is not sustainable to keep patching them each time we update. Running a full build again of another target seems a little time consuming, can we push that into one of the existing unit tests or similar builds instead we're doing anyway?

@ThomasDevoogdt
Copy link
Contributor Author

I think we have to merge the changes into the upstream dependencies rather than make them here as it is not sustainable to keep patching them each time we update. Running a full build again of another target seems a little time consuming, can we push that into one of the existing unit tests or similar builds instead we're doing anyway?

Hi, I'm trying to upstream most of it. I will come back to this PR once done.

About having a separate build. I don't want to change existing builds, which are also compiling CXX features like simdutf.

@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch 2 times, most recently from f40c299 to a6c9ca9 Compare May 6, 2025 19:17
@ThomasDevoogdt ThomasDevoogdt requested a review from cosmo0920 May 6, 2025 19:22
@ThomasDevoogdt
Copy link
Contributor Author

ThomasDevoogdt commented May 6, 2025

@cosmo0920 @edsiper There is only one commit pending for upstream. So I don't really see the big deal to not consider this PR. Any possible regression will be catched by the workflow file. Also, librdkafka is not a fast moving library, so I don't think it will break anytime soon.

ThomasDevoogdt and others added 5 commits May 8, 2025 19:44
Commit richgel999/miniz@05ab4dc
"Add some catch2 tests" dropped that C flag, but should instead only have added a simple
enable_language call for the tests only.

Upstream: richgel999/miniz@383e551
Signed-off-by: Thomas Devoogdt <[email protected]>
Upstream: N/A
See 98dafef "build: luajit-cmake: add new luajit-cmake project"
which added luajit-cmake to simplify the build of LuaJIT.

Signed-off-by: Thomas Devoogdt <[email protected]>
Fluent-bit is written in C, so don't require CXX,
also not from the libs.

Signed-off-by: Thomas Devoogdt <[email protected]>
@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/enforce-no-cxx-support branch from a6c9ca9 to 7eb5065 Compare May 8, 2025 18:11
Copy link
Collaborator

@leonardo-albertovich leonardo-albertovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the modifications to the dependencies, this PR should only change the workflow file in order to be mergeable.

@ThomasDevoogdt
Copy link
Contributor Author

@leonardo-albertovich the workflow file won't pass the GH actions if the changes to the dependencies (I guess you mean the bundled libs) are not merged first. So not sure what exactly I have to do here. I guess it's not really allowed to add a workflow file which doesn't pass the tests.

@leonardo-albertovich
Copy link
Collaborator

Here's what I think we should do :

  1. Remove the changes to the dependencies from your PR
  2. Ensure that the dependency PRs are upstreamed
  3. Update the dependencies
  4. Rebase your PR on top of master
  5. Merge your PR

@ThomasDevoogdt
Copy link
Contributor Author

@leonardo-albertovich Ok, thanks for the clear explanation.

  1. Update the dependencies

I have a PR open for all the dependencies, can you help to merge them?:

I will then rebase this branch.

@leonardo-albertovich
Copy link
Collaborator

I don't know if @edsiper prefers to make the updates himself once the upstream PRs are merged or if he's ok with those PRs you've opened.

I take that the PRs you're opening when the upstream PRs are merged are complete updates and not just what you changed right? Otherwise they obviously wouldn't be viable.

@ThomasDevoogdt
Copy link
Contributor Author

I don't know if @edsiper prefers to make the updates himself once the upstream PRs are merged or if he's ok with those PRs you've opened.

Then I can wait for quite some time. Is it also requested to wait for the next upstream release tag?

I take that the PRs you're opening when the upstream PRs are merged are complete updates and not just what you changed right? Otherwise they obviously wouldn't be viable.

The changes I propose are quite minimal, I don't see why it can't be taken along as is. Otherwise, I don't see this branch merged in the first year. Also, the workflow file will anyway assert if things get out of sync.

@leonardo-albertovich
Copy link
Collaborator

That's up to @edsiper but please be mindful of the fact that even though fluent-bit might be a minor concern for you and you'll forget about it once you get your changes merged we will still be accountable for it so we want to ensure that things are done in a way that won't come back to bite us in the back in the future.

TBH I could've seen these dependency patches merged much faster if you implemented them as patches that are applied during the build process but you didn't seem to care so there's not much I can do to help you.

@ThomasDevoogdt
Copy link
Contributor Author

ThomasDevoogdt commented May 19, 2025

TBH I could've seen these dependency patches merged much faster if you implemented them as patches that are applied during the build process but you didn't seem to care so there's not much I can do to help you.

@leonardo-albertovich, is there such system in fluent-bit to apply patches in the build process? If yes, then I can for sure use that. Or do you expect that I create such patch system? It obviously would make sense to have that.

And about caring, I do care about compatibility, before I started the Buildroot integration, a dozen of compilation targets were failing due to all kind of reasons. E.g. Libc usage (uClibc, musl, glibc), Linux versions, Builder back-ends (make, ninja), toolchains (GCC versions, with/without C++ support), and so on. I'm thankful that you guys accepted most of my PRs, this PR and a few others are some left overs.

FYI, this the Buildroot package: https://github.com/buildroot/buildroot/tree/master/package/fluent-bit.

@leonardo-albertovich
Copy link
Collaborator

There is no such system in fluent-bit and I just had to tell someone else about it in issue #10139 because we might need to patch the CMakeLists.txt file in zstd due to a compatibility issue for which they've had a PR open for about 7 years already so if you want to give it a try let me know, otherwise if the user from that issue confirms that the proposed change fixes the problem I might have to do it myself.

I think I'd do it within cmake and try to figure out something that doesn't require third party tools or something minimal because that could be a problem considering the platforms we support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants