Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto_repository doesn't work as documented #218

Open
jvolkman opened this issue Feb 3, 2022 · 0 comments
Open

proto_repository doesn't work as documented #218

jvolkman opened this issue Feb 3, 2022 · 0 comments

Comments

@jvolkman
Copy link
Contributor

jvolkman commented Feb 3, 2022

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 is go_repository which is confusing. Maybe it should be something like _proto_repository since there's already a proto_repository macro.
  • there doesn't appear to be support for the clean option to build_file_generation. I set it to on which seems to be working.
  • it looks like proto_language_config_file should actually be cfgs (a list). I used cfgs 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant