Skip to content
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: use the system provided LuaJIT if found #7286

Merged

Conversation

ThomasDevoogdt
Copy link
Contributor

e.g. buildroot has logic to build luajit,
so if pkg_check_modules can find a suitable version, then use that one


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:

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • Backport to latest stable release.

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.

@patrick-stephens patrick-stephens added packaging ok-package-test Run PR packaging tests and removed docs-required labels Apr 28, 2023
@patrick-stephens patrick-stephens temporarily deployed to unstable April 28, 2023 09:44 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to unstable April 28, 2023 09:44 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:44 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:44 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr-package-test April 28, 2023 09:44 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr-package-test April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens temporarily deployed to pr April 28, 2023 09:45 — with GitHub Actions Inactive
@cosmo0920
Copy link
Contributor

cosmo0920 commented Jun 18, 2024

Currently, AppVeyor CI is unstable for uploading artefacts into the remote artifacts server. I'm also suffering this type of failures. Yes, we can ignore the failure of AppVeyor.

cosmo0920
cosmo0920 previously approved these changes Jun 18, 2024
Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

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

Then, looks good to me.

@rightblank
Copy link

Hi, @cosmo0920, I have tested this PR on s390x platform, it works well, will you please help to merge this PR?
#8903 (comment)

@ScarletTanager
Copy link

Hi @cosmo0920 , this PR is really important for us to leverage fluentbit on zLinux (s390x), as we make extensive use of Lua in our configurations.

/cc @edsiper @celalettin1286 @fujimotos @koleini @leonardo-albertovich @niedbalski @patrick-stephens @agup006

@cosmo0920
Copy link
Contributor

cosmo0920 commented Jul 4, 2024

Hi, any chance to add the following workflows in https://github.com/fluent/fluent-bit/blob/master/.github/workflows/pr-compile-check.yaml?

  # Sanity check for compilation using system libraries
  pr-compile-system-libs:
    runs-on: ubuntu-20.04
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        flb_option:
          - "-DFLB_PREFER_SYSTEM_LIBS=On"
        compiler:
          - gcc
          - clang
    steps:
      - name: Setup environment
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev libluajit-5.1-dev
          sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true

      - name: Checkout Fluent Bit code
        uses: actions/checkout@v4

      - name: ${{ matrix.compiler }} - ${{ matrix.flb_option }}
        run: |
          export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) ))
          echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
          sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
          sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
          sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
          cmake $GLOBAL_OPTS $FLB_OPT  ../
          make -j $nparallel
        working-directory: build
        env:
          CC: ${{ matrix.compiler }}
          CXX: ${{ matrix.compiler }}
          FLB_OPT: ${{ matrix.flb_option }}
          GLOBAL_OPTS: "-DFLB_BACKTRACE=Off -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"

      - name: Display dependencies w/ ldd
        run: |
          ldd ./bin/fluent-bit
        working-directory: build

This would be good to add to verify every time whether buildable or not with prefer system libs flag.

I tested the above workflow in my fluent-bit fork and works fine:

Run ldd ./bin/fluent-bit
	linux-vdso.so.1 (0x00007ffc[4](https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765#step:5:5)b1f1000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ffa7869c000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ffa78692000)
	libluajit-[5](https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765#step:5:6).1.so.2 => /lib/x86_64-linux-gnu/libluajit-5.1.so.2 (0x00007ffa78617000)
	libyaml-0.so.2 => /lib/x8[6](https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765#step:5:7)_64-linux-gnu/libyaml-0.so.2 (0x00007ffa785f5000)
	libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x0000[7](https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765#step:5:8)ffa78546000)
	libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007ffa784b3000)
	libcrypto.so.1.1 => /lib/x[8](https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765#step:5:9)6_64-linux-gnu/libcrypto.so.1.1 (0x00007ffa781da000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffa781be000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffa7806f000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffa7806[9](https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765#step:5:10)000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffa77e77000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ffa786d[10](https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765#step:5:11)00)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffa77e5c000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ffa77e31000)
	liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007ffa77e10000)
	libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007ffa77cf2000)
	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007ffa77ccf000)

ref: https://github.com/cosmo0920/fluent-bit/actions/runs/9788101299/job/27025620765

ThomasDevoogdt added a commit to ThomasDevoogdt/fluent-bit that referenced this pull request Jul 4, 2024
@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/system-provided-luajit branch from c9addec to 2bd4723 Compare July 4, 2024 13:57
@ThomasDevoogdt
Copy link
Contributor Author

Hi, any chance to add the following workflows in https://github.com/fluent/fluent-bit/blob/master/.github/workflows/pr-compile-check.yaml?

I've pushed a commit with your commit proposal.

e.g. buildroot has logic to build luajit,
so if pkg_check_modules can find a suitable version,
then use that one if -DFLB_PREFER_SYSTEM_LIB_LUAJIT=Yes.

Signed-off-by: Thomas Devoogdt <[email protected]>
@ThomasDevoogdt ThomasDevoogdt force-pushed the feature/system-provided-luajit branch from 2bd4723 to 8a46f99 Compare July 6, 2024 08:02
@ThomasDevoogdt
Copy link
Contributor Author

@cosmo0920 I've rebased the PR, the checks are now green again.

@rightblank
Copy link

rightblank commented Jul 8, 2024

Hi, @edsiper @cosmo0920, @patrick-stephens, is there any further blocker for merging this PR? If not, would you please help to merge it?

@ThomasDevoogdt
Copy link
Contributor Author

@cosmo0920, @patrick-stephens, is there any further blocker for merging this PR? If not, would you please help to merge it?

I guess it's @edsiper you have to ping.

@ThomasDevoogdt
Copy link
Contributor Author

@edsiper @cosmo0920 kind ping

@ThomasDevoogdt
Copy link
Contributor Author

@edsiper kind remember

@cosmo0920
Copy link
Contributor

@edsiper Can we include this PR in the v3.1.5 milestone?

@rightblank
Copy link

Hi, @ThomasDevoogdt, would you please help to merge ThomasDevoogdt#13 so that the feature in this PR can be enabled on the s390x architecture? Thanks!

@edsiper edsiper added this to the Fluent Bit v3.1.5 milestone Aug 7, 2024
@edsiper edsiper merged commit 7256406 into fluent:master Aug 7, 2024
69 checks passed
@edsiper
Copy link
Member

edsiper commented Aug 7, 2024

@ThomasDevoogdt thanks for the contribution!. Would you please submit a PR for fluent-bit-docs so we can reflect these new feature at build time ?

@rightblank
Copy link

Hi, @edsiper , would you please help to review #9172 which depends on this PR and further enable it on s390x?

ThomasDevoogdt added a commit to ThomasDevoogdt/buildroot that referenced this pull request Nov 16, 2024
News:

https://fluentbit.io/announcements/v3.2.0/
https://fluentbit.io/announcements/v3.1.10/
https://fluentbit.io/announcements/v3.1.9/
https://fluentbit.io/announcements/v3.1.8/
https://fluentbit.io/announcements/v3.1.7/
https://fluentbit.io/announcements/v3.1.6/
https://fluentbit.io/announcements/v3.1.5/
https://fluentbit.io/announcements/v3.1.4/

Support has been added for (some) system provided libraries,
see:
 - fluent/fluent-bit#7286
 - fluent/fluent-bit#8930

The c-ares and nghttp2 package are always needed, so use
the buildroot shipped versions. Also allow the usage of
libbacktrace and jemalloc.

A bunch of new compile fixes have been added,
all of them are proposed upstream for review.

Signed-off-by: Thomas Devoogdt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-package-test Run PR packaging tests packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants