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

airborne pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 675f5e89dae [fix](build) Fix Boost sigtimedwait compile error on macOS 
(#61285)
675f5e89dae is described below

commit 675f5e89daec691776575979f2e5cde50aee7ce2
Author: Jack <[email protected]>
AuthorDate: Fri Mar 13 09:27:06 2026 +0800

    [fix](build) Fix Boost sigtimedwait compile error on macOS (#61285)
    
    ### What problem does this PR solve?
    
    Issue Number: N/A
    
    Related PR: N/A
    
    Problem Summary:
    
    macOS does not implement `sigtimedwait` despite declaring
    `_POSIX_C_SOURCE >= 199309L`. Boost 1.81's `config.hpp` incorrectly
    enables `BOOST_POSIX_HAS_SIGTIMEDWAIT` on macOS, causing compile
    failures in `boost/process/detail/posix/wait_for_exit.hpp`.
    
    This issue was newly exposed by the Python UDF feature (#59543), which
    introduced the first usage of `boost/process.hpp` in the BE codebase via
    the include chain:
    `aggregate_function_python_udaf.cpp → python_udaf_client.h →
    python_client.h → python_udf_runtime.h → boost/process.hpp`
    
    This PR adds a thirdparty patch to exclude `__APPLE__` from the
    sigtimedwait detection macro, so Boost falls back to its fork-based
    `wait_for_exit` implementation. The patch is only applied on Darwin and
    does not affect Linux builds.
---
 thirdparty/download-thirdparty.sh                      | 13 +++++++++++++
 thirdparty/patches/boost-1.81.0-mac-sigtimedwait.patch | 11 +++++++++++
 2 files changed, 24 insertions(+)

diff --git a/thirdparty/download-thirdparty.sh 
b/thirdparty/download-thirdparty.sh
index d913c389ee0..f57cab9de1a 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -723,4 +723,17 @@ if [[ " ${TP_ARCHIVES[*]} " =~ " CCTZ " ]] ; then
     echo "Finished patching ${CCTZ_SOURCE}"
 fi
 
+# boost patch to fix sigtimedwait not available on macOS
+if [[ " ${TP_ARCHIVES[*]} " =~ " BOOST " ]]; then
+    cd "${TP_SOURCE_DIR}/${BOOST_SOURCE}"
+    if [[ ! -f "${PATCHED_MARK}" ]]; then
+        if [[ "$(uname -s)" == "Darwin" ]]; then
+            patch -p1 <"${TP_PATCH_DIR}/boost-1.81.0-mac-sigtimedwait.patch"
+        fi
+        touch "${PATCHED_MARK}"
+    fi
+    cd -
+    echo "Finished patching ${BOOST_SOURCE}"
+fi
+
 # vim: ts=4 sw=4 ts=4 tw=100:
diff --git a/thirdparty/patches/boost-1.81.0-mac-sigtimedwait.patch 
b/thirdparty/patches/boost-1.81.0-mac-sigtimedwait.patch
new file mode 100644
index 00000000000..2ed60aee165
--- /dev/null
+++ b/thirdparty/patches/boost-1.81.0-mac-sigtimedwait.patch
@@ -0,0 +1,11 @@
+--- a/boost/process/detail/config.hpp
++++ b/boost/process/detail/config.hpp
+@@ -57,7 +57,7 @@
+ #define BOOST_POSIX_HAS_VFORK 1
+ #endif
+
+-#if (_POSIX_C_SOURCE >= 199309L)
++#if (_POSIX_C_SOURCE >= 199309L) && !defined(__APPLE__)
+ #define BOOST_POSIX_HAS_SIGTIMEDWAIT 1
+ #endif
+


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

Reply via email to