Regression in running tests with custom library search path
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Steps to reproduce:
- Make a crate that links to a native library which is not in system path. The crate's build script adds the library's path using
cargo:rustc-link-search=native=. - Make a test in the crate and run it using
cargo test.
cargo 0.17 (shipped with rust 1.16.0) successfully runs the test because it adds the library path to LD_LIBRARY_PATH (on Linux).
But cargo 0.18 (shipped with rust 1.17.0) fails to run the test:
Running
[path]/[test_name]-f25c1f4d7cd45ca4 --nocapture
[path]/[test_name]-f25c1f4d7cd45ca4: error while loading shared libraries: libctrt1.so: cannot open shared object file: No such file or directory
It doesn't add the library path to LD_LIBRARY_PATH anymore. The binary is linked successfully because cargo probably still supplies the path to the linker, but it's not enough to run the binary.
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
Reproduce the regression with a crate whose build script uses cargo:rustc-link-search=native= and a test run through cargo test. Compare the cargo 0.17 and 0.18 test-running environment, focusing on whether LD_LIBRARY_PATH includes the native library path; done means the test binary can load libctrt1.so again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100