GH-50581: [C++][R] Use bundled simdjson for C++ wrapper builds#50587
GH-50581: [C++][R] Use bundled simdjson for C++ wrapper builds#50587Reranko05 wants to merge 4 commits into
Conversation
|
|
|
@github-actions crossbow submit -g r |
|
Revision: 9864597 Submitted crossbow builds: ursacomputing/crossbow @ actions-357652d8fe |
|
@kou It looks like the remaining failures are related to the ongoing simdjson version discussion. If we go with requiring simdjson 4.0+ and falling back to the bundled version when the system package is too old, I think that should address this issue. |
|
I don't think this is isolated to R, e.g. see windows python nightly failure and you can check other nightlies. |
|
Could you try this? diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 1677b188b9..dc8629669f 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -2828,7 +2828,7 @@ function(build_simdjson)
TRUE
PARENT_SCOPE)
- list(APPEND ARROW_BUNDLED_STATIC_LIBS simdjson::simdjson)
+ list(APPEND ARROW_BUNDLED_STATIC_LIBS simdjson)
set(ARROW_BUNDLED_STATIC_LIBS
"${ARROW_BUNDLED_STATIC_LIBS}"
PARENT_SCOPE)
@@ -2845,6 +2845,11 @@ if(ARROW_WITH_SIMDJSON)
${ARROW_SIMDJSON_REQUIRED_VERSION}
IS_RUNTIME_DEPENDENCY
FALSE)
+ if(SIMDJSON_VENDORED)
+ add_library(arrow::simdjson ALIAS simdjson)
+ else()
+ add_library(arrow::simdjson ALIAS simdjson::simdjson)
+ endif()
endif()
function(build_rapidjson)
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index e792574a18..0b21fec605 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -1044,7 +1044,7 @@ if(ARROW_JSON)
json/parser.cc
json/reader.cc)
foreach(ARROW_JSON_TARGET ${ARROW_JSON_TARGETS})
- target_link_libraries(${ARROW_JSON_TARGET} PRIVATE RapidJSON simdjson::simdjson)
+ target_link_libraries(${ARROW_JSON_TARGET} PRIVATE RapidJSON arrow::simdjson)
endforeach()
else()
set(ARROW_JSON_TARGET_SHARED)This will fix the following case: |
|
@github-actions crossbow submit -g r |
|
|
@github-actions crossbow submit -g r |
This comment was marked as outdated.
This comment was marked as outdated.
|
@kou I suspect the remaining Crossbow failures may be related to changes in the JsonWriter PR that haven't been merged yet (for example, it adds |
|
test-r-macos-as-cran: It seems that we can't build simdjson with AppleClang 21: https://github.com/ursacomputing/crossbow/actions/runs/29981142927/job/89122965972#step:9:56 |
|
test-r-depsource-system: https://github.com/ursacomputing/crossbow/actions/runs/29981142748/job/89122965384#step:7:361 It seems that Could you try this? diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh
index e7f453bb64..8c8d9d6b95 100755
--- a/r/inst/build_arrow_static.sh
+++ b/r/inst/build_arrow_static.sh
@@ -107,8 +107,9 @@ ${CMAKE_WRAPPER} ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON \
-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} \
- -Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \
-Dabsl_SOURCE=${absl_SOURCE:-BUNDLED} \
+ -Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \
+ -Dsimdjson_SOURCE=${simdjson_SOURCE:-} \
-Dxsimd_SOURCE=${xsimd_SOURCE:-} \
-Dzstd_SOURCE=${zstd_SOURCE:-} \
${EXTRA_CMAKE_FLAGS} \ |
|
It seems that r-recheck-most failures are unrelated. |
| -Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \ | ||
| -Dabsl_SOURCE=${absl_SOURCE:-BUNDLED} \ | ||
| -Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \ | ||
| -Dsimdjson_SOURCE=${simdjson_SOURCE:-} \ |
There was a problem hiding this comment.
@kou should we accept this and remove the change in r/tootls/nixlibs.R?
rok
left a comment
There was a problem hiding this comment.
This looks good!
As this touches the all the cpp wrappers we should also adjust issue and PR title/text.
| -Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \ | ||
| -Dabsl_SOURCE=${absl_SOURCE:-BUNDLED} \ | ||
| -Dre2_SOURCE=${re2_SOURCE:-BUNDLED} \ | ||
| -Dsimdjson_SOURCE=${simdjson_SOURCE:-} \ |
There was a problem hiding this comment.
@kou should we accept this and remove the change in r/tootls/nixlibs.R?
|
@rok Updated PR title and description. |
|
@github-actions crossbow submit -g r |
|
Revision: b265939 Submitted crossbow builds: ursacomputing/crossbow @ actions-aa46ed246c |
|
Can we disable |
|
@kou I tried implementing the workaround by forcibly disabling I used Does this look like the right approach, or did you have something else in mind? |
5841739 to
06732bd
Compare
@kou can you run this again? |
| set(ARROW_WITH_AZURE_SDK ON) | ||
| endif() | ||
|
|
||
| if(APPLE |
There was a problem hiding this comment.
APPLE is redundant. AppleClang is available only on Apple.
| if(APPLE | ||
| AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" | ||
| AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "22") |
There was a problem hiding this comment.
Could you check this only when ARROW_JSON=ON?
| if(APPLE | |
| AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" | |
| AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "22") | |
| if(ARROW_JSON | |
| AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" | |
| AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "22") |
| set(ARROW_JSON | ||
| OFF | ||
| CACHE BOOL "" FORCE) |
There was a problem hiding this comment.
We can treat ARROW_JSON as a normal variable.
| set(ARROW_JSON | |
| OFF | |
| CACHE BOOL "" FORCE) | |
| set(ARROW_JSON OFF) |
Rationale
The R build may pick up a system-installed simdjson when
simdjson_SOURCEis 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_SOURCEtoBUNDLEDwhen it is not already set, ensuring C++ wrapper builds invoked throughbuild_arrow_static.shuse 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