From a935ae1505c768ca0ce6ea981af1fb03c56052d7 Mon Sep 17 00:00:00 2001
From: Vijay Pai <vpai@google.com>
Date: Thu, 13 Apr 2017 21:07:45 +0000
Subject: [PATCH] Fix build rules for grpc++_unsecure, test that it builds
 properly

---
 BUILD               |  5 ++++-
 WORKSPACE           | 11 +++++------
 test/cpp/util/BUILD |  9 +++++++++
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/BUILD b/BUILD
index 70bd4062a4..57709e4745 100644
--- a/BUILD
+++ b/BUILD
@@ -1277,6 +1277,9 @@ grpc_cc_library(
         "src/cpp/server/thread_pool_interface.h",
         "src/cpp/thread_manager/thread_manager.h",
     ],
+    external_deps = [
+        "nanopb",
+    ],
     language = "c++",
     public_hdrs = [
         "include/grpc++/alarm.h",
@@ -1328,7 +1331,7 @@ grpc_cc_library(
         "include/grpc++/support/time.h",
     ],
     deps = [
-        "grpc",
+        "grpc_base",
         "grpc++_codegen_base",
     ],
 )
diff --git a/WORKSPACE b/WORKSPACE
index 5ba82f3127..a78a88979e 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -15,17 +15,17 @@ bind(
 
 bind(
     name = "protobuf",
-    actual = "@submodule_protobuf//:protobuf",
+    actual = "@com_google_protobuf//:protobuf",
 )
 
 bind(
     name = "protobuf_clib",
-    actual = "@submodule_protobuf//:protoc_lib",
+    actual = "@com_google_protobuf//:protoc_lib",
 )
 
 bind(
     name = "protocol_compiler",
-    actual = "@submodule_protobuf//:protoc",
+    actual = "@com_google_protobuf//:protoc",
 )
 
 bind(
@@ -48,9 +48,8 @@ bind(
     actual = "@com_github_gflags_gflags//:gflags",
 )
 
-new_local_repository(
+local_repository(
     name = "submodule_boringssl",
-    build_file = "third_party/boringssl-with-bazel/BUILD",
     path = "third_party/boringssl-with-bazel",
 )
 
@@ -61,7 +60,7 @@ new_local_repository(
 )
 
 new_local_repository(
-    name = "submodule_protobuf",
+    name = "com_google_protobuf",
     build_file = "third_party/protobuf/BUILD",
     path = "third_party/protobuf",
 )
diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD
index 38f804ffd4..c83f89eb90 100644
--- a/test/cpp/util/BUILD
+++ b/test/cpp/util/BUILD
@@ -29,6 +29,15 @@
 
 licenses(["notice"])  # 3-clause BSD
 
+# The following builds a shared-object to confirm that grpc++_unsecure
+# builds properly. Build-only is sufficient here
+cc_binary(
+    name = "testso.so",
+    srcs = [],
+    deps = ["//:grpc++_unsecure"],
+    linkshared = 1,
+)
+
 cc_library(
     name = "test_config",
     srcs = [
-- 
GitLab