Skip to content

Commit efb62f1

Browse files
authored
GH-47695: [CI][Release] Link arrow-io hdfs_test to c++fs on compilers where std:::filesystem is not default present (#47701)
### Rationale for this change Currently our verify-rc on almalinux 8 fails due to missing symbols for `std::filesystem`. If we use `std::filesystem`, we need `-lstdc++fs` with GCC 8 and `-lc++fs` for clang 7. ### What changes are included in this PR? Link the test to `-lc++fs` for the required compilers. ### Are these changes tested? Yes, via archery ### Are there any user-facing changes? No * GitHub Issue: #47695 Authored-by: Raúl Cumplido <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 4b55ea6 commit efb62f1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cpp/src/arrow/io/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,22 @@ add_arrow_test(compressed_test PREFIX "arrow-io")
2323
add_arrow_test(file_test PREFIX "arrow-io")
2424

2525
if(ARROW_HDFS)
26+
set(HDFS_TEST_EXTRA_LINK_LIBS arrow::hadoop)
27+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
28+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9")
29+
list(APPEND HDFS_TEST_EXTRA_LINK_LIBS stdc++fs)
30+
endif()
31+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
32+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8")
33+
list(APPEND HDFS_TEST_EXTRA_LINK_LIBS c++fs)
34+
endif()
35+
endif()
2636
add_arrow_test(hdfs_test
2737
NO_VALGRIND
2838
PREFIX
2939
"arrow-io"
3040
EXTRA_LINK_LIBS
31-
arrow::hadoop)
41+
${HDFS_TEST_EXTRA_LINK_LIBS})
3242
endif()
3343

3444
add_arrow_test(memory_test PREFIX "arrow-io")

0 commit comments

Comments
 (0)