bazelbuild / bazelbuild/rules_rust

How to control features in crate_universe for all crates?

Open
#2,817 1 comment 0 reactions 0 assignees View on GitHub
crate-universe needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

This one is a challenge and probably has some additional neuances

Lets say we have a `crate.spec` like so:

```python
"reqwest": crate.spec(
version = "=0.12.*",
default_features = False,
features = [
"blocking",
"json",
"rustls-tls",
"gzip",
"brotli",
"deflate",
],
),
```

A developer later adds a dependency that depends (potentially indirectly) on `reqwest` say `rustify`.

`rustify` pulls in `reqwest` with `default_features` (or conflicting features)

We then end up with a dependency graph like so:

![2024-08-28-111423_1567x813_scrot](https://github.com/user-attachments/assets/bc3969d3-b572-463f-9b00-40a2e0891ffe)

which is problematic given that is not what was specified in the deps, and seems to be counter to what cargo.toml does

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.