bazelbuild / bazelbuild/rules_rust

Render Config error using `crates_vendor`

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

Description

I have the current snippet in my BUILD file.
```
crates_vendor(
name = "some_vendor",
manifests = [":Cargo.toml"],
mode = "local",
render_config = render_config(
regen_command = "run bazel //vi:some_vendor",
default_package_name = "",
crate_repository_template = "{name}",
crate_label_template = "@{repository}__{name}//:{target}",
)
)
```

I am getting the following error when I run the command `bazel run //vi::some_vendor`, being in a `vi` directory.
```
Error in fail: The `crates_vendor.render_config` attribute does not support the `crate_label_template` parameter. Please update @//vi:some_vendor to remove this value.
```

While looking through the starlark, its not transparent to me that you can actually use the `render_config` with different values from the default_config.

https://github.com/bazelbuild/rules_rust/blob/15572051f0a7c3c83d1cd73de72c8110729db4d8/crate_universe/private/crates_vendor.bzl#L164C1-L171C1

The error goes away when I do a 1:1 match with the default provided by `render_config()`

Can i get some guidance here, to make sure im understanding this correctly?

Im guessing the developers were wanting to make sure the keys matched and not the values, but this seems to be checking the values if i am understanding correctly.

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.