rust-lang / rust-lang/cargo

Doc-tests and `dylib` dependency

Open
#4,449 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug Command-test S-triage
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

I have a crate with dylib dependency. cargo test --lib works perfectly, but cargo test gives an error "can't find crate" for that dynamic crate. Is there any workaround?

I'm not sure that this issue is related to cargo, sorry if it is the wrong place.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported difference between cargo test --lib and cargo test using a crate with a dylib dependency, then inspect Cargo's doctest and dependency-handling entry points. Done means the dynamic dependency no longer causes the reported "can't find crate" error, or the supported workaround is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.