1diff --git a/BUILD b/BUILD 2index dbae719ff..87dc38470 100644 3--- a/BUILD 4+++ b/BUILD 5@@ -23,7 +23,7 @@ config_setting( 6 # ZLIB configuration 7 ################################################################################ 8 9-ZLIB_DEPS = ["@zlib//:zlib"] 10+ZLIB_DEPS = ["@zlib"] 11 12 ################################################################################ 13 # Protobuf Runtime Library 14@@ -143,6 +143,7 @@ cc_library( 15 copts = COPTS, 16 includes = ["src/"], 17 linkopts = LINK_OPTS, 18+ alwayslink = 1, 19 visibility = ["//visibility:public"], 20 ) 21 22@@ -213,6 +214,7 @@ cc_library( 23 copts = COPTS, 24 includes = ["src/"], 25 linkopts = LINK_OPTS, 26+ alwayslink = 1, 27 visibility = ["//visibility:public"], 28 deps = [":protobuf_lite"] + PROTOBUF_DEPS, 29 ) 30diff --git a/protobuf.bzl b/protobuf.bzl 31index e0653321f..253d9cbb5 100644 32--- a/protobuf.bzl 33+++ b/protobuf.bzl 34@@ -84,7 +84,9 @@ def _proto_gen_impl(ctx): 35 36 for dep in ctx.attr.deps: 37 import_flags += dep.proto.import_flags 38 deps += dep.proto.deps 39+ import_flags = depset(import_flags).to_list() 40+ deps = depset(deps).to_list() 41 42 if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin: 43 return struct(