Allow defining crate-type for dependencies?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
I'd like to easily manage a common collection of functionality for application plugins. I've tried doing this by linking all plugins to functionality in Cargo's target/deps folder, but as Cargo compiles all dependencies to rlibs, and Rust has issues linking plugins (dylibs) that are statically linked to common libraries, terrible thing happen. However, terrible things don't happen if plugin dependencies are also compiled as dylibs.
Unfortunately, the manifest guide states, for crate-type
"The available options are dylib, rlib, and staticlib. You should only use this option in a project. Cargo will always compile packages (dependencies) based on the requirements of the project that includes them."
This automation stops me from achieving the result needed. Some solutions:
- Have Cargo allow defining of crate-type for each dependency.
- Have Cargo allow defining of crate-type for all dependencies in the package.
- Write my own project-specific package manager from hell.
1 or 2 seem the most preferable options. Would one of these be suitable for the Cargo project?
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
Start with the manifest guide's crate-type section and the issue's description of how Cargo compiles dependencies as rlibs. Investigate how dependency crate types are selected and determine whether per-dependency or package-wide configuration is feasible. Done means Cargo supports the requested dylib dependency configuration for plugin use without breaking existing dependency builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100