rules_proto
rules_proto copied to clipboard
proto_repository doesn't work as documented
Using the example for @googleapis
leads to the following errors:
ERROR: /home/jvolkman/repo/WORKSPACE:461:17: //external:googleapis: invalid value in 'build_file_generation' attribute: has to be one of 'auto', 'off' or 'on' instead of 'clean'
ERROR: /home/jvolkman/repo/WORKSPACE:461:17: //external:googleapis: no such attribute 'proto_language_config_file' in 'go_repository' rule
Three things I've found looking at the source:
- the
repository_rule
name isgo_repository
which is confusing. Maybe it should be something like_proto_repository
since there's already aproto_repository
macro. - there doesn't appear to be support for the
clean
option tobuild_file_generation
. I set it toon
which seems to be working. - it looks like
proto_language_config_file
should actually becfgs
(a list). I usedcfgs
and it worked.
So my working rule now looks like:
proto_repository(
name = "googleapis",
build_directives = [
"gazelle:proto_language java enabled true",
"gazelle:proto_language go enabled true",
"gazelle:proto_language python enabled true",
],
build_file_generation = "on",
build_file_proto_mode = "file",
cfgs = ["//protobuf:config.yaml"],
sha256 = "b9dbc65ebc738a486265ef7b708e9449bf361541890091983e946557ee0a4bfc",
strip_prefix = "googleapis-66759bdf6a5ebb898c2a51c8649aefd1ee0b7ffe",
type = "zip",
urls = ["https://codeload.github.com/googleapis/googleapis/zip/66759bdf6a5ebb898c2a51c8649aefd1ee0b7ffe"],
)
I'd open a PR but I wasn't sure about the missing support for clean
.