From deeeba3fc8003cbbcc73e04f14fc5b5275e72e5d Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Sun, 28 Jul 2019 18:36:57 +0200 Subject: [PATCH] [protobuf] Load C++,Java,Protobuf rules from Starlark Cherry-pick of: protocolbuffers/protobuf#6432 and protocolbuffers/protobuf#6445 --- third_party/protobuf/3.6.1/BUILD | 8 ++++---- third_party/protobuf/3.6.1/protobuf.bzl | 6 +++--- third_party/protobuf/3.6.1/util/python/BUILD | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/third_party/protobuf/3.6.1/BUILD b/third_party/protobuf/3.6.1/BUILD index fc209f82ba113d..ebe8faf0f076b9 100644 --- a/third_party/protobuf/3.6.1/BUILD +++ b/third_party/protobuf/3.6.1/BUILD @@ -1,6 +1,9 @@ # Bazel (http://bazel.io/) BUILD file for Protobuf. -load("@rules_java//java:defs.bzl", "java_import") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library") +load("@rules_java//java:defs.bzl", "java_library") +load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") +load("@rules_python//python:defs.bzl", "py_library") licenses(["notice"]) @@ -24,9 +27,6 @@ config_setting( load(":protobuf.bzl", "py_proto_library") load(":compiler_config_setting.bzl", "create_compiler_config_setting") -# Needed for #9006. Hopefully a future upstream version will include this line. -load("@rules_python//python:defs.bzl", "py_library") - filegroup( name = "srcs", srcs = glob( diff --git a/third_party/protobuf/3.6.1/protobuf.bzl b/third_party/protobuf/3.6.1/protobuf.bzl index 24e333a1df75cb..31fd92c176b56c 100644 --- a/third_party/protobuf/3.6.1/protobuf.bzl +++ b/third_party/protobuf/3.6.1/protobuf.bzl @@ -1,4 +1,4 @@ -# Needed for #9006. Hopefully a future upstream version will include this line. +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:defs.bzl", "py_library", "py_test") def _GetPath(ctx, path): @@ -227,7 +227,7 @@ def cc_proto_library( ) # An empty cc_library to make rule dependency consistent. - native.cc_library( + cc_library( name = name, **kargs ) @@ -259,7 +259,7 @@ def cc_proto_library( if use_grpc_plugin: cc_libs = cc_libs + ["//external:grpc_lib"] - native.cc_library( + cc_library( name = name, srcs = gen_srcs, hdrs = gen_hdrs, diff --git a/third_party/protobuf/3.6.1/util/python/BUILD b/third_party/protobuf/3.6.1/util/python/BUILD index ea9fa641e2f04d..de47025c9bc9c8 100644 --- a/third_party/protobuf/3.6.1/util/python/BUILD +++ b/third_party/protobuf/3.6.1/util/python/BUILD @@ -1,3 +1,5 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + # This is a placeholder for python headers. Projects needing to use # fast cpp protos in protobuf's python interface should build with # --define=use_fast_cpp_protos=true, and in addition, provide