bazelbuild / bazelbuild/rules_rust
[crate_universe] Restrictions on `crates_vendor`/`crates_repository`
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Even though I am glad that #2233 was landed in a recent commit, I think there is some restrictions when using a map as a `select()` query.
For example, when using a map in `rustc_flags`:
```python
crate.annotation(
rustc_flags = [
{
"@org_noelware_charted_server//build/settings:nixos": "-Lexternal/openssl-static/lib",
},
],
)
```
It is produced with:
```shell
$ bazel run //thirdparty:crate_index -- --repin
# INFO: Analyzed target //thirdparty:crate_index (1 packages loaded, 1 target configured).
# INFO: Found 1 target...
# Target //thirdparty:crate_index up-to-date:
# bazel-bin/thirdparty/crate_index.sh
# INFO: Elapsed time: 0.077s, Critical Path: 0.00s
# INFO: 2 processes: 2 internal.
# INFO: Build completed successfully, 2 total actions
# INFO: Running command line: bazel-bin/thirdparty/crate_index.sh --repin
# Error: invalid type: map, expected a string at line 81 column 16
```
Could there be any way that when using a map, the actual type is considered instead of forcing a string? My suspicion is the `StringOrSelect` enum variant:
https://github.com/bazelbuild/rules_rust/blob/cebd731e3d3e3732114535881ef51a0935a87f7e/crate_universe/src/config.rs#L145-L152
Contributor guide
Assessment
This issue has not been assessed yet.