Add gRPC's cc_grpc_library to //third_party/grpc/bazel

This adds a simplified version of gRPC's cc_grpc_library to
//third_party/grpc/bazel. I intend to replace the hacky cc_grpc_library
implemented in //tools/build_rules:genproto.bzl and used by
//src/main/protobuf:command_server_cc_proto with this one.

Aside from a general cleanup, this version of the macro supports proto
files/rules with dependencies. Future work with fine-grained failure
reporting will add dependencies to command_server.proto.

The added files, all BUILD/bzl, are taken from gRPC's v1.26.0
(commithash 'de893acb', see https://github.com/grpc/grpc/tree/v1.26.0).
Because these resources are independent of Bazel's other imports from
gRPC, there are no conflicts with the current imported version of gRPC's
C++ sources.

This includes a patch file, bazel.patch, which adapts gRPC's BUILD/bzl
sources for use by Bazel.

This simplifies the cc_grpc_library macro and its deps:
* removes cc_grpc_library's grpc_only parameter (now always true)
* removes its proto_only, well_known_protos parameters (now always
    false)
* removes its use_external parameter (it was previously unused)
* adds to it an extra_cc_library_kwargs parameter (forwarded to its
    generated cc_library rule)
* removes "well_known_proto" functionality from generate_cc.bzl and
    protobuf.bzl
* changes generate_cc's _protoc attribute to protoc
* sets cc_grpc_library's generate_cc call's plugin and protoc arguments
    to Bazel's targets ("//third_party/grpc:cpp_plugin" and
    "//third_party/protobuf:protoc", respectively)
* relativizes load statements throughout
* adds "srcs" filegroup to the package's BUILD file and includes it in
    //third_party/grpc:srcs

This also deletes the obsolete grpc.patch file.
8 files changed
tree: 4f1b5263e771a1aac505b8529585a38be4760732
  1. .bazelci/
  2. examples/
  3. scripts/
  4. site/
  5. src/
  6. third_party/
  7. tools/
  8. .bazelrc
  9. .gitattributes
  10. .gitignore
  11. AUTHORS
  12. BUILD
  13. CHANGELOG.md
  14. CODEOWNERS
  15. combine_distfiles.py
  16. combine_distfiles_to_tar.sh
  17. compile.sh
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. distdir.bzl
  21. ISSUE_TEMPLATE.md
  22. LICENSE
  23. README.md
  24. WORKSPACE
README.md

Bazel

{Fast, Correct} - Choose two

Build and test software of any size, quickly and reliably.

  • Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.

  • One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.

  • Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.

  • Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.

Getting Started

Documentation

Contributing to Bazel

See CONTRIBUTING.md

Build status