Skip to content

Add functionality to use dependency features in bazel #3851

@MarcelGep

Description

@MarcelGep

Currently, I haven't found a way to use dependency features in Bazel like in Cargo.

So far, I've only been able to do it by recreating the entire Cargo dependency tree in Bazel (creating a separate Rust target for each feature of a crate). If i have many dependencies with many features this can increase exponentially and thus become unclear.

This is the part within cargo:

# Features of dependencies can also be enabled in the [features] table. The syntax is "package-name/feature-name". For example:

[dependencies]
jpeg-decoder = { version = "0.1.20", default-features = false }

[features]
# Enables parallel processing support by enabling the "rayon" feature of jpeg-decoder.
parallel = ["jpeg-decoder/rayon"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-responseMaintainers have responded to the pull-request or thread and now await contributor responses.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions