-
Notifications
You must be signed in to change notification settings - Fork 8.3k
libcxx 13 compatibility #32018
Description
Currently it's impossible to build ClickHouse with libcxx 13, which happens to be the standard library bundled with the recommended compiler. It's understood that you should use the provided one, but at some point that will be updated too so since I had some issues I decided to give it a try and see what break.
Tested with local libc++ (from llvm 13.0.0):
CC=clang CXX=clang++ cmake .. -DUSE_INTERNAL_LIBCXX_LIBRARY=False -DDISABLE_HERMETIC_BUILD=ON
The problems come from internal dependencies that are using result_of. This was deprecated in C++17, removed in C++20 and dropped from libc++ in v13.
-
Abseil
- Issue: type_traits.h uses std::result_of abseil/abseil-cpp#649
- Fixed in abseil/abseil-cpp@e19260f
- Available in 20211102.0
- ClickHouse-Extras/abseil-cpp uses lts_20202_02_25 with a patch and some backports. Both are unnecessary if switched to the upstram/lts_2021_03_24 branch. Switching the submodule to point to the official repo would be an option.
-
Arrow
- Issue ARROW-13444: [C++] Remove usage of deprecated std::result_of apache/arrow#10814
- Fixed in apache/arrow@4c02c6d
- Available in 6.0.0dev+
- Updating to upstream apache-arrow-6.0.1 works. Patches from ClickHouse-Extras: remove submodules and add Uri::host_and_port() which doesn't seem to be used anymore.
- Needs adapting the cmake file and some changes in the callers. I've done some changes but it seems to be missing some objects (complains about ipc).
-
Boost ASIO
- The library uses it's internal way of detecting what invoke method to use (asio/detail/config.hpp).
- Fixed in boostorg/asio@58050a2
- Available in boost-1.78.0.beta1 (no stable version released yet)
- Applying the patch (https://github.com/boostorg/asio/commit/58050a2036ad8e2d67b9ecfc9caa4eddec92fdac.patch) over the current ClickHouse-Extras fork fixes it.
-
Boost Fiber/Context/Config
- Uses Context with result_of because BOOST_NO_CXX17_STD_INVOKE is defined.
- BOOST_NO_CXX17_STD_INVOKE is defined in boost/config/stdlib/libcpp.hpp
- Fixed also some time ago (multiple changes)
- Replacing boost/config with current master one (all the files, not just libcpp.hpp) fixes the issue.
-
Boost format
- Different issue. This time with allocators
- Issue: Direct use of
Allocator::allocateis deprecated in C++17 boostorg/format#67 - Fixed in boostorg/format@5884c3d -> Boost 1.74.0+
- Applying the patch (https://github.com/boostorg/format/commit/5884c3d8140cdcd2d1bef374fcc216244d5faaa5.patch) works.
-
S2
- Uses it's own internal absl which has the same issue.
- Fixed pretty recently (Remove internal abseil google/s2geometry#169) by requiring an external abseil
- Should be updated and use the contrib/absl for building
- Haven't tested that it works, i've disabled it with
ENABLE_S2_GEOMETRY=OFFfor now.
IMO the actions points would be:
- Push
lts_2021_03_24branch to ClickHouse-Extras/abseil-cpp or change remote to upstream. - Push
apache-arrow-6.0.1branch to ClickHouse-Extras/arrow. Add a commit to remote submodules (if we want it). - Get arrow to link and work with 6.0.1. Should require only changes here.
- Update ClickHouse-Extras/s2 to a version with off tree abseil.
- Get S2 to build with contrib/abseil.
- Either update boost to a newer version (like 1.76 + ASIO patch) or apply all 3 patches individually.
I'll try to get this done locally as long as nobody says it shouldn't be done or something but, when it all works, I'll need help pushing new branches / patches into the submodules.