Skip to content

Allow defining crate-type for dependencies? #629

Open
@ghost

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:

  1. Have Cargo allow defining of crate-type for each dependency.
  2. Have Cargo allow defining of crate-type for all dependencies in the package.
  3. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsA-crate-dependenciesArea: [dependencies] of any kindA-crate-typesArea: crate-type declaration (lib, staticlib, dylib, cdylib, etc.)A-linkageArea: linker issues, dylib, cdylib, shared libraries, soS-triageStatus: This issue is waiting on initial triage.Z-bindepsNightly: binary artifact dependencies

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions