From 41e45fed07a6466b1f8e9437220c9bf49c4a8cb3 Mon Sep 17 00:00:00 2001 From: Yue Date: Thu, 16 Nov 2023 00:22:36 +0800 Subject: [PATCH] GH-38697: [C++][Gandiva] Use arrow io util to replace std::filesystem::path in gandiva (#38698) ### Rationale for this change AlmaLinux 8 CI reported linker failure when `std::filesystem::path` is used, and This PR tries to it. ### What changes are included in this PR? Replace replace `std::filesystem::path` in gandiva with arrow's internal io util so that AlmaLinux 8 CI build can work. ### Are these changes tested? It should be covered by existing tests and CI. ### Are there any user-facing changes? No * Closes: #38697 Lead-authored-by: Yue Ni Co-authored-by: Yue Co-authored-by: Antoine Pitrou Co-authored-by: Antoine Pitrou Signed-off-by: Antoine Pitrou --- cpp/src/gandiva/tests/test_util.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cpp/src/gandiva/tests/test_util.cc b/cpp/src/gandiva/tests/test_util.cc index 42f67d3824a21..4a0a15c7223db 100644 --- a/cpp/src/gandiva/tests/test_util.cc +++ b/cpp/src/gandiva/tests/test_util.cc @@ -17,12 +17,12 @@ #include "gandiva/tests/test_util.h" -#include +#include "arrow/util/io_util.h" +#include "arrow/util/logging.h" namespace gandiva { std::shared_ptr TestConfiguration() { - auto builder = ConfigurationBuilder(); - return builder.DefaultConfiguration(); + return ConfigurationBuilder::DefaultConfiguration(); } #ifndef GANDIVA_EXTENSION_TEST_DIR @@ -30,9 +30,10 @@ std::shared_ptr TestConfiguration() { #endif std::string GetTestFunctionLLVMIRPath() { - std::filesystem::path base(GANDIVA_EXTENSION_TEST_DIR); - std::filesystem::path ir_file = base / "multiply_by_two.bc"; - return ir_file.string(); + const auto base = + arrow::internal::PlatformFilename::FromString(GANDIVA_EXTENSION_TEST_DIR); + DCHECK_OK(base.status()); + return base->Join("multiply_by_two.bc")->ToString(); } NativeFunction GetTestExternalFunction() {