Skip to content

Commit

Permalink
Build target reorganization Part 3 (grpc#30797)
Browse files Browse the repository at this point in the history
* Clean up `grpc++_base` and `grpc++_base_unsecure`

* Clean up `grpc++`

* Clean up `grpc++_unsecure`

* Fix issues in cherry picking
  • Loading branch information
ralphchung authored Sep 8, 2022
1 parent 326a88a commit 3b728d7
Show file tree
Hide file tree
Showing 3 changed files with 258 additions and 79 deletions.
187 changes: 108 additions & 79 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,82 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/support/sync_stream.h",
"include/grpcpp/support/time.h",
"include/grpcpp/support/validate_service_config.h",
"include/grpc++/impl/codegen/async_stream.h",
"include/grpc++/impl/codegen/async_unary_call.h",
"include/grpc++/impl/codegen/byte_buffer.h",
"include/grpc++/impl/codegen/call_hook.h",
"include/grpc++/impl/codegen/call.h",
"include/grpc++/impl/codegen/channel_interface.h",
"include/grpc++/impl/codegen/client_context.h",
"include/grpc++/impl/codegen/client_unary_call.h",
"include/grpc++/impl/codegen/completion_queue_tag.h",
"include/grpc++/impl/codegen/completion_queue.h",
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/core_codegen_interface.h",
"include/grpc++/impl/codegen/create_auth_context.h",
"include/grpc++/impl/codegen/grpc_library.h",
"include/grpc++/impl/codegen/metadata_map.h",
"include/grpc++/impl/codegen/method_handler_impl.h",
"include/grpc++/impl/codegen/rpc_method.h",
"include/grpc++/impl/codegen/rpc_service_method.h",
"include/grpc++/impl/codegen/security/auth_context.h",
"include/grpc++/impl/codegen/serialization_traits.h",
"include/grpc++/impl/codegen/server_context.h",
"include/grpc++/impl/codegen/server_interface.h",
"include/grpc++/impl/codegen/service_type.h",
"include/grpc++/impl/codegen/slice.h",
"include/grpc++/impl/codegen/status_code_enum.h",
"include/grpc++/impl/codegen/status.h",
"include/grpc++/impl/codegen/string_ref.h",
"include/grpc++/impl/codegen/stub_options.h",
"include/grpc++/impl/codegen/sync_stream.h",
"include/grpc++/impl/codegen/time.h",
"include/grpcpp/impl/codegen/async_generic_service.h",
"include/grpcpp/impl/codegen/async_stream.h",
"include/grpcpp/impl/codegen/async_unary_call.h",
"include/grpcpp/impl/codegen/byte_buffer.h",
"include/grpcpp/impl/codegen/call_hook.h",
"include/grpcpp/impl/codegen/call_op_set_interface.h",
"include/grpcpp/impl/codegen/call_op_set.h",
"include/grpcpp/impl/codegen/call.h",
"include/grpcpp/impl/codegen/callback_common.h",
"include/grpcpp/impl/codegen/channel_interface.h",
"include/grpcpp/impl/codegen/client_callback.h",
"include/grpcpp/impl/codegen/client_context.h",
"include/grpcpp/impl/codegen/client_interceptor.h",
"include/grpcpp/impl/codegen/client_unary_call.h",
"include/grpcpp/impl/codegen/completion_queue_tag.h",
"include/grpcpp/impl/codegen/completion_queue.h",
"include/grpcpp/impl/codegen/config.h",
"include/grpcpp/impl/codegen/core_codegen_interface.h",
"include/grpcpp/impl/codegen/create_auth_context.h",
"include/grpcpp/impl/codegen/delegating_channel.h",
"include/grpcpp/impl/codegen/grpc_library.h",
"include/grpcpp/impl/codegen/intercepted_channel.h",
"include/grpcpp/impl/codegen/interceptor_common.h",
"include/grpcpp/impl/codegen/interceptor.h",
"include/grpcpp/impl/codegen/message_allocator.h",
"include/grpcpp/impl/codegen/metadata_map.h",
"include/grpcpp/impl/codegen/method_handler_impl.h",
"include/grpcpp/impl/codegen/method_handler.h",
"include/grpcpp/impl/codegen/rpc_method.h",
"include/grpcpp/impl/codegen/rpc_service_method.h",
"include/grpcpp/impl/codegen/security/auth_context.h",
"include/grpcpp/impl/codegen/serialization_traits.h",
"include/grpcpp/impl/codegen/server_callback_handlers.h",
"include/grpcpp/impl/codegen/server_callback.h",
"include/grpcpp/impl/codegen/server_context.h",
"include/grpcpp/impl/codegen/server_interceptor.h",
"include/grpcpp/impl/codegen/server_interface.h",
"include/grpcpp/impl/codegen/service_type.h",
"include/grpcpp/impl/codegen/slice.h",
"include/grpcpp/impl/codegen/status_code_enum.h",
"include/grpcpp/impl/codegen/status.h",
"include/grpcpp/impl/codegen/string_ref.h",
"include/grpcpp/impl/codegen/stub_options.h",
"include/grpcpp/impl/codegen/sync_stream.h",
"include/grpcpp/impl/codegen/time.h",
"include/grpcpp/impl/codegen/sync.h",
]

grpc_cc_library(
Expand Down Expand Up @@ -608,13 +684,12 @@ grpc_cc_library(
],
},
],
standalone = True,
tags = ["nofixdeps"],
visibility = [
"@grpc:public",
],
deps = [
"grpc++_internals",
"grpc++_base",
"slice",
],
)
Expand All @@ -630,58 +705,6 @@ grpc_cc_library(
deps = ["gpr_platform"],
)

grpc_cc_library(
name = "grpc++_internals",
srcs = [
"src/cpp/client/insecure_credentials.cc",
"src/cpp/client/secure_credentials.cc",
"src/cpp/common/auth_property_iterator.cc",
"src/cpp/common/secure_auth_context.cc",
"src/cpp/common/secure_channel_arguments.cc",
"src/cpp/common/secure_create_auth_context.cc",
"src/cpp/common/tls_certificate_provider.cc",
"src/cpp/common/tls_certificate_verifier.cc",
"src/cpp/common/tls_credentials_options.cc",
"src/cpp/server/insecure_server_credentials.cc",
"src/cpp/server/secure_server_credentials.cc",
],
hdrs = [
"src/cpp/client/secure_credentials.h",
"src/cpp/common/secure_auth_context.h",
"src/cpp/server/secure_server_credentials.h",
],
external_deps = [
"absl/status",
"absl/status:statusor",
"absl/synchronization",
"absl/container:inlined_vector",
"absl/strings",
"protobuf_headers",
],
language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS,
tags = ["nofixdeps"],
deps = [
"error",
"gpr",
"gpr_codegen",
"grpc",
"grpc++_base",
"grpc++_codegen_base",
"grpc++_codegen_base_src",
"grpc++_codegen_proto",
"grpc++_internal_hdrs_only",
"grpc_base",
"grpc_codegen",
"grpc_credentials_util",
"grpc_security_base",
"json",
"ref_counted_ptr",
"slice",
"slice_refcount",
],
)

grpc_cc_library(
name = "grpc++_binder",
srcs = [
Expand Down Expand Up @@ -790,7 +813,7 @@ grpc_cc_library(
deps = [
"gpr",
"grpc",
"grpc++_internals",
"grpc++_base",
],
)

Expand All @@ -811,7 +834,7 @@ grpc_cc_library(
deps = [
"gpr",
"grpc",
"grpc++_internals",
"grpc++_base",
],
)

Expand All @@ -823,7 +846,6 @@ grpc_cc_library(
"src/cpp/server/insecure_server_credentials.cc",
],
language = "c++",
standalone = True,
tags = [
"avoid_dep",
"nofixdeps",
Expand Down Expand Up @@ -906,20 +928,6 @@ grpc_cc_library(
],
)

grpc_cc_library(
name = "grpc++_internal_hdrs_only",
hdrs = [
"include/grpcpp/impl/codegen/sync.h",
],
external_deps = [
"absl/synchronization",
],
tags = ["nofixdeps"],
deps = [
"gpr_codegen",
],
)

grpc_cc_library(
name = "useful",
hdrs = ["src/core/lib/gpr/useful.h"],
Expand Down Expand Up @@ -6989,8 +6997,24 @@ grpc_cc_library(

grpc_cc_library(
name = "grpc++_base",
srcs = GRPCXX_SRCS,
hdrs = GRPCXX_HDRS,
srcs = GRPCXX_SRCS + [
"src/cpp/client/insecure_credentials.cc",
"src/cpp/client/secure_credentials.cc",
"src/cpp/common/auth_property_iterator.cc",
"src/cpp/common/secure_auth_context.cc",
"src/cpp/common/secure_channel_arguments.cc",
"src/cpp/common/secure_create_auth_context.cc",
"src/cpp/common/tls_certificate_provider.cc",
"src/cpp/common/tls_certificate_verifier.cc",
"src/cpp/common/tls_credentials_options.cc",
"src/cpp/server/insecure_server_credentials.cc",
"src/cpp/server/secure_server_credentials.cc",
],
hdrs = GRPCXX_HDRS + [
"src/cpp/client/secure_credentials.h",
"src/cpp/common/secure_auth_context.h",
"src/cpp/server/secure_server_credentials.h",
],
external_deps = [
"absl/base:core_headers",
"absl/status",
Expand All @@ -7000,6 +7024,7 @@ grpc_cc_library(
"absl/memory",
"upb_lib",
"protobuf_headers",
"absl/container:inlined_vector",
],
language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS,
Expand All @@ -7009,30 +7034,37 @@ grpc_cc_library(
"arena",
"channel_init",
"config",
"error",
"gpr",
"gpr_codegen",
"grpc",
"grpc++_codegen_base",
"grpc++_codegen_base_src",
"grpc++_internal_hdrs_only",
"grpc++_codegen_proto",
"grpc_base",
"grpc_codegen",
"grpc_credentials_util",
"grpc_health_upb",
"grpc_security_base",
"grpc_service_config",
"grpc_service_config_impl",
"grpc_trace",
"grpc_transport_inproc",
"grpcpp_call_metric_recorder",
"iomgr_timer",
"json",
"ref_counted",
"ref_counted_ptr",
"resource_quota",
"slice",
"slice_refcount",
"time",
"useful",
],
)

# TODO(chengyuc): Give it another try to merge this to `grpc++_base` after
# codegen files are removed.
grpc_cc_library(
name = "grpc++_base_unsecure",
srcs = GRPCXX_SRCS,
Expand Down Expand Up @@ -7062,7 +7094,6 @@ grpc_cc_library(
"gpr_codegen",
"grpc++_codegen_base",
"grpc++_codegen_base_src",
"grpc++_internal_hdrs_only",
"grpc_base",
"grpc_codegen",
"grpc_health_upb",
Expand Down Expand Up @@ -7166,7 +7197,7 @@ grpc_cc_library(
tags = ["nofixdeps"],
visibility = ["@grpc:public"],
deps = [
"grpc++_internal_hdrs_only",
"grpc++_public_hdrs",
"grpc_codegen",
],
)
Expand Down Expand Up @@ -7264,7 +7295,6 @@ grpc_cc_library(
deps = [
"arena",
"grpc++_codegen_base",
"grpc++_internal_hdrs_only",
"grpc++_public_hdrs",
"grpc_backend_metric_data",
"xds_orca_upb",
Expand Down Expand Up @@ -7315,7 +7345,6 @@ grpc_cc_library(
"gpr",
"grpc++",
"grpc++_codegen_base",
"grpc++_internal_hdrs_only",
"grpc_base",
"protobuf_duration_upb",
"ref_counted",
Expand Down Expand Up @@ -7372,8 +7401,8 @@ grpc_cc_library(
deps = [
"gpr",
"grpc",
"grpc++_base",
"grpc++_codegen_base",
"grpc++_internals",
"//src/proto/grpc/testing/xds/v3:csds_proto",
],
alwayslink = 1,
Expand Down
Loading

0 comments on commit 3b728d7

Please sign in to comment.