bazelbuild / bazelbuild/rules_rust

Misleading documentation for `data`

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

Description

The documentation for `rust_library` (https://bazelbuild.github.io/rules_rust/defs.html#rust_library-compile_data) claims that `data` is included at compile-time and runtime, and `compile_data` is included only at runtime.

I was using pest to generate parser definitions from a dedicated grammar file. When I added `data = [ "parser/grammar.pest" ]` to the `rust_library` declaration, I was greeted by a "No such file or directory" error. It was only resolved after changing the argument to `compile_data` instead.

It appears that `data` is only available at runtime, which is either a case of misleading docs or a regression in the code.

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.