Open colatkinson opened 1 year ago
hi, i am having the same issue, also on arch with protobuf
23.4 and abseil-cpp
20230125.3
The underlying issue seems to be that bloaty ships its own abseil LTS 20211102 while it happily accepts any system-provided protobuf. That means that such a protobuf has to be compatible with that abseil version so that anything newer than 21.12 does not work.
The AUR package for bloaty-git provides a patch that might be useful.
The issue appears to be coming from an incompatibility between the system-provided version of protobuf and the vendored version of abseil.
Modifying the CMake file to use the system abseil instead seems to fix the issue. I have attached a hacky proof-of-concept patch below.
For reference, the system-provided version of
protobuf
is 23.4, and the system-providedabseil-cpp
is 20230125.3. The bloaty commit I'm building is 2757d3ec0fec07f4ac7f2f96fe8f0b020c2d84fb (latestmain
as of this writing).Patch that fixes the build:
```diff diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a843b9..d90a548 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,7 +157,6 @@ endif() include_directories(.) include_directories(src) -include_directories(third_party/abseil-cpp) include_directories("${CMAKE_CURRENT_BINARY_DIR}/src") # Baseline build flags. @@ -244,27 +243,6 @@ add_library(libbloaty STATIC src/util.cc src/util.h src/webassembly.cc - # Until Abseil has a proper CMake build system - third_party/abseil-cpp/absl/base/internal/raw_logging.cc # Grrrr... - third_party/abseil-cpp/absl/base/internal/throw_delegate.cc - third_party/abseil-cpp/absl/debugging/internal/demangle.cc - third_party/abseil-cpp/absl/numeric/int128.cc - third_party/abseil-cpp/absl/strings/ascii.cc - third_party/abseil-cpp/absl/strings/charconv.cc - third_party/abseil-cpp/absl/strings/escaping.cc - third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc - third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc - third_party/abseil-cpp/absl/strings/internal/escaping.cc - third_party/abseil-cpp/absl/strings/internal/memutil.cc - third_party/abseil-cpp/absl/strings/internal/utf8.cc - third_party/abseil-cpp/absl/strings/match.cc - third_party/abseil-cpp/absl/strings/numbers.cc - third_party/abseil-cpp/absl/strings/str_cat.cc - third_party/abseil-cpp/absl/strings/string_view.cc - third_party/abseil-cpp/absl/strings/str_split.cc - third_party/abseil-cpp/absl/strings/substitute.cc - third_party/abseil-cpp/absl/types/bad_optional_access.cc - # One source file, no special build system needed. third_party/demumble/third_party/libcxxabi/cxa_demangle.cpp ) set_property(TARGET libbloaty PROPERTY FOLDER "bloaty") ```The errors are generally of the form
A complete build log is provided here: err-log.txt
For my 2¢ on a more complete fix: Arch does provide
pkg-config
files for abseil, so it should be possible to check for its presence as a system library that way. Alternatively, could just add aBLOATY_PREFER_SYSTEM_ABSL
flag, like in #352.Please let me know if any additional info would be helpful, or if this is a downstream bug of some kind.