Skip to content

Commit 62d2dd8

Browse files
authored
GH-50581: [C++][R] Use bundled simdjson for C++ wrapper builds (#50587)
### Rationale The R build may pick up a system-installed simdjson when `simdjson_SOURCE` is not explicitly set. This causes build failures in environments where the system version is incompatible or unsuitable for the build. ### What changes are included? This change defaults `simdjson_SOURCE` to `BUNDLED` when it is not already set, ensuring C++ wrapper builds invoked through `build_arrow_static.sh` use the bundled simdjson by default, while still allowing users to override it explicitly. This addresses the macOS CRAN release and ubuntu-r-only-r (AUTO deps) failures reported in GH-50581. Related: #50581 * GitHub Issue: #50581 Authored-by: Aaditya Srinivasan <[email protected]> Signed-off-by: Rok Mihevc <[email protected]>
1 parent 6efe7b3 commit 62d2dd8

4 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎.env‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ VCPKG="9b965a116838c6cdcd36bca60d1b81b030c8ab8d" # 2026.05.27 (not release, u
9898
# ci/docker/python-*-windows-*.dockerfile or the vcpkg config.
9999
# This is a workaround for our CI problem that "archery docker build" doesn't
100100
# use pulled built images in dev/tasks/python-wheels/github.windows.yml.
101-
PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2026-07-13
102-
PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION=2026-07-13
101+
PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2026-07-24
102+
PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION=2026-07-24

‎cpp/cmake_modules/ThirdpartyToolchain.cmake‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,15 @@ if(ARROW_AZURE)
410410
set(ARROW_WITH_AZURE_SDK ON)
411411
endif()
412412

413+
# The macOS 11.3 SDK has incomplete C++20 concepts support, which prevents
414+
# simdjson headers from compiling. Disable simdjson concepts for this SDK.
415+
if(ARROW_JSON
416+
AND CMAKE_OSX_SYSROOT
417+
AND CMAKE_OSX_SYSROOT MATCHES "MacOSX11\\.3\\.sdk$")
418+
message(STATUS "Disabling simdjson concepts for macOS SDK 11.3")
419+
add_compile_definitions(SIMDJSON_CONCEPT_DISABLED=1)
420+
endif()
421+
413422
if(ARROW_JSON OR ARROW_FLIGHT_SQL_ODBC)
414423
set(ARROW_WITH_RAPIDJSON ON)
415424
endif()
@@ -2827,7 +2836,7 @@ function(build_simdjson)
28272836
TRUE
28282837
PARENT_SCOPE)
28292838

2830-
list(APPEND ARROW_BUNDLED_STATIC_LIBS simdjson::simdjson)
2839+
list(APPEND ARROW_BUNDLED_STATIC_LIBS simdjson)
28312840
set(ARROW_BUNDLED_STATIC_LIBS
28322841
"${ARROW_BUNDLED_STATIC_LIBS}"
28332842
PARENT_SCOPE)
@@ -2844,6 +2853,11 @@ if(ARROW_WITH_SIMDJSON)
28442853
${ARROW_SIMDJSON_REQUIRED_VERSION}
28452854
IS_RUNTIME_DEPENDENCY
28462855
FALSE)
2856+
if(SIMDJSON_VENDORED)
2857+
add_library(arrow::simdjson ALIAS simdjson)
2858+
else()
2859+
add_library(arrow::simdjson ALIAS simdjson::simdjson)
2860+
endif()
28472861
endif()
28482862

28492863
function(build_rapidjson)

‎cpp/src/arrow/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ if(ARROW_JSON)
10441044
json/parser.cc
10451045
json/reader.cc)
10461046
foreach(ARROW_JSON_TARGET ${ARROW_JSON_TARGETS})
1047-
target_link_libraries(${ARROW_JSON_TARGET} PRIVATE RapidJSON simdjson::simdjson)
1047+
target_link_libraries(${ARROW_JSON_TARGET} PRIVATE RapidJSON arrow::simdjson)
10481048
endforeach()
10491049
else()
10501050
set(ARROW_JSON_TARGET_SHARED)

‎r/inst/build_arrow_static.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ ${CMAKE_WRAPPER} ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
107107
-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON \
108108
-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \
109109
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} \
110-
-Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \
111110
-Dabsl_SOURCE=${absl_SOURCE:-BUNDLED} \
111+
-Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \
112+
-Dsimdjson_SOURCE=${simdjson_SOURCE:-BUNDLED} \
112113
-Dxsimd_SOURCE=${xsimd_SOURCE:-} \
113114
-Dzstd_SOURCE=${zstd_SOURCE:-} \
114115
${EXTRA_CMAKE_FLAGS} \

0 commit comments

Comments
 (0)