fluent-bit icon indicating copy to clipboard operation
fluent-bit copied to clipboard

Luajit fails to link in arm64

Open leonardo-albertovich opened this issue 3 years ago • 3 comments

Bug Report

Fluent-bit fails to build the arm64 container image.

To Reproduce Run docker build --platform "linux/arm64" --target=production -f dockerfiles/Dockerfile .

Expected behavior Fluent-bit should build

Log snip

#24 10.10 AR        libluajit.a
#24 10.11 LINK      luajit
#24 10.13 /usr/bin/ld: libluajit.a(lj_str.o): in function `lj_str_new':
#24 10.13 lj_str.c:(.text+0x7d4): undefined reference to `lj_prng_u64'
#24 10.13 /usr/bin/ld: libluajit.a(lj_str.o): in function `lj_str_init':
#24 10.13 lj_str.c:(.text+0x9a4): undefined reference to `lj_prng_u64'
#24 10.13 /usr/bin/ld: libluajit.a(lj_debug.o): in function `lj_debug_getinfo':
#24 10.13 lj_debug.c:(.text+0x1144): undefined reference to `lj_tab_new'
#24 10.13 /usr/bin/ld: lj_debug.c:(.text+0x11f8): undefined reference to `lj_tab_setinth'
#24 10.13 /usr/bin/ld: libluajit.a(lj_state.o): in function `cpluaopen':
#24 10.13 lj_state.c:(.text+0x164): undefined reference to `lj_tab_new'
#24 10.13 /usr/bin/ld: lj_state.c:(.text+0x17c): undefined reference to `lj_tab_new'
#24 10.13 /usr/bin/ld: libluajit.a(lj_state.o): in function `lua_newstate':
#24 10.13 lj_state.c:(.text+0x4bc): undefined reference to `lj_prng_seed_secure'
#24 10.13 /usr/bin/ld: libluajit.a(lj_strfmt.o): in function `lj_strfmt_wstrnum':
#24 10.13 lj_strfmt.c:(.text+0x8f8): undefined reference to `lj_strfmt_putfnum'
#24 10.13 /usr/bin/ld: libluajit.a(lj_strfmt.o): in function `lj_strfmt_putnum':
#24 10.13 lj_strfmt.c:(.text+0xa24): undefined reference to `lj_strfmt_putfnum'
#24 10.13 /usr/bin/ld: libluajit.a(lj_strfmt.o): in function `lj_strfmt_number':
#24 10.13 lj_strfmt.c:(.text+0x1030): undefined reference to `lj_strfmt_num'
#24 10.13 /usr/bin/ld: libluajit.a(lj_strfmt.o): in function `lj_strfmt_putarg':
#24 10.13 lj_strfmt.c:(.text+0x12c8): undefined reference to `lj_strfmt_putfnum'
#24 10.13 /usr/bin/ld: libluajit.a(lj_strfmt.o): in function `lj_strfmt_pushvf':
#24 10.13 lj_strfmt.c:(.text+0x18dc): undefined reference to `lj_strfmt_putfnum'
#24 10.13 /usr/bin/ld: libluajit.a(lj_api.o): in function `lua_isnumber':
#24 10.13 lj_api.c:(.text+0x7f8): undefined reference to `lj_strscan_number'

Full log available at : https://gist.github.com/leonardo-albertovich/765d160a8c8ef8fec80f3cc90c6e7567

leonardo-albertovich avatar Sep 08 '22 07:09 leonardo-albertovich

A bit of trial and error seems to show the following:

  • last master build ok for containers and raspbian: https://github.com/fluent/fluent-bit/actions/runs/2977010687
    • https://github.com/fluent/fluent-bit/commit/b71a561cd2bf3cdc40335c0f4c701a5be070c8d3
  • master build fails: https://github.com/fluent/fluent-bit/actions/runs/2983366586
    • https://github.com/fluent/fluent-bit/commit/fd15da062257ad082e9840f6f0f84e9e69534cf4

https://github.com/fluent/fluent-bit/compare/b71a561cd2bf3cdc40335c0f4c701a5be070c8d3..fd15da062257ad082e9840f6f0f84e9e69534cf4

Looking at that the main introduction was WASM.

patrick-stephens avatar Sep 08 '22 14:09 patrick-stephens

I also tried to reproduce this issue but I couldn't for now.

  1. Clean up generated files during building process with git clean -fdx
  2. Update the latest revision with: git pull --rebase origin master
  3. Using fluen-bit rev: d3576ee3c55c209fc364b73b936e240236f733ae
  4. Execute docker build --platform "linux/arm64" --target=production -f dockerfiles/Dockerfile .

Then, suceeded to build linux/arm64 container on macBook Pro '14 (M1Pro):

[+] Building 71.7s (30/30) FINISHED                                                                                                    
 => [internal] load build definition from Dockerfile                                                                              0.0s
 => => transferring dockerfile: 8.07kB                                                                                            0.0s
 => [internal] load .dockerignore                                                                                                 0.0s
 => => transferring context: 101B                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim                                                           1.0s
 => [internal] load metadata for docker.io/multiarch/qemu-user-static:x86_64-arm                                                  1.0s
 => [internal] load metadata for gcr.io/distroless/cc-debian11:latest                                                             0.7s
 => [internal] load metadata for docker.io/multiarch/qemu-user-static:x86_64-aarch64                                              1.0s
 => [builder-base 1/7] FROM docker.io/library/debian:bullseye-slim@sha256:68c1f6bae105595d2ebec1589d9d476ba2939fdb11eaba1daec4ea  0.0s
 => [qemu-arm32 1/1] FROM docker.io/multiarch/qemu-user-static:x86_64-arm@sha256:18bba8fe5f7628f2280ff966bba642d0a9c672602badb4a  0.0s
 => [qemu-arm64 1/1] FROM docker.io/multiarch/qemu-user-static:x86_64-aarch64@sha256:d0f004609df6eb44b44b547f1e8a94711962bd18d7d  0.0s
 => [internal] load build context                                                                                                 4.8s
 => => transferring context: 162.51MB                                                                                             4.8s
 => [production 1/4] FROM gcr.io/distroless/cc-debian11@sha256:91b75baf2642f145c38d8c83153a46e5eca32be4777c51593bb533d9c1302c54   0.0s
 => CACHED [builder-base 2/7] COPY --from=qemu-arm32 /usr/bin/qemu-arm-static /usr/bin/                                           0.0s
 => CACHED [builder-base 3/7] COPY --from=qemu-arm64 /usr/bin/qemu-aarch64-static /usr/bin/                                       0.0s
 => CACHED [deb-extractor 4/6] WORKDIR /tmp                                                                                       0.0s
 => CACHED [deb-extractor 5/6] RUN apt-get update &&     apt-get download         libssl1.1         libsasl2-2         pkg-confi  0.0s
 => CACHED [deb-extractor 6/6] RUN find /dpkg/ -type d -empty -delete &&     rm -r /dpkg/usr/share/doc/                           0.0s
 => CACHED [production 2/4] COPY --from=deb-extractor /dpkg /                                                                     0.0s
 => CACHED [builder-base 4/7] RUN mkdir -p /fluent-bit/bin /fluent-bit/etc /fluent-bit/log                                        0.0s
 => CACHED [builder-base 5/7] RUN apt-get update &&     apt-get install -y --no-install-recommends     build-essential     curl   0.0s
 => CACHED [builder-base 6/7] WORKDIR /src/fluent-bit/                                                                            0.0s
 => [builder-base 7/7] COPY . ./                                                                                                  0.8s
 => [builder 1/6] WORKDIR /src/fluent-bit/build/                                                                                  0.0s
 => [builder 2/6] RUN cmake -DFLB_RELEASE=On           -DFLB_JEMALLOC=On           -DFLB_TLS=On           -DFLB_SHARED_LIB=Off    8.9s
 => [builder 3/6] RUN make -j "$(getconf _NPROCESSORS_ONLN)"                                                                     54.8s 
 => [builder 4/6] RUN install bin/fluent-bit /fluent-bit/bin/                                                                     0.4s 
 => [builder 5/6] COPY conf/fluent-bit.conf      conf/parsers.conf      conf/parsers_ambassador.conf      conf/parsers_java.conf  0.0s 
 => [builder 6/6] RUN /fluent-bit/bin/fluent-bit -J > /fluent-bit/etc/schema.json                                                 0.2s 
 => [production 3/4] COPY --from=builder /etc/ssl/certs /etc/ssl/certs                                                            0.0s 
 => [production 4/4] COPY --from=builder /fluent-bit /fluent-bit                                                                  0.1s 
 => exporting to image                                                                                                            0.1s 
 => => exporting layers                                                                                                           0.1s
 => => writing image sha256:0a2d8d3a79f6ce00ed660cf5a2e9c9568ea4e859502ff00749daf482607c2c9a                                      0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them

cosmo0920 avatar Sep 09 '22 08:09 cosmo0920

I can no longer reproduce locally on my Ubuntu 20.04 box but the last master nightly builds ran on the same OS with a failure in the container build: https://github.com/fluent/fluent-bit/runs/8264321335?check_suite_focus=true The failure has little information which usually means an issue in the parallel nature of make -j .... I wonder if it is a specific parallel amount and/or timing.

patrick-stephens avatar Sep 09 '22 09:09 patrick-stephens

I think we can close now, the nightly builds seem to have been ok for a while.

patrick-stephens avatar Oct 21 '22 13:10 patrick-stephens

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.

github-actions[bot] avatar Jan 20 '23 02:01 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jan 26 '23 02:01 github-actions[bot]