Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow defining crate-type for dependencies? #629

Open
ghost opened this issue Sep 23, 2014 · 2 comments
Open

Allow defining crate-type for dependencies? #629

ghost opened this issue Sep 23, 2014 · 2 comments
Labels
A-configuration Area: cargo config files and env vars A-crate-dependencies Area: [dependencies] of any kind A-crate-types Area: crate-type declaration (lib, staticlib, dylib, cdylib, etc.) A-linkage Area: linker issues, dylib, cdylib, shared libraries, so S-triage Status: This issue is waiting on initial triage. Z-bindeps Nightly: binary artifact dependencies

Comments

@ghost
Copy link

ghost commented Sep 23, 2014

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?

@alexcrichton alexcrichton added the A-linkage Area: linker issues, dylib, cdylib, shared libraries, so label Oct 13, 2014
@alexcrichton alexcrichton added the A-configuration Area: cargo config files and env vars label Jan 14, 2015
@carols10cents carols10cents added the A-crate-dependencies Area: [dependencies] of any kind label May 9, 2017
@ehuss ehuss added the A-crate-types Area: crate-type declaration (lib, staticlib, dylib, cdylib, etc.) label Apr 6, 2020
@epage epage added the S-triage Status: This issue is waiting on initial triage. label May 3, 2023
@epage
Copy link
Contributor

epage commented May 24, 2023

@epage epage added the Z-metabuild Nightly: metabuild label Nov 22, 2024
@epage
Copy link
Contributor

epage commented Nov 22, 2024

Not fully sure of the request here but another potentially relevant feature is artifact dependencies which let the dependent to specify the crate type for the dependency. This doesn't override the crate types the dependency supports but chooses which one will be built.

@epage epage added Z-bindeps Nightly: binary artifact dependencies and removed Z-metabuild Nightly: metabuild labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-configuration Area: cargo config files and env vars A-crate-dependencies Area: [dependencies] of any kind A-crate-types Area: crate-type declaration (lib, staticlib, dylib, cdylib, etc.) A-linkage Area: linker issues, dylib, cdylib, shared libraries, so S-triage Status: This issue is waiting on initial triage. Z-bindeps Nightly: binary artifact dependencies
Projects
None yet
Development

No branches or pull requests

4 participants