Skip to content

Unnecessary dependencies for library use #105

@nazar-pc

Description

@nazar-pc

cargo-gpu right now is both a library and a binary.

When used as a library, some dependencies like env_logger and clap are pulled and compiled, but are not actually used.
It'd be nice to be able to use the library and not pull binary-only dependencies.

Unfortunately, right now Cargo doesn't support binary-only dependencies. The closest to that without splitting the crate might be to have a feature like binary that would add necessary dependencies and enabled by default, while library users could use default-features = false, here is an example of me doing the same in one of the crates: https://github.com/autonomys/subspace/blob/202d3abd67461fc6425e2e27303e46722e4b6397/crates/subspace-farmer/Cargo.toml#L14-L16

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions