bazelbuild / bazelbuild/rules_rust

Add functionality to use dependency features in bazel

Open
#3,851 1 comment 0 reactions 0 assignees View on GitHub
awaiting-response
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

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"]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.