Skip to content

cargo should avoid building things it doesn't need #4280

@glandium

Description

@glandium

Say you have crate A depending on crate B, and crate B has crate-type = ["staticlib", "rlib"].

You're building crate A, so, the only thing you really need is the rlib of crate B. But cargo still builds both the staticlib and the rlib.

As of now, at least for a combination of staticlib and rlib, it doesn't seem to be a problem, but in an hypothetical future where rust-lang/rust#43212 is implemented, it could make a significant difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-executionArea: anything dealing with executing the compilerA-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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions