Skip to content

This is an example using the googleapis proto package from Bazel Central Registry rather than using an archive_override in the MODULE.bazel file.

License

Notifications You must be signed in to change notification settings

abitofhelp/bazel-go-googleapis

Repository files navigation

#bazel-go-googleapis.git

This repository contains a client/server solution implementing the classic Greet service using the following technologies: N.B. It does not use any of Buf's technology.

  • Bazel
  • Gazelle
  • Go
  • GoogleApis (Bazel Central Registry)
  • Grpc
  • Grpc Reflection
  • Protocol Buffers

My goal was to explore how to use the googleapis proto package from BCR rather than having to configure the following in the MODULE.bazel file.

# See:
# https://bazel.build/external/migration#fetch-deps-module-extensions
# https://github.com/bazelbuild/rules_go/issues/3685

GOOGLE_APIS_VERSION = "64926d52febbf298cb82a8f472ade4a3969ba922"

bazel_dep(
    name = "com_google_googleapis",
    version = GOOGLE_APIS_VERSION,
    repo_name = "googleapis",
)
archive_override(
    module_name = "com_google_googleapis",
    integrity = "sha256-nRqTDnZ8k8glOYuPhpLso/41O5qq3t+88fyiKCyF34g=",
    patch_strip = 1,
    patches = [
        "scripts/bazel/add_bzlmod_support.patch",  # https://github.com/googleapis/googleapis/pull/855
    ],
    strip_prefix = "googleapis-" + GOOGLE_APIS_VERSION,
    urls = [
        "https://github.com/googleapis/googleapis/archive/%s.zip" % GOOGLE_APIS_VERSION,
    ],
)

About

This is an example using the googleapis proto package from Bazel Central Registry rather than using an archive_override in the MODULE.bazel file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published