Skip to content

Commit

Permalink
GH-38697: [C++][Gandiva] Use arrow io util to replace std::filesystem…
Browse files Browse the repository at this point in the history
…::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 <niyue.com@gmail.com>
Co-authored-by: Yue <niyue.com@gmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
3 people committed Nov 15, 2023
1 parent dfdebdd commit 41e45fe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cpp/src/gandiva/tests/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@

#include "gandiva/tests/test_util.h"

#include <filesystem>
#include "arrow/util/io_util.h"
#include "arrow/util/logging.h"

namespace gandiva {
std::shared_ptr<Configuration> TestConfiguration() {
auto builder = ConfigurationBuilder();
return builder.DefaultConfiguration();
return ConfigurationBuilder::DefaultConfiguration();
}

#ifndef GANDIVA_EXTENSION_TEST_DIR
#define GANDIVA_EXTENSION_TEST_DIR "."
#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() {
Expand Down

0 comments on commit 41e45fe

Please sign in to comment.