Skip to content

Missing crate features when Cargo.toml specifies default-features = false #2262

@pamaury

Description

@pamaury

Whenever a crate specified in Cargo.toml specifies a feature flag AND default-features = false, rules_rust generates a rust_library with no features instead of the required features. This can cause crates to no compile. An example of such a crate is indexmap that depends on hashbrown and specifies

[dependencies.hashbrown]
version = "0.12"
default-features = false
features = ["raw"]

Despite this, the rust_library generated in BUILD.hashbrown-0.12.3.bazel has no feature enabled.

I have a minimal reproduction of the problem here using rules_rust 0.30.0.

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