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

Failing to compile Fluent Bit with following options #2999

Closed
agup006 opened this issue Feb 1, 2021 · 4 comments · May be fixed by #3043
Closed

Failing to compile Fluent Bit with following options #2999

agup006 opened this issue Feb 1, 2021 · 4 comments · May be fixed by #3043
Labels

Comments

@agup006
Copy link
Member

agup006 commented Feb 1, 2021

cmake -DFLB_HTTP_SERVER=OFF -DFLB_IN_HTTP=OFF -DFLB_METRICS=OFF -DFLB_SHARED_LIB=OFF -DFLB_TLS=OFF -DFLB_OUT_TD=OFF ..
In file included from /home/anugup/fluent-bit/src/flb_help.c:24:
In file included from /home/anugup/fluent-bit/include/fluent-bit/flb_output.h:35:
In file included from /home/anugup/fluent-bit/include/fluent-bit/flb_io.h:29:
/home/anugup/fluent-bit/include/fluent-bit/flb_upstream.h:96:49: warning: declaration of 'struct flb_tls' will not be visible outside of this function [-Wvisibility]
                                         struct flb_tls *tls);
                                                ^
/home/anugup/fluent-bit/include/fluent-bit/flb_upstream.h:99:53: warning: declaration of 'struct flb_tls' will not be visible outside of this function [-Wvisibility]
                                             struct flb_tls *tls);
                                                    ^
/home/anugup/fluent-bit/src/flb_help.c:295:22: error: implicit declaration of function 'flb_tls_get_config_map' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        config_map = flb_tls_get_config_map(ins->config);
                     ^
/home/anugup/fluent-bit/src/flb_help.c:295:22: note: did you mean 'flb_upstream_get_config_map'?
/home/anugup/fluent-bit/include/fluent-bit/flb_upstream.h:107:17: note: 'flb_upstream_get_config_map' declared here
struct mk_list *flb_upstream_get_config_map(struct flb_config *config);
                ^
/home/anugup/fluent-bit/src/flb_help.c:295:20: warning: incompatible integer to pointer conversion assigning to 'struct mk_list *' from 'int' [-Wint-conversion]
        config_map = flb_tls_get_config_map(ins->config);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 1 error generated.
emcc: error: '/home/anugup/emsdk/upstream/bin/clang -DEMSCRIPTEN -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Xclang -iwithsysroot/include/SDL -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=13 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration --sysroot=/home/anugup/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DFLB_CORE=1 -DFLB_DUMP_STACKTRACE=1 -DFLB_HAVE_AWS -DFLB_HAVE_FORK -DFLB_HAVE_GMTOFF -DFLB_HAVE_LIBBACKTRACE -DFLB_HAVE_LUAJIT -DFLB_HAVE_PARSER -DFLB_HAVE_PROXY_GO -DFLB_HAVE_RECORD_ACCESSOR -DFLB_HAVE_REGEX -DFLB_HAVE_SIGNV4 -DFLB_HAVE_SQLDB -DFLB_HAVE_STREAM_PROCESSOR -DFLB_HAVE_TIMESPEC_GET -DFLB_HAVE_UTF8_ENCODER -DJSMN_PARENT_LINKS -DJSMN_STRICT -DPACKAGE_VERSION="" -I/home/anugup/fluent-bit/include -I/home/anugup/fluent-bit/lib -I/home/anugup/fluent-bit/lib/flb_libco -I/home/anugup/fluent-bit/lib/rbtree -I/home/anugup/fluent-bit/lib/msgpack-c/include -I/home/anugup/fluent-bit/lib/chunkio/include -I/home/anugup/fluent-bit/lib/luajit-2.1.0-1e66d0f/src -I/home/anugup/fluent-bit/lib/monkey/include -I/home/anugup/fluent-bit/lib/mbedtls-2.24.0/include -I/home/anugup/fluent-bit/lib/sqlite-amalgamation-3330000 -I/home/anugup/fluent-bit/lib/mpack-amalgamation-1.0/src -I/home/anugup/fluent-bit/lib/miniz -I/home/anugup/fluent-bit/lib/onigmo -I/home/anugup/fluent-bit/lib/xxHash-0.8.0 -I/home/anugup/fluent-bit/build/lib/jansson-fd3e9e3/include -I/home/anugup/fluent-bit/build/include -I/home/anugup/fluent-bit/lib/tutf8e/include -I/home/anugup/fluent-bit/build/backtrace-prefix/include -I/home/anugup/fluent-bit/lib/xxHash-0.8.0/cmake_unofficial/.. -I/home/anugup/fluent-bit/plugins/filter_geoip2/libmaxminddb/include -Wall -D__FILENAME__="src/flb_help.c" -g -fPIC -c /home/anugup/fluent-bit/src/flb_help.c -o CMakeFiles/fluent-bit-static.dir/flb_help.c.o' failed (1)
make[2]: *** [src/CMakeFiles/fluent-bit-static.dir/build.make:176: src/CMakeFiles/fluent-bit-static.dir/flb_help.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4944: src/CMakeFiles/fluent-bit-static.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
@yongtang
Copy link
Contributor

yongtang commented Feb 9, 2021

I took a look, the in additional to the above failures, with FLB_TLS=OFF, a lot of the plugins (especially cloud vendor plugins) will have to be disabled. Looks like many CMakeLists.txt are out-of-date. Will take a look and see if it is possible to fix.

@yongtang
Copy link
Contributor

yongtang commented Feb 9, 2021

Added a PR #3043 for the fix. With PR #3043 it should be possible to build with:

cmake -DFLB_HTTP_SERVER=OFF -DFLB_IN_HTTP=OFF -DFLB_METRICS=OFF -DFLB_SHARED_LIB=OFF -DFLB_TLS=OFF -DFLB_OUT_TD=OFF ..

yongtang added a commit to yongtang/fluent-bit that referenced this issue Feb 12, 2021
This commit changes `struct flb_tls *tls` to `void *tls`
at the api in flb_upstream_create_url. Since flb_upstream_create_url
is used both in tls and non-tls mode, it is not possible to
disable this fuction in non-tls build. Instead with the API change
it is possible to build with non-tls through `#if #else #fi` inside
the function.

This commit is part of the effort to address the issue
raised in fluent#2999 where it was not possible to disable TLS
to build fluent-bit.

Signed-off-by: Yong Tang <[email protected]>
yongtang added a commit to yongtang/fluent-bit that referenced this issue Feb 12, 2021
This commit updates flb_io.c and use FLB_HAVE_TLS
so that it is possible to build with tls and non-tls.

This commit is part of the effort to address the issue
raised in fluent#2999 where it was not possible to disable TLS
to build fluent-bit.

Signed-off-by: Yong Tang <[email protected]>
yongtang added a commit to yongtang/fluent-bit that referenced this issue Feb 12, 2021
This commit updates flb_http_client.h and use FLB_HAVE_TLS
so that it is possible to build with tls and non-tls.

SInce flb_http_client pretty much depends on TLS,
this commit use FLB_HAVE_TLS to exclude build in case
non-tls build is encountered.

This commit is part of the effort to address the issue
raised in fluent#2999 where it was not possible to disable TLS
to build fluent-bit.

Signed-off-by: Yong Tang <[email protected]>
yongtang added a commit to yongtang/fluent-bit that referenced this issue Feb 12, 2021
This commit updates flb_lib.c and use FLB_HAVE_TLS
so that it is possible to build with tls and non-tls.

This commit is part of the effort to address the issue
raised in fluent#2999 where it was not possible to disable TLS
to build fluent-bit.

Signed-off-by: Yong Tang <[email protected]>
yongtang added a commit to yongtang/fluent-bit that referenced this issue Feb 12, 2021
This commit updates flb_help.c and use FLB_HAVE_TLS
so that it is possible to build with tls and non-tls.

This commit is part of the effort to address the issue
raised in fluent#2999 where it was not possible to disable TLS
to build fluent-bit.

Signed-off-by: Yong Tang <[email protected]>
yongtang added a commit to yongtang/fluent-bit that referenced this issue Feb 12, 2021
This commit updates CMakeLists.txt so that it is possible
to build with TLS and non-TLS selectively.

This commit is part of the effort to address the issue
raised in fluent#2999 where it was not possible to disable TLS
to build fluent-bit.

Signed-off-by: Yong Tang <[email protected]>
@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 12, 2021
@github-actions
Copy link
Contributor

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

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

Successfully merging a pull request may close this issue.

2 participants