Use repo-relative labels wherever possible (#9187)
* Use repo-relative labels wherever possible The label `@com_google_protobuf//:foo` within the protobuf repo is often synonymous with just `//:foo`. We should prefer the latter as it allows us to use a shorter name for the module in the Bazel Central Registry (so just "protobuf" instead of "com_google_protobuf"). Note that the semantics can be subtle: in a macro, plain strings are anchored to the *calling* repo, so if we just use `//:foo` as the default value of a macro argument, it will be resolved to `@myrepo//:foo` if the macro is called from the repo `@myrepo`. In this case, it's necessary to directly call the `Label()` constructor to anchor the string label to the repo where the .bzl file lives. See https://github.com/bazelbuild/bazel-central-registry/pull/28#issuecomment-954741081 for a bit more context. * fix protobuf_deps.bzlpull/9195/head
parent
d88c8d5d4b
commit
11de748d66
2 changed files with 6 additions and 6 deletions
Loading…
Reference in new issue