Skip to content

Commit 5f343f0

Browse files
authored
GH-48416: [Packaging][CI] Use custom orc_for_bundling when using FetchContent to avoid ar issues with + symbol on path (#48430)
### Rationale for this change The centos-9 jobs have started failing to bundled ORC when using FetchContent due to subfolder including the `+` symbol on path. This fails when bundling it with `ar`. ### What changes are included in this PR? Generate new `orc_for_bundling` library not under the `c++` directory and add that one to `ARROW_BUNDLED_STATIC_LIBS`. This is a similar approach we take for `grpc++` ### Are these changes tested? Yes, via CI ### Are there any user-facing changes? No, they shouldn't as this is just for adding it to the `libarrow_bundled` dependencies * GitHub Issue: #48416 Authored-by: Raúl Cumplido <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 912eec1 commit 5f343f0

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3856,7 +3856,24 @@ function(build_orc)
38563856
add_library(orc::orc INTERFACE IMPORTED)
38573857
target_link_libraries(orc::orc INTERFACE orc)
38583858

3859-
list(APPEND ARROW_BUNDLED_STATIC_LIBS orc)
3859+
# ar -M rejects paths with "c++/" because "+" is a line continuation
3860+
# character in MRI scripts, so we have to create a copy of the static lib
3861+
# that we will bundle later (same issue as libgrpc++.a).
3862+
set(ORC_STATIC_LIBRARY_FOR_AR
3863+
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}orc_for_bundling${CMAKE_STATIC_LIBRARY_SUFFIX}"
3864+
)
3865+
add_custom_command(OUTPUT ${ORC_STATIC_LIBRARY_FOR_AR}
3866+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:orc>
3867+
${ORC_STATIC_LIBRARY_FOR_AR}
3868+
DEPENDS orc)
3869+
add_library(orc::orc_for_bundling STATIC IMPORTED)
3870+
set_target_properties(orc::orc_for_bundling PROPERTIES IMPORTED_LOCATION
3871+
"${ORC_STATIC_LIBRARY_FOR_AR}")
3872+
set_source_files_properties("${ORC_STATIC_LIBRARY_FOR_AR}" PROPERTIES GENERATED TRUE)
3873+
add_custom_target(orc_copy_lib ALL DEPENDS "${ORC_STATIC_LIBRARY_FOR_AR}")
3874+
add_dependencies(orc::orc_for_bundling orc_copy_lib)
3875+
3876+
list(APPEND ARROW_BUNDLED_STATIC_LIBS orc::orc_for_bundling)
38603877
else()
38613878
set(ORC_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/orc_ep-install")
38623879
set(ORC_HOME "${ORC_PREFIX}")

0 commit comments

Comments
 (0)