Skip to content

[fix](build) Fix Boost sigtimedwait compile error on macOS#61285

Merged
airborne12 merged 1 commit intoapache:masterfrom
airborne12:fix-boost-mac-sigtimedwait
Mar 13, 2026
Merged

[fix](build) Fix Boost sigtimedwait compile error on macOS#61285
airborne12 merged 1 commit intoapache:masterfrom
airborne12:fix-boost-mac-sigtimedwait

Conversation

@airborne12
Copy link
Member

@airborne12 airborne12 commented Mar 12, 2026

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.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • Verified BE compiles successfully on macOS (Apple Silicon) after applying the patch.
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

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 when boost/process.hpp is
included (newly introduced by Python UDF feature apache#59543).

Add a patch to exclude __APPLE__ from the sigtimedwait detection macro,
so Boost falls back to its fork-based wait_for_exit implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Thearas
Copy link
Contributor

Thearas commented Mar 12, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@airborne12
Copy link
Member Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 27853 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 0f09923f9f87ad845f4d339b28a9027ef63311f6, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17665	4470	4288	4288
q2	q3	10637	846	513	513
q4	4696	365	249	249
q5	7693	1221	1030	1030
q6	179	182	146	146
q7	817	841	674	674
q8	10190	1519	1321	1321
q9	5753	4919	4797	4797
q10	6338	1919	1664	1664
q11	467	261	256	256
q12	740	569	456	456
q13	18076	2940	2200	2200
q14	238	238	218	218
q15	950	807	807	807
q16	773	716	717	716
q17	748	869	413	413
q18	5953	5284	5252	5252
q19	1294	1026	627	627
q20	505	508	403	403
q21	4794	1992	1562	1562
q22	381	320	261	261
Total cold run time: 98887 ms
Total hot run time: 27853 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4826	4628	4707	4628
q2	q3	3877	4311	3860	3860
q4	875	1197	812	812
q5	4099	4523	4364	4364
q6	181	178	137	137
q7	1775	1642	1538	1538
q8	2514	2735	2560	2560
q9	7489	7488	7503	7488
q10	3747	3952	3639	3639
q11	500	434	418	418
q12	507	585	489	489
q13	2833	3341	2342	2342
q14	280	296	287	287
q15	857	835	838	835
q16	750	765	721	721
q17	1176	1497	1392	1392
q18	7179	6798	6569	6569
q19	904	857	920	857
q20	2085	2176	2027	2027
q21	3991	3515	3374	3374
q22	447	421	379	379
Total cold run time: 50892 ms
Total hot run time: 48716 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 153544 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 0f09923f9f87ad845f4d339b28a9027ef63311f6, data reload: false

query5	4332	643	521	521
query6	337	227	208	208
query7	4217	469	268	268
query8	342	240	225	225
query9	8699	2697	2683	2683
query10	506	400	343	343
query11	7406	5906	5603	5603
query12	180	130	124	124
query13	1254	442	377	377
query14	6194	3857	3582	3582
query14_1	2802	2819	2825	2819
query15	196	191	174	174
query16	1001	470	459	459
query17	1106	693	582	582
query18	2523	449	344	344
query19	208	201	176	176
query20	137	129	126	126
query21	226	136	123	123
query22	4848	4854	4711	4711
query23	15938	15589	15401	15401
query23_1	15425	16238	15924	15924
query24	9449	1722	1309	1309
query24_1	1281	1312	1311	1311
query25	621	491	440	440
query26	1373	288	171	171
query27	3250	547	379	379
query28	5728	1946	1930	1930
query29	862	626	494	494
query30	321	262	228	228
query31	1432	1402	1270	1270
query32	90	82	90	82
query33	516	328	293	293
query34	924	930	579	579
query35	643	685	616	616
query36	1076	1162	983	983
query37	132	96	85	85
query38	2942	2967	2884	2884
query39	889	897	860	860
query39_1	823	808	863	808
query40	230	157	138	138
query41	62	59	58	58
query42	304	313	303	303
query43	240	249	220	220
query44	
query45	193	199	187	187
query46	904	998	621	621
query47	2112	2161	2061	2061
query48	316	317	235	235
query49	630	481	372	372
query50	691	280	213	213
query51	4129	4114	4037	4037
query52	299	298	280	280
query53	295	345	293	293
query54	301	279	265	265
query55	103	86	84	84
query56	326	337	330	330
query57	1396	1352	1279	1279
query58	293	278	292	278
query59	1361	1465	1288	1288
query60	346	330	319	319
query61	161	145	150	145
query62	641	587	528	528
query63	314	274	273	273
query64	4958	1326	1091	1091
query65	
query66	1445	476	374	374
query67	16361	16474	16268	16268
query68	
query69	403	328	291	291
query70	954	981	982	981
query71	346	311	314	311
query72	2975	2862	2663	2663
query73	548	559	336	336
query74	10011	10013	9829	9829
query75	2864	2749	2454	2454
query76	2278	1032	664	664
query77	366	380	301	301
query78	11157	11278	10658	10658
query79	2663	808	622	622
query80	1781	624	535	535
query81	571	282	245	245
query82	1030	152	121	121
query83	330	279	252	252
query84	250	129	102	102
query85	902	520	443	443
query86	422	342	293	293
query87	3160	3130	2982	2982
query88	3751	2680	2658	2658
query89	430	372	354	354
query90	1995	187	176	176
query91	171	163	138	138
query92	78	78	71	71
query93	1187	847	503	503
query94	649	345	335	335
query95	626	344	330	330
query96	643	532	231	231
query97	2454	2529	2415	2415
query98	237	222	220	220
query99	998	997	905	905
Total cold run time: 239814 ms
Total hot run time: 153544 ms

@airborne12
Copy link
Member Author

run check_coverage

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 13, 2026
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@airborne12 airborne12 merged commit 675f5e8 into apache:master Mar 13, 2026
30 of 32 checks passed
@airborne12 airborne12 deleted the fix-boost-mac-sigtimedwait branch March 13, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants