]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: BuildArrow.cmake uses bundled thrift if system version < 0.17 65970/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 15 Oct 2025 21:08:48 +0000 (17:08 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 15 Oct 2025 21:08:55 +0000 (17:08 -0400)
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 <boost/numeric/conversion/cast.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 <cbodley@redhat.com>
cmake/modules/BuildArrow.cmake

index cadc2909fa4fdb99b353d854829b60291c313c1d..f3bf1872931cb1039caf938f7e0a5e8be940dd76 100644 (file)
@@ -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()