This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 62a5f8766ce branch-4.0: [Fix](thirdparty) Unify arrow cpp standard
with be (#64390) (#66723)
62a5f8766ce is described below
commit 62a5f8766ceecc9f7784948878757ab1b74fbd5e
Author: HappenLee <[email protected]>
AuthorDate: Thu Aug 13 18:32:44 2026 +0800
branch-4.0: [Fix](thirdparty) Unify arrow cpp standard with be (#64390)
(#66723)
cherry-pick: https://github.com/apache/doris/pull/64390
This supersedes #64810. After #64810 was opened, #63266 was merged into
`branch-4.0` and added
`apache-arrow-17.0.0-status-inline-static-fix.patch`. As a result,
#64810 no longer contains the complete applicable diff from #64390: it
enables C++20 for Arrow but leaves the temporary Arrow Status patch in
place.
This backport is based on the latest `branch-4.0`. It enables C++20 for
thirdparty/Arrow and removes the temporary Arrow Status patch and its
application logic, matching the intent of #64390. The Paimon-cpp changes
are intentionally omitted because `branch-4.0` does not contain
Paimon-cpp.
Validation:
- `bash -n thirdparty/build-thirdparty.sh`
- `bash -n thirdparty/download-thirdparty.sh`
- `git diff --check apache/branch-4.0...HEAD`
Co-authored-by: linrrarity <[email protected]>
---
thirdparty/build-thirdparty.sh | 6 ++-
thirdparty/download-thirdparty.sh | 6 ---
...che-arrow-17.0.0-status-inline-static-fix.patch | 58 ----------------------
3 files changed, 5 insertions(+), 65 deletions(-)
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index abd7c62eaa7..a04516deb88 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}"
@@ -715,7 +717,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
@@ -1078,6 +1081,7 @@ build_arrow() {
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 \
diff --git a/thirdparty/download-thirdparty.sh
b/thirdparty/download-thirdparty.sh
index d5350ac9a30..62e94feea90 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -374,12 +374,6 @@ if [[ " ${TP_ARCHIVES[*]} " =~ " ARROW " ]]; then
if [[ "${ARROW_SOURCE}" == "arrow-apache-arrow-17.0.0" ]]; then
cd "${TP_SOURCE_DIR}/${ARROW_SOURCE}"
if [[ ! -f "${PATCHED_MARK}" ]]; then
- # 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"
-
# apache-arrow-17.0.0-force-write-int96-timestamps.patch :
# Introducing the parameter that forces writing int96 timestampes
for compatibility build branch-4.0.
patch -p1
<"${TP_PATCH_DIR}/apache-arrow-17.0.0-force-write-int96-timestamps.patch"
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);
- };
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]