istio-ecosystem / authservice

Move OIDC token acquisition out of your app code and into the Istio mesh
Apache License 2.0
217 stars 63 forks source link

introduce clang CI and fix current link error #155

Closed Shikugawa closed 2 years ago

Shikugawa commented 3 years ago

After running make build with clang-10, we will see this link failure with messages as follows.

ERROR: /home/shikugawa/dev/authservice-test/src/main/BUILD:5:10: Linking of rule '//src/main:auth_server' failed (Exit 1): clang failed: error executing command /opt/llvm/bin/clang @bazel-out/k8-fastbuild/bin/src/main/auth_server-2.params

Use --sandbox_debug to see verbose messages from the sandbox clang failed: error executing command /opt/llvm/bin/clang @bazel-out/k8-fastbuild/bin/src/main/auth_server-2.params

Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-fastbuild/bin/external/boost/libboost_thread.a(thread.o):thread.cpp:function void boost::throw_exception<boost::bad_weak_ptr>(boost::bad_weak_ptr const&) [clone .isra.0]: error: relocation refers to global symbol "construction vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_weak_ptr> >-in-boost::wrapexcept<boost::bad_weak_ptr>", which is defined in a discarded section
  section group signature: "_ZTVN5boost10wrapexceptINS_12bad_weak_ptrEEE"
  prevailing definition is from bazel-out/k8-fastbuild/bin/src/common/http/_objs/http/http.pic.o
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
Target //src/main:auth_server failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 88.731s, Critical Path: 46.83s
INFO: 2194 processes: 9 internal, 2185 linux-sandbox.
FAILED: Build did NOT complete successfully

Fix this problem and introduce clang CI as current gcc.

incfly commented 2 years ago

Resolved as the --config=clang becomes an option.