From 5acf67c48c3a1e73c6bebae32f299e09721dd1ad Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 9 Jan 2024 04:26:23 +0100 Subject: [PATCH] GH-39517: [C++] Disable parallelism for jemalloc external project (#39522) ### Rationale for this change With CMake > 3.28 the generated Makefile fails on the jemalloc_ep due to 'bad file descriptor'. ### What changes are included in this PR? For a sequential build for jemalloc by setting -j1. ### Are these changes tested? CI ### Are there any user-facing changes? No. * Closes: #39517 Authored-by: Jacob Wujciak-Jens Signed-off-by: Jacob Wujciak-Jens --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 3f327ed64ff00..a2627c190f738 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2040,10 +2040,17 @@ macro(build_jemalloc) # Enable jemalloc debug checks when Arrow itself has debugging enabled list(APPEND JEMALLOC_CONFIGURE_COMMAND "--enable-debug") endif() + set(JEMALLOC_BUILD_COMMAND ${MAKE} ${MAKE_BUILD_ARGS}) + # Paralleism for Make fails with CMake > 3.28 see #39517 + if(${CMAKE_GENERATOR} MATCHES "Makefiles") + list(APPEND JEMALLOC_BUILD_COMMAND "-j1") + endif() + if(CMAKE_OSX_SYSROOT) list(APPEND JEMALLOC_BUILD_COMMAND "SDKROOT=${CMAKE_OSX_SYSROOT}") endif() + externalproject_add(jemalloc_ep ${EP_COMMON_OPTIONS} URL ${JEMALLOC_SOURCE_URL}