This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 5f343f05f2 GH-48416: [Packaging][CI] Use custom orc_for_bundling when
using FetchContent to avoid ar issues with + symbol on path (#48430)
5f343f05f2 is described below
commit 5f343f05f29a2e99be82deb3019d6a23eb21315a
Author: Raúl Cumplido <[email protected]>
AuthorDate: Wed Dec 10 21:43:41 2025 +0100
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]>
---
cpp/cmake_modules/ThirdpartyToolchain.cmake | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 64adc8a060..c7c744e676 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -3856,7 +3856,24 @@ function(build_orc)
add_library(orc::orc INTERFACE IMPORTED)
target_link_libraries(orc::orc INTERFACE orc)
- list(APPEND ARROW_BUNDLED_STATIC_LIBS orc)
+ # ar -M rejects paths with "c++/" because "+" is a line continuation
+ # character in MRI scripts, so we have to create a copy of the static lib
+ # that we will bundle later (same issue as libgrpc++.a).
+ set(ORC_STATIC_LIBRARY_FOR_AR
+
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}orc_for_bundling${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ )
+ add_custom_command(OUTPUT ${ORC_STATIC_LIBRARY_FOR_AR}
+ COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:orc>
+ ${ORC_STATIC_LIBRARY_FOR_AR}
+ DEPENDS orc)
+ add_library(orc::orc_for_bundling STATIC IMPORTED)
+ set_target_properties(orc::orc_for_bundling PROPERTIES IMPORTED_LOCATION
+
"${ORC_STATIC_LIBRARY_FOR_AR}")
+ set_source_files_properties("${ORC_STATIC_LIBRARY_FOR_AR}" PROPERTIES
GENERATED TRUE)
+ add_custom_target(orc_copy_lib ALL DEPENDS "${ORC_STATIC_LIBRARY_FOR_AR}")
+ add_dependencies(orc::orc_for_bundling orc_copy_lib)
+
+ list(APPEND ARROW_BUNDLED_STATIC_LIBS orc::orc_for_bundling)
else()
set(ORC_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/orc_ep-install")
set(ORC_HOME "${ORC_PREFIX}")