Add cargo:rustc-dynamic-link-search for setting LD_LIBRARY_PATH during cargo run/cargo test
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Currently when building we tell cargo where to find static and shared libraries with cargo:rustc-link-search.
However, if you call cargo run or cargo test, while it will still compile, it won't run because LD_LIBRARY_PATH or DYLD_LIBRARY_PATH need to be set. If crates could explicitly emit dylib search paths with cargo:rustc-dynamic-link-search then we could print a list of them at the end of compilation (the same way we do for staticlibs, something like "run this with LD_LIBRARY_PATH=foo:bar:baz"), and if folks use cargo run or cargo test we can run those with this appended to the dynamic lib path
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named in the issue. Start by tracing how cargo:rustc-link-search is handled and how cargo run and cargo test launch binaries; done means crates can emit dynamic library search paths and those paths are applied or reported for the relevant platform.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100