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

Use repo-relative labels wherever possible #9187

Merged
merged 2 commits into from
Nov 4, 2021

Commits on Nov 4, 2021

  1. 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 bazelbuild/bazel-central-registry#28 (comment) for a bit more context.
    Wyverald committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    b5df030 View commit details
    Browse the repository at this point in the history
  2. fix protobuf_deps.bzl

    Wyverald committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    aa33f7b View commit details
    Browse the repository at this point in the history