bazelbuild / bazelbuild/rules_rust

Declare targets listed in the `build_data` attribute of the `cargo_build_script` rule as prerequisites

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

Description

Here's the relevant code:
```
cargo_build_script(
name = ["my-rule"],
srcs = ["build.rs"],
build_data = ["//targets:my-target"],
build_script_env = {
"TARGET": "$(rootpath //targets:my-target)",
},
)
```
When I compile, I get the following error:
`<...> in cargo_build_script rule //src:my-rule: label '//targets:my-target' in $(location) expression is not a declared prerequisite of this rule`

I'm on version 0.40.0

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.