Skip to content

BUG: libhdfs3 not getting picked up correctly when using conda #15019

@h-vetinari

Description

@h-vetinari

Describe the bug, including details regarding any error messages, version, and platform.

#14832 switched on the test suite within the conda-builds, which itself synced with conda-forge/arrow-cpp-feedstock#875

In the process of doing so, I removed

# doesn't get picked up correctly
# - libhdfs3

because the tests always showed: SKIPPED [24] test_hdfs.py:48: No libhdfs available on system

Even with a patch as follows:

diff --git a/cpp/src/arrow/io/hdfs_internal.cc b/cpp/src/arrow/io/hdfs_internal.cc
index 4592392b8..9f8f70389 100644
--- a/cpp/src/arrow/io/hdfs_internal.cc
+++ b/cpp/src/arrow/io/hdfs_internal.cc
@@ -144,9 +144,9 @@ Result<std::vector<PlatformFilename>> get_potential_libhdfs_paths() {
 #ifdef _WIN32
   file_name = "hdfs.dll";
 #elif __APPLE__
-  file_name = "libhdfs.dylib";
+  file_name = "libhdfs3.dylib";
 #else
-  file_name = "libhdfs.so";
+  file_name = "libhdfs3.so";
 #endif

   // Common paths
@@ -155,6 +155,8 @@ Result<std::vector<PlatformFilename>> get_potential_libhdfs_paths() {
   // Path from environment variable
   AppendEnvVarFilename("HADOOP_HOME", "lib/native", &search_paths);
   AppendEnvVarFilename("ARROW_LIBHDFS_DIR", &search_paths);
+  AppendEnvVarFilename("CONDA_PREFIX", "lib", &search_paths);
+  AppendEnvVarFilename("LIBRARY_LIB", &search_paths);

   // All paths with file name
   for (const auto& path : search_paths) {

this remained the case. I thought this might be necessary because in the conda-forge world, the name of the libhdfs binary contains the "3", but there seem to be other issues at play here as well.

To fix this issue, the line quoted above should be uncommented, and the conda tests should not show SKIPPED [24] test_hdfs.py:48: No libhdfs available on system anymore (at least on unix).

Component(s)

C++, Continuous Integration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions