Skip to content

[hakari] [feature-request] Support non-workspace crates #316

@RalfJung

Description

@RalfJung

I have a use for hakari (or something very much like it) in a non-workspace crate: some of my [dev-dependencies] cause features to be enable for crates that also appear (transitively) as regular [dependencies]. This means that even after I did cargo test, which builds the binary and test targets, if I now do cargo run that takes a minute because cargo re-builds the binary target with a different feature set for one of its dependencies. For a while I tried to manually add more [dependencies] to avoid this, but this regresses very easily (I never figured out a good way to have CI check this) and it's quite tedious to figure out what one has to add. So, would be great if hakari could automate that. :-)

However, right now when I try to enable hakari in my crate, that fails because there is no workspace:

Error: 
   0: for path /home/r/src/rust/miri/Cargo.toml, [workspace] section not found

Would it make sense to support hakari in a non-workspace setting as well? My plan was to add the "hack" crate as a path dependency to my main crate, which AFAIK should work fine even when there is no workspace.

EDIT: I have now found a different solution for Miri. But this could still be useful for someone else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions