MCPcopy Create free account
hub / github.com/apache/datafusion / find_cdylib

Function find_cdylib

datafusion/ffi/src/tests/utils.rs:48–72  ·  view source on GitHub ↗

Find the cdylib file for datafusion_ffi in the given directory.

(deps_dir: &Path)

Source from the content-addressed store, hash-verified

46
47/// Find the cdylib file for datafusion_ffi in the given directory.
48fn find_cdylib(deps_dir: &Path) -> Result<PathBuf> {
49 let lib_prefix = if cfg!(target_os = "windows") {
50 ""
51 } else {
52 "lib"
53 };
54 let lib_ext = if cfg!(target_os = "macos") {
55 "dylib"
56 } else if cfg!(target_os = "windows") {
57 "dll"
58 } else {
59 "so"
60 };
61
62 let pattern = format!("{lib_prefix}datafusion_ffi.{lib_ext}");
63 let lib_path = deps_dir.join(&pattern);
64
65 if lib_path.exists() {
66 return Ok(lib_path);
67 }
68
69 Err(DataFusionError::External(
70 format!("Could not find library at {}", lib_path.display()).into(),
71 ))
72}
73
74pub fn get_module() -> Result<ForeignLibraryModule> {
75 let expected_version = crate::version();

Callers 1

get_moduleFunction · 0.85

Calls 3

existsMethod · 0.80
joinMethod · 0.45
intoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…