rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

Unable to pass apparent repo labels to `crate.annotation` attributes

Open jvolkman opened this issue 7 months ago • 0 comments

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?

jvolkman avatar Jul 11 '24 04:07 jvolkman