This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new a281c9f0bce branch-4.1: [Fix](thirdparty) Unify arrow cpp standard 
with be (#64390) (#65213)
a281c9f0bce is described below

commit a281c9f0bce3b602b7776fc7de830a7955b5bd21
Author: linrrarity <[email protected]>
AuthorDate: Sat Jul 4 12:30:24 2026 +0800

    branch-4.1: [Fix](thirdparty) Unify arrow cpp standard with be (#64390) 
(#65213)
    
    cherry-pick: https://github.com/apache/doris/pull/64390
---
 thirdparty/build-thirdparty.sh                     |  7 ++-
 thirdparty/download-thirdparty.sh                  |  6 ---
 ...che-arrow-17.0.0-status-inline-static-fix.patch | 58 ----------------------
 .../paimon-cpp-buildutils-static-deps.patch        | 14 ++++++
 4 files changed, 20 insertions(+), 65 deletions(-)

diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index c8b4afdb6a1..e3fcd154aaf 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -33,6 +33,8 @@ set -eo pipefail
 
 curdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
 
+TP_CXX_STANDARD=20
+
 export DORIS_HOME="${curdir}/.."
 export TP_DIR="${curdir}"
 
@@ -723,7 +725,8 @@ build_re2() {
     cd "${TP_SOURCE_DIR}/${RE2_SOURCE}"
 
     "${CMAKE_CMD}" -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-        -DCMAKE_BUILD_TYPE=Release -G "${GENERATOR}" -DBUILD_SHARED_LIBS=0 
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+        -DCMAKE_BUILD_TYPE=Release \
+        -G "${GENERATOR}" -DBUILD_SHARED_LIBS=0 
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
         -DCMAKE_PREFIX_PATH="${TP_INSTALL_DIR}" 
-DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}"
     "${BUILD_SYSTEM}" -j "${PARALLEL}" install
     strip_lib libre2.a
@@ -1089,6 +1092,7 @@ build_arrow() {
         CXXFLAGS="-I${TP_INCLUDE_DIR}" \
         LDFLAGS="${ldflags}" \
         "${CMAKE_CMD}" -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
+        -DCMAKE_CXX_STANDARD="${TP_CXX_STANDARD}" \
         -G "${GENERATOR}" -DARROW_PARQUET=ON -DARROW_IPC=ON 
-DARROW_BUILD_SHARED=OFF \
         -DARROW_BUILD_STATIC=ON -DARROW_WITH_BROTLI=ON -DARROW_WITH_LZ4=ON 
-DARROW_USE_GLOG=ON \
         -DARROW_WITH_SNAPPY=ON -DARROW_WITH_ZLIB=ON -DARROW_WITH_ZSTD=ON 
-DARROW_JSON=ON \
@@ -2024,6 +2028,7 @@ build_paimon_cpp() {
     "${CMAKE_CMD}" -C "${TP_DIR}/paimon-cpp-cache.cmake" \
         -G "${GENERATOR}" \
         -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
+        -DCMAKE_CXX_STANDARD="${TP_CXX_STANDARD}" \
         -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" \
         -DPAIMON_BUILD_SHARED=OFF \
         -DPAIMON_BUILD_STATIC=ON \
diff --git a/thirdparty/download-thirdparty.sh 
b/thirdparty/download-thirdparty.sh
index feb94de4bdd..d72b19399d1 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -449,12 +449,6 @@ if [[ " ${TP_ARCHIVES[*]} " =~ " ARROW " ]]; then
             # Introducing the parameter that forces writing int96 timestampes 
for compatibility with Paimon cpp. 
             patch -p1 
<"${TP_PATCH_DIR}/apache-arrow-17.0.0-force-write-int96-timestamps.patch"
 
-            # apache-arrow-17.0.0-status-inline-static-fix.patch :
-            # Move Status::message()/detail() empty sentinels out of header
-            # inline function-local statics. Clang can place those weak inline
-            # std::string objects in RELRO, then crash while initializing them.
-            patch -p1 
<"${TP_PATCH_DIR}/apache-arrow-17.0.0-status-inline-static-fix.patch"
-
             # Add Parquet LZO page decompression support used by file scanner 
v2.
             patch -p1 <"${TP_PATCH_DIR}/apache-arrow-17.0.0-lzo.patch"
             touch "${PATCHED_MARK}"
diff --git 
a/thirdparty/patches/apache-arrow-17.0.0-status-inline-static-fix.patch 
b/thirdparty/patches/apache-arrow-17.0.0-status-inline-static-fix.patch
deleted file mode 100644
index 2a1ed534077..00000000000
--- a/thirdparty/patches/apache-arrow-17.0.0-status-inline-static-fix.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/cpp/src/arrow/status.cc b/cpp/src/arrow/status.cc
-index a9581cadc9..1b7ee7df62 100644
---- a/cpp/src/arrow/status.cc
-+++ b/cpp/src/arrow/status.cc
-@@ -17,6 +17,17 @@
- 
- namespace arrow {
- 
-+const std::string& Status::NoMessage() {
-+  static const std::string* no_message = new std::string();
-+  return *no_message;
-+}
-+
-+const std::shared_ptr<StatusDetail>& Status::NoDetail() {
-+  static const std::shared_ptr<StatusDetail>* no_detail =
-+      new std::shared_ptr<StatusDetail>();
-+  return *no_detail;
-+}
-+
- Status::Status(StatusCode code, const std::string& msg)
-     : Status::Status(code, msg, nullptr) {}
- 
-diff --git a/cpp/src/arrow/status.h b/cpp/src/arrow/status.h
-index 983b61629d..a49a982922 100644
---- a/cpp/src/arrow/status.h
-+++ b/cpp/src/arrow/status.h
-@@ -330,14 +330,18 @@ class ARROW_EXPORT [[nodiscard]] Status : public 
util::EqualityComparable<Status
- 
-   /// \brief Return the specific error message attached to this status.
-   const std::string& message() const {
--    static const std::string no_message = "";
--    return ok() ? no_message : state_->msg;
-+    if (ARROW_PREDICT_FALSE(state_ != NULLPTR)) {
-+      return state_->msg;
-+    }
-+    return NoMessage();
-   }
- 
-   /// \brief Return the status detail attached to this message.
-   const std::shared_ptr<StatusDetail>& detail() const {
--    static std::shared_ptr<StatusDetail> no_detail = NULLPTR;
--    return state_ ? state_->detail : no_detail;
-+    if (ARROW_PREDICT_FALSE(state_ != NULLPTR)) {
-+      return state_->detail;
-+    }
-+    return NoDetail();
-   }
- 
-   const void* debug_state_addr() const { return state_; }
-@@ -396,6 +400,8 @@ class ARROW_EXPORT [[nodiscard]] Status : public 
util::EqualityComparable<Status
-     delete state_;
-     state_ = NULLPTR;
-   }
-+  static const std::string& NoMessage();
-+  static const std::shared_ptr<StatusDetail>& NoDetail();
-   void CopyFrom(const Status& s);
-   inline void MoveFrom(Status& s);
- };
diff --git a/thirdparty/patches/paimon-cpp-buildutils-static-deps.patch 
b/thirdparty/patches/paimon-cpp-buildutils-static-deps.patch
index 31af1db7f0f..fc1fe155312 100644
--- a/thirdparty/patches/paimon-cpp-buildutils-static-deps.patch
+++ b/thirdparty/patches/paimon-cpp-buildutils-static-deps.patch
@@ -25,6 +25,20 @@ index 74654a4..4065297 100644
          if(_paimon_objlib_deps)
              add_dependencies(${LIB_NAME}_objlib ${_paimon_objlib_deps})
 
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 57f6c50..d8e3cd0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,6 +38,8 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPERCASE_BUILD_TYPE)
+ 
+-set(CMAKE_CXX_STANDARD 17)
++if(NOT DEFINED CMAKE_CXX_STANDARD)
++    set(CMAKE_CXX_STANDARD 17)
++endif()
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ set(CMAKE_CXX_EXTENSIONS OFF)
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
 diff --git a/cmake_modules/ThirdpartyToolchain.cmake 
b/cmake_modules/ThirdpartyToolchain.cmake
 --- a/cmake_modules/ThirdpartyToolchain.cmake
 +++ b/cmake_modules/ThirdpartyToolchain.cmake


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to