Render Config error using `crates_vendor`
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.
Im willing to fix this, If i can get clarification on the expected behavior
While looking through the starlark, its not transparent to me that you can actually use the
render_configwith 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?
I think this code should be relaxed to allow users to set default_package_name, regen_command, and platforms_template. The rule should otherwise determine the rest of the values. That should just be a small update to the code you already identified. Would that work for you?