Skip to content

Allow crate-type=["staticlib","cdylib"] for [[bin]] #6351

Open
@retep998

Description

@retep998

Cargo currently enforces only one library crate per package which makes total sense for Rust libraries. However it doesn't make much sense for cdylibs or staticlibs which are not going to be consumed by downstream Rust dependencies. Requiring that only the library crate can be a cdylib or staticlib, and not binary crates, sometimes forces people into mixing lib and cdylib or staticlib and Rust currently produces suboptimal results when doing so. It also means people cannot produce multiple cdylibs or staticlibs from a single package.

I'd like to propose extending [[bin]] to allowcdylib and staticlib for the crate-type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crate-typesArea: crate-type declaration (lib, staticlib, dylib, cdylib, etc.)C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions