Skip to content

Commit

Permalink
build: marking extensions as extension-only visible by default
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
  • Loading branch information
alyssawilk committed Jul 28, 2020
1 parent 2e939b6 commit d1ca7f2
Show file tree
Hide file tree
Showing 137 changed files with 567 additions and 469 deletions.
2 changes: 2 additions & 0 deletions bazel/envoy_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ load(
":envoy_library.bzl",
_envoy_basic_cc_library = "envoy_basic_cc_library",
_envoy_cc_extension = "envoy_cc_extension",
_envoy_cc_extension_library = "envoy_cc_extension_library",
_envoy_cc_library = "envoy_cc_library",
_envoy_cc_posix_library = "envoy_cc_posix_library",
_envoy_cc_win32_library = "envoy_cc_win32_library",
Expand Down Expand Up @@ -178,6 +179,7 @@ envoy_cc_binary = _envoy_cc_binary
envoy_basic_cc_library = _envoy_basic_cc_library
envoy_cc_extension = _envoy_cc_extension
envoy_cc_library = _envoy_cc_library
envoy_cc_extension_library = _envoy_cc_extension_library
envoy_cc_posix_library = _envoy_cc_posix_library
envoy_cc_win32_library = _envoy_cc_win32_library
envoy_include_prefix = _envoy_include_prefix
Expand Down
28 changes: 28 additions & 0 deletions bazel/envoy_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,34 @@ def envoy_cc_extension(
fail("Unknown extension status: " + status)
envoy_cc_library(name, tags = tags, **kwargs)

def envoy_cc_extension_library(
name,
srcs = [],
hdrs = [],
copts = [],
visibility = ["//source/extensions:__subpackages__", "//test/extensions:__subpackages__"],
external_deps = [],
tcmalloc_dep = None,
repository = "",
tags = [],
deps = [],
strip_include_prefix = None,
textual_hdrs = None):
envoy_cc_library(
name = name,
srcs = srcs,
hdrs = hdrs,
copts = copts,
visibility = visibility,
external_deps = external_deps,
tcmalloc_dep = tcmalloc_dep,
repository = repository,
tags = tags,
deps = deps,
strip_include_prefix = strip_include_prefix,
textual_hdrs = textual_hdrs,
)

# Envoy C++ library targets should be specified with this function.
def envoy_cc_library(
name,
Expand Down
6 changes: 4 additions & 2 deletions source/extensions/access_loggers/BUILD
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "well_known_names",
hdrs = ["well_known_names.h"],
# well known names files are public as long as they exist.
visibility = ["//visibility:public"],
deps = [
"//source/common/singleton:const_singleton",
],
Expand Down
4 changes: 2 additions & 2 deletions source/extensions/access_loggers/common/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

Expand All @@ -10,7 +10,7 @@ licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "access_log_base",
srcs = ["access_log_base.cc"],
hdrs = ["access_log_base.h"],
Expand Down
6 changes: 4 additions & 2 deletions source/extensions/access_loggers/file/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_extension",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

Expand All @@ -12,10 +12,12 @@ licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "file_access_log_lib",
srcs = ["file_access_log_impl.cc"],
hdrs = ["file_access_log_impl.h"],
# The file based access logger is core code.
visibility = ["//visibility:public"],
deps = [
"//source/extensions/access_loggers/common:access_log_base",
],
Expand Down
14 changes: 7 additions & 7 deletions source/extensions/access_loggers/grpc/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_extension",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

Expand All @@ -12,7 +12,7 @@ licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "config_utils",
srcs = ["config_utils.cc"],
hdrs = ["config_utils.h"],
Expand All @@ -24,7 +24,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "grpc_access_log_lib",
srcs = ["grpc_access_log_impl.cc"],
hdrs = ["grpc_access_log_impl.h"],
Expand All @@ -44,7 +44,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "grpc_access_log_utils",
srcs = ["grpc_access_log_utils.cc"],
hdrs = ["grpc_access_log_utils.h"],
Expand All @@ -58,7 +58,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "http_grpc_access_log_lib",
srcs = ["http_grpc_access_log_impl.cc"],
hdrs = ["http_grpc_access_log_impl.h"],
Expand All @@ -71,7 +71,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "tcp_grpc_access_log_lib",
srcs = ["tcp_grpc_access_log_impl.cc"],
hdrs = ["tcp_grpc_access_log_impl.h"],
Expand All @@ -83,7 +83,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "grpc_access_log_proto_descriptors_lib",
srcs = ["grpc_access_log_proto_descriptors.cc"],
hdrs = ["grpc_access_log_proto_descriptors.h"],
Expand Down
6 changes: 4 additions & 2 deletions source/extensions/clusters/BUILD
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "well_known_names",
hdrs = ["well_known_names.h"],
# well known names files are public as long as they exist.
visibility = ["//visibility:public"],
deps = [
"//source/common/config:well_known_names",
"//source/common/singleton:const_singleton",
Expand Down
6 changes: 3 additions & 3 deletions source/extensions/clusters/redis/BUILD
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_extension",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "crc16_lib",
srcs = [
"crc16.cc",
"crc16.h",
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "redis_cluster_lb",
srcs = [
"redis_cluster_lb.cc",
Expand Down
6 changes: 4 additions & 2 deletions source/extensions/common/BUILD
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "utility_lib",
hdrs = ["utility.h"],
# Legacy. TODO(#9953) clean up.
visibility = ["//visibility:public"],
deps = [
"//include/envoy/runtime:runtime_interface",
"//source/common/common:documentation_url_lib",
Expand Down
16 changes: 8 additions & 8 deletions source/extensions/common/aws/BUILD
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "signer_interface",
hdrs = ["signer.h"],
deps = [
"//include/envoy/http:message_interface",
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "signer_impl_lib",
srcs = ["signer_impl.cc"],
hdrs = ["signer_impl.h"],
Expand All @@ -35,13 +35,13 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "credentials_provider_interface",
hdrs = ["credentials_provider.h"],
external_deps = ["abseil_optional"],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "credentials_provider_impl_lib",
srcs = ["credentials_provider_impl.cc"],
hdrs = ["credentials_provider_impl.h"],
Expand All @@ -56,7 +56,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "utility_lib",
srcs = ["utility.cc"],
hdrs = ["utility.h"],
Expand All @@ -67,13 +67,13 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "region_provider_interface",
hdrs = ["region_provider.h"],
external_deps = ["abseil_optional"],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "region_provider_impl_lib",
srcs = ["region_provider_impl.cc"],
hdrs = ["region_provider_impl.h"],
Expand Down
10 changes: 5 additions & 5 deletions source/extensions/common/dynamic_forward_proxy/BUILD
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "dns_cache_interface",
hdrs = ["dns_cache.h"],
deps = [
Expand All @@ -22,7 +22,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "dns_cache_manager_impl",
srcs = ["dns_cache_manager_impl.cc"],
hdrs = ["dns_cache_manager_impl.h"],
Expand All @@ -33,7 +33,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "dns_cache_impl",
srcs = ["dns_cache_impl.cc"],
hdrs = ["dns_cache_impl.h"],
Expand All @@ -50,7 +50,7 @@ envoy_cc_library(
],
)

envoy_cc_library(
envoy_cc_extension_library(
name = "dns_cache_resource_manager",
srcs = ["dns_cache_resource_manager.cc"],
hdrs = ["dns_cache_resource_manager.h"],
Expand Down
6 changes: 4 additions & 2 deletions source/extensions/common/proxy_protocol/BUILD
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_cc_extension_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
envoy_cc_extension_library(
name = "proxy_protocol_header_lib",
srcs = ["proxy_protocol_header.cc"],
hdrs = ["proxy_protocol_header.h"],
# This is used by the router, so considered core code.
visibility = ["//visibility:public"],
deps = [
"//include/envoy/buffer:buffer_interface",
"//include/envoy/network:address_interface",
Expand Down
Loading

0 comments on commit d1ca7f2

Please sign in to comment.