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

Function compute_library_dir

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

Compute the path to the built cdylib. Checks debug, release, and ci profile dirs.

(target_path: &Path)

Source from the content-addressed store, hash-verified

23
24/// Compute the path to the built cdylib. Checks debug, release, and ci profile dirs.
25fn compute_library_dir(target_path: &Path) -> PathBuf {
26 let debug_dir = target_path.join("debug");
27 let release_dir = target_path.join("release");
28 let ci_dir = target_path.join("ci");
29
30 let all_dirs = vec![debug_dir.clone(), release_dir, ci_dir];
31
32 all_dirs
33 .into_iter()
34 .filter(|dir| dir.join("deps").exists())
35 .filter_map(|dir| {
36 dir.join("deps")
37 .metadata()
38 .and_then(|m| m.modified())
39 .ok()
40 .map(|date| (dir, date))
41 })
42 .max_by_key(|(_, date)| *date)
43 .map(|(dir, _)| dir)
44 .unwrap_or(debug_dir)
45}
46
47/// Find the cdylib file for datafusion_ffi in the given directory.
48fn find_cdylib(deps_dir: &Path) -> Result<PathBuf> {

Callers 1

get_moduleFunction · 0.85

Calls 6

existsMethod · 0.80
joinMethod · 0.45
mapMethod · 0.45
filterMethod · 0.45
into_iterMethod · 0.45
metadataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…