From 9d92dbb2cb4cdb89982728e56f9fac34b7a77014 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 15 Oct 2025 17:08:48 -0400 Subject: [PATCH] cmake: BuildArrow.cmake uses bundled thrift if system version < 0.17 the bump to arrow 17.0.0 broke the ubuntu jammy builds with: In file included from /usr/include/thrift/transport/TTransport.h:25, from /usr/include/thrift/protocol/TProtocol.h:28, from /usr/include/thrift/TBase.h:24, from /build/ceph-20.3.0-3599-g3d863d32/src/arrow/cpp/src/generated/parquet_types.h:14, from /build/ceph-20.3.0-3599-g3d863d32/src/arrow/cpp/src/generated/parquet_constants.h:10, from /build/ceph-20.3.0-3599-g3d863d32/src/arrow/cpp/src/generated/parquet_constants.cpp:7: /usr/include/thrift/transport/TTransportException.h:23:10: fatal error: boost/numeric/conversion/cast.hpp: No such file or directory 23 | #include | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. when comparing the gcc command line with arrow-15.0.0, the following argument is no longer present: > -isystem /build/ceph-20.3.0-3402-gb2db4947/obj-x86_64-linux-gnu/boost/include arrow 17.0.0 seems to assume that thrift doesn't depend on boost anymore. a comment in https://github.com/apache/arrow/issues/32266 claims that > we don't need Boost with system Thrift 0.17.0 or later but our jammy builds are stuck with libthrift-0.16.0. to reenable jammy builds, instruct Arrow's cmake to use its bundled thrift dependency if our system thrift version is < 0.17.0 Signed-off-by: Casey Bodley --- cmake/modules/BuildArrow.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/modules/BuildArrow.cmake b/cmake/modules/BuildArrow.cmake index cadc2909fa4fd..f3bf1872931cb 100644 --- a/cmake/modules/BuildArrow.cmake +++ b/cmake/modules/BuildArrow.cmake @@ -16,7 +16,13 @@ function(build_arrow) list(APPEND arrow_CMAKE_ARGS -DARROW_JEMALLOC=OFF) # transitive dependencies - list(APPEND arrow_INTERFACE_LINK_LIBRARIES thrift) + if (thrift_VERSION VERSION_GREATER_EQUAL 0.17) + # build arrow with system thrift, and include the transitive dependency on the Arrow::Arrow target + list(APPEND arrow_INTERFACE_LINK_LIBRARIES thrift) + else() + # build arrow with bundled thrift to work around missing boost dependency + list(APPEND arrow_CMAKE_ARGS -DThrift_SOURCE=BUNDLED -DARROW_THRIFT_USE_SHARED=OFF) + endif() if (NOT WITH_SYSTEM_UTF8PROC) # forward utf8proc_ROOT from build_utf8proc() -- 2.39.5