proxy-wasm / proxy-wasm-cpp-host

WebAssembly for Proxies (C++ host implementation)
Apache License 2.0
84 stars 69 forks source link

fix: Bump Abseil to fix Linux build issues #400

Closed martijneken closed 3 months ago

martijneken commented 3 months ago

Pick up this fix: https://github.com/abseil/abseil-cpp/pull/1187

Bump to latest LTS version (past Envoy) to pick up another fix found in local fuzz tests: https://github.com/proxy-wasm/proxy-wasm-cpp-host/pull/399#issuecomment-2261871275

Build issue seen on:

$ /usr/lib/llvm-16/bin/clang --version
Debian clang version 16.0.6 (26)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-16/bin
PiotrSikora commented 3 months ago

Build issue seen on:

$ /usr/lib/llvm-16/bin/clang --version
Debian clang version 16.0.6 (26)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-16/bin

That's interesting, because it works fine on:

$ clang-16 --version
Debian clang version 16.0.6 (15~deb12u1)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

What's the invocation that's broken?

Note that abseil/abseil-cpp#1187 talks about GCC 13 and not Clang.

martijneken commented 3 months ago

What's the invocation that's broken?

$ bazelisk test --verbose_failures --define engine=null --config=clang -- //test/...
...
ERROR: /usr/local/google/home/mstevenson/.cache/bazel/_bazel_mstevenson/35e00757f2b858287fbaf6f5989ae0e8/external/com_google_absl/absl/strings/BUILD.bazel:1099:11: Compiling absl/strings/internal/str_format/float_conversion.cc fai
led: (Exit 1): clang failed: error executing command                                                                                                                                                                                  
  (cd /usr/local/google/home/mstevenson/.cache/bazel/_bazel_mstevenson/35e00757f2b858287fbaf6f5989ae0e8/sandbox/linux-sandbox/237/execroot/proxy_wasm_cpp_host && \                                                                   
  exec env - \                                                                                                                                                                                                                        
    BAZEL_COMPILER=clang \                                                                                                                                                                                                            
    CC=clang \                                                                                                                                                                                                                        
    CXX=clang++ \                                                                                                                                                                                                                     
    PATH=<...> \                        
    PWD=/proc/self/cwd \                                                                                                                                                                                                              
  /usr/lib/llvm-16/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -MD -MF bazel-out/k8
-fastbuild-ST-5c2a6e57c052/bin/external/com_google_absl/absl/strings/_objs/str_format_internal/float_conversion.pic.d '-frandom-seed=bazel-out/k8-fastbuild-ST-5c2a6e57c052/bin/external/com_google_absl/absl/strings/_objs/str_format
_internal/float_conversion.pic.o' -fPIC -iquote external/com_google_absl -iquote bazel-out/k8-fastbuild-ST-5c2a6e57c052/bin/external/com_google_absl -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION '-std=c++17' -Wall -Wextra -Wcast-qual
 -Wconversion -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wformat-security -Wgnu-redeclared-enum -Winfinite-recursion -Winvalid-constexpr -Wliteral-conversion -Wmissing-declarations -Woverlength-string
s -Wpointer-arith -Wself-assign -Wshadow-all -Wstring-conversion -Wtautological-overlap-compare -Wundef -Wuninitialized -Wunreachable-code -Wunused-comparison -Wunused-local-typedefs -Wunused-result -Wvla -Wwrite-strings -Wno-floa
t-conversion -Wno-implicit-float-conversion -Wno-implicit-int-float-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -DNOMINMAX -no-canonical-prefixes -Wno-builtin-macr
o-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_absl/absl/strings/internal/str_format/float_conversion.cc -o bazel-out/k8-fastbuild-ST-5c2a6e57c052/bin/external/com_g
oogle_absl/absl/strings/_objs/str_format_internal/float_conversion.pic.o)                                                                                                                                                             
# Configuration: f5c41261913aa58b27c39d480bafcec8c7dcbd34b432916aa8bb476b1c64edba                                                                                                                                                     
# Execution platform: @local_config_platform//:host                                                                                                                                                                                   
...
In file included from external/com_google_absl/absl/strings/internal/str_format/float_conversion.cc:15:
In file included from external/com_google_absl/absl/strings/internal/str_format/float_conversion.h:18:
external/com_google_absl/absl/strings/internal/str_format/extension.h:34:35: error: unknown type name 'uint8_t'
enum class FormatConversionChar : uint8_t;
                                  ^
external/com_google_absl/absl/strings/internal/str_format/extension.h:35:38: error: unknown type name 'uint64_t'
enum class FormatConversionCharSet : uint64_t;
                                     ^
external/com_google_absl/absl/strings/internal/str_format/extension.h:131:20: error: unknown type name 'uint8_t'
enum class Flags : uint8_t {
                   ^
PiotrSikora commented 3 months ago
$ bazelisk test --verbose_failures --define engine=null --config=clang -- //test/...
[...]
external/com_google_absl/absl/strings/internal/str_format/extension.h:131:20: error: unknown type name 'uint8_t'
enum class Flags : uint8_t {
                   ^

FWIW, it works here.

martijneken commented 3 months ago

FWIW, it works here.

Any interest in pursuing hermetic Bazel toolchains? (toolchains_llvm, hermetic_cc_toolchain)

PiotrSikora commented 3 months ago

Any interest in pursuing hermetic Bazel toolchains? (toolchains_llvm, hermetic_cc_toolchain)

Sure, I believe that @leonm1 signed up for that a while ago.