bazelbuild / bazelbuild/rules_rust
`rust_bindgen` doesn't work with external repository
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Let's say I use the following directory structure
```sh
myproject
├── BUILD.bazel
├── WORKSPACE
...
├── libs
└── foo
├── BUILD.bazel
└── src
└── libs.rs
```
And that the `myproject/libs/foo/BUILD.bazel`:
```bazel
rust_bindgen_library(
name = "external_lib_binding",
cc_lib = "@external_lib:lib",
header = "lib_api.h",
)
```
Then I get the following error, even though `lib_api.h` is a transitive header.
```sh
Error in fail: Header is not in 's transitive headers. header
```
This happens because `header` variable takes relative path of the current project `libs/foo/external_lib.h` which doesn't exist in `external_lib`. Hence [the comparison](https://github.com/bazelbuild/rules_rust/blob/main/bindgen/bindgen.bzl#L94) fails.
Contributor guide
Assessment
This issue has not been assessed yet.