Unable to pass apparent repo labels to `crate.annotation` attributes
Take for example this annotation:
crate.annotation(
crate = "pyo3-build-config",
build_script_data = [
"@python_3_11//:files",
"@python_3_11//:python3",
],
build_script_env = {
"PYO3_PYTHON": "$(execpath @python_3_11//:python3)",
},
)
This annotation fails because @python_3_11 isn't visible to the rules_rust repo (although it is visible to the root repo). One might expect that build_script_data is a label_list, and that Bazel would automatically handle apparent-to-canonical repo name conversion when passing a label. But it's actually a string_list.
The only work around I've found so far is to hard-code canonical labels which isn't ideal. If build_script_data must be a string_list, maybe there could be a separate build_script_data_labels attribute?
The only work around I've found so far is to hard-code canonical labels which isn't ideal.
Took some fiddling to figure this one out, so in case others run into the same issue the workaround is to replace eg
build_script_data = [ "@openssl//:foo" ]
with
build_script_data = [ "@@_main~_repo_rules~openssl//:foo" ]