bazelbuild / bazelbuild/rules_rust

Update `crates_vendor` to write any crate `spec` and `annotation` used

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

Description

This would allow external consumers of workspaces that use `crates_vendor` to be programmatically consume the same dependencies.

Concretely, the snippet:

```starlark
crates_vendor(
name = "crates_vendor",
packages = {
"rand": crate.spec(
version = "1",
),
},
annotations = {
"rand": [crate.annotation(
default_features = False,
features = ["small_rng"],
)],
},
mode = "remote",
vendor_path = "crates",
tags = ["manual"],
)
```

To generate some content in the generated `crates.bzl` file:

```starlark
PACKAGES = {
"rand": crate.spec(
version = "1",
),
}

ANNOTATIONS = {
"rand": [crate.annotation(
default_features = False,
features = ["small_rng"],
)],
}
```

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.