{"id":15346453,"url":"https://github.com/messense/lddtree-rs","last_synced_at":"2026-02-15T13:28:59.619Z","repository":{"id":45321945,"uuid":"435075954","full_name":"messense/lddtree-rs","owner":"messense","description":"Read the ELF dependency tree","archived":false,"fork":false,"pushed_at":"2024-11-30T02:53:27.000Z","size":95,"stargazers_count":33,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T07:07:58.458Z","etag":null,"topics":["auditwheel","elf","ldd"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/messense.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-05T04:49:26.000Z","updated_at":"2025-02-02T23:03:37.000Z","dependencies_parsed_at":"2024-01-07T16:38:44.626Z","dependency_job_id":"d1befce9-b64e-41d0-b174-2b3a8ac5adc8","html_url":"https://github.com/messense/lddtree-rs","commit_stats":{"total_commits":67,"total_committers":5,"mean_commits":13.4,"dds":0.05970149253731338,"last_synced_commit":"c1c5212b7d1b83daef65bcd45adce676060ed4ea"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Flddtree-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Flddtree-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Flddtree-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Flddtree-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/messense","download_url":"https://codeload.github.com/messense/lddtree-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305934,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auditwheel","elf","ldd"],"created_at":"2024-10-01T11:22:37.271Z","updated_at":"2026-02-15T13:28:59.614Z","avatar_url":"https://github.com/messense.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lddtree-rs\n\n[![CI](https://github.com/messense/lddtree-rs/workflows/CI/badge.svg)](https://github.com/messense/lddtree-rs/actions?query=workflow%3ACI)\n[![Crates.io](https://img.shields.io/crates/v/lddtree.svg)](https://crates.io/crates/lddtree)\n[![docs.rs](https://docs.rs/lddtree/badge.svg)](https://docs.rs/lddtree/)\n\nRead the dynamic library dependency tree. Supports **ELF** (Linux), **Mach-O** (macOS), and **PE** (Windows) binaries.\n\nThis does not work like `ldd` in that we do not execute/load code (only read files on disk).\nThe binary format is detected automatically from the file header.\n\nThis is roughly a Rust port of [lddtree.py](https://github.com/pypa/auditwheel/blob/main/src/auditwheel/lddtree.py)\nfrom [auditwheel](https://github.com/pypa/auditwheel), extended with Mach-O and PE support.\nIt's used in [maturin](https://github.com/PyO3/maturin) for automatic wheel repair on Linux, macOS, and Windows.\n\n## Features\n\n- **ELF**: rpath/runpath resolution, `LD_LIBRARY_PATH`, `ld.so.conf` parsing, sysroot support\n- **Mach-O**: `@rpath`, `@loader_path`, `@executable_path` resolution, `DYLD_LIBRARY_PATH`/`DYLD_FALLBACK_LIBRARY_PATH`, fat/universal binary support\n- **PE**: case-insensitive DLL lookup, API set DLL skipping (`api-ms-win-*`, `ext-ms-win-*`), Windows system directory search order, sysroot/Wine prefix support\n\n## Installation\n\nAdd it to your `Cargo.toml`:\n\n```toml\n[dependencies]\nlddtree = \"0.5\"\n```\n\n## Usage\n\n```rust,no_run\nuse lddtree::DependencyAnalyzer;\n\n// Analyze with default settings (root = \"/\")\nlet deps = DependencyAnalyzer::default()\n    .analyze(\"/usr/bin/python3\")\n    .unwrap();\n\nprintln!(\"Interpreter: {:?}\", deps.interpreter);\nprintln!(\"Direct dependencies: {:?}\", deps.needed);\nfor (name, lib) in \u0026deps.libraries {\n    println!(\"  {} =\u003e {} (found: {})\", name, lib.path.display(), lib.found());\n}\n```\n\n```rust,no_run\nuse lddtree::DependencyAnalyzer;\nuse std::path::PathBuf;\n\n// Analyze with a custom sysroot and additional library paths\nlet deps = DependencyAnalyzer::new(\"/path/to/sysroot\".into())\n    .library_paths(vec![PathBuf::from(\"/extra/lib\")])\n    .analyze(\"path/to/binary\")\n    .unwrap();\n```\n\n## Command line utility\n\nThere is also a simple CLI utility which can be installed via:\n\n```bash\ncargo install lddtree\n```\n\nUsage: `lddtree \u003cpathname\u003e [root]`\n\n- `pathname` is the path to a shared library or executable (ELF, Mach-O, or PE).\n- `root` is an optional path to a sysroot directory.\n\n## License\n\nThis work is released under the MIT license. A copy of the license is provided\nin the [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Flddtree-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmessense%2Flddtree-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Flddtree-rs/lists"}