From 99f8a10aec994a8957fbb6787768b444ef34d6a2 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Tue, 10 Dec 2019 22:48:33 -0800 Subject: [PATCH] Make gRPC podspec template more robust --- gRPC-C++.podspec | 360 ++++++--------------------- gRPC-Core.podspec | 105 ++++---- templates/gRPC-C++.podspec.template | 179 ++++++------- templates/gRPC-Core.podspec.template | 132 +++++----- 4 files changed, 268 insertions(+), 508 deletions(-) diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 5a9a2c0add2..3eafd3550d6 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -19,7 +19,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized @@ -65,6 +64,7 @@ Pod::Spec.new do |s| } s.libraries = 'c++' + s.compiler_flags = '-Wno-comma' s.default_subspecs = 'Interface', 'Implementation' @@ -213,66 +213,9 @@ Pod::Spec.new do |s| ss.header_mappings_dir = '.' ss.dependency "#{s.name}/Interface", version ss.dependency 'gRPC-Core', version + abseil_version = '0.20190808.1' ss.source_files = 'include/grpcpp/impl/codegen/core_codegen.h', - 'src/cpp/client/channel_cc.cc', - 'src/cpp/client/client_context.cc', - 'src/cpp/client/client_interceptor.cc', - 'src/cpp/client/create_channel.cc', - 'src/cpp/client/create_channel_internal.cc', - 'src/cpp/client/create_channel_internal.h', - 'src/cpp/client/create_channel_posix.cc', - 'src/cpp/client/credentials_cc.cc', - 'src/cpp/client/generic_stub.cc', - 'src/cpp/client/insecure_credentials.cc', - 'src/cpp/client/secure_credentials.cc', - 'src/cpp/client/secure_credentials.h', - 'src/cpp/codegen/codegen_init.cc', - 'src/cpp/common/alarm.cc', - 'src/cpp/common/auth_property_iterator.cc', - 'src/cpp/common/channel_arguments.cc', - 'src/cpp/common/channel_filter.cc', - 'src/cpp/common/channel_filter.h', - 'src/cpp/common/completion_queue_cc.cc', - 'src/cpp/common/core_codegen.cc', - 'src/cpp/common/resource_quota_cc.cc', - 'src/cpp/common/rpc_method.cc', - 'src/cpp/common/secure_auth_context.cc', - 'src/cpp/common/secure_auth_context.h', - 'src/cpp/common/secure_channel_arguments.cc', - 'src/cpp/common/secure_create_auth_context.cc', - 'src/cpp/common/tls_credentials_options.cc', - 'src/cpp/common/tls_credentials_options_util.cc', - 'src/cpp/common/tls_credentials_options_util.h', - 'src/cpp/common/validate_service_config.cc', - 'src/cpp/common/version_cc.cc', - 'src/cpp/server/async_generic_service.cc', - 'src/cpp/server/channel_argument_option.cc', - 'src/cpp/server/create_default_thread_pool.cc', - 'src/cpp/server/dynamic_thread_pool.cc', - 'src/cpp/server/dynamic_thread_pool.h', - 'src/cpp/server/external_connection_acceptor_impl.cc', - 'src/cpp/server/external_connection_acceptor_impl.h', - 'src/cpp/server/health/default_health_check_service.cc', - 'src/cpp/server/health/default_health_check_service.h', - 'src/cpp/server/health/health_check_service.cc', - 'src/cpp/server/health/health_check_service_server_builder_option.cc', - 'src/cpp/server/insecure_server_credentials.cc', - 'src/cpp/server/secure_server_credentials.cc', - 'src/cpp/server/secure_server_credentials.h', - 'src/cpp/server/server_builder.cc', - 'src/cpp/server/server_callback.cc', - 'src/cpp/server/server_cc.cc', - 'src/cpp/server/server_context.cc', - 'src/cpp/server/server_credentials.cc', - 'src/cpp/server/server_posix.cc', - 'src/cpp/server/thread_pool_interface.h', - 'src/cpp/thread_manager/thread_manager.cc', - 'src/cpp/thread_manager/thread_manager.h', - 'src/cpp/util/byte_buffer_cc.cc', - 'src/cpp/util/status.cc', - 'src/cpp/util/string_ref.cc', - 'src/cpp/util/time_cc.cc', 'src/core/ext/filters/client_channel/backend_metric.h', 'src/core/ext/filters/client_channel/backup_poller.h', 'src/core/ext/filters/client_channel/client_channel.h', @@ -628,6 +571,64 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', + 'src/cpp/client/channel_cc.cc', + 'src/cpp/client/client_context.cc', + 'src/cpp/client/client_interceptor.cc', + 'src/cpp/client/create_channel.cc', + 'src/cpp/client/create_channel_internal.cc', + 'src/cpp/client/create_channel_internal.h', + 'src/cpp/client/create_channel_posix.cc', + 'src/cpp/client/credentials_cc.cc', + 'src/cpp/client/generic_stub.cc', + 'src/cpp/client/insecure_credentials.cc', + 'src/cpp/client/secure_credentials.cc', + 'src/cpp/client/secure_credentials.h', + 'src/cpp/codegen/codegen_init.cc', + 'src/cpp/common/alarm.cc', + 'src/cpp/common/auth_property_iterator.cc', + 'src/cpp/common/channel_arguments.cc', + 'src/cpp/common/channel_filter.cc', + 'src/cpp/common/channel_filter.h', + 'src/cpp/common/completion_queue_cc.cc', + 'src/cpp/common/core_codegen.cc', + 'src/cpp/common/resource_quota_cc.cc', + 'src/cpp/common/rpc_method.cc', + 'src/cpp/common/secure_auth_context.cc', + 'src/cpp/common/secure_auth_context.h', + 'src/cpp/common/secure_channel_arguments.cc', + 'src/cpp/common/secure_create_auth_context.cc', + 'src/cpp/common/tls_credentials_options.cc', + 'src/cpp/common/tls_credentials_options_util.cc', + 'src/cpp/common/tls_credentials_options_util.h', + 'src/cpp/common/validate_service_config.cc', + 'src/cpp/common/version_cc.cc', + 'src/cpp/server/async_generic_service.cc', + 'src/cpp/server/channel_argument_option.cc', + 'src/cpp/server/create_default_thread_pool.cc', + 'src/cpp/server/dynamic_thread_pool.cc', + 'src/cpp/server/dynamic_thread_pool.h', + 'src/cpp/server/external_connection_acceptor_impl.cc', + 'src/cpp/server/external_connection_acceptor_impl.h', + 'src/cpp/server/health/default_health_check_service.cc', + 'src/cpp/server/health/default_health_check_service.h', + 'src/cpp/server/health/health_check_service.cc', + 'src/cpp/server/health/health_check_service_server_builder_option.cc', + 'src/cpp/server/insecure_server_credentials.cc', + 'src/cpp/server/secure_server_credentials.cc', + 'src/cpp/server/secure_server_credentials.h', + 'src/cpp/server/server_builder.cc', + 'src/cpp/server/server_callback.cc', + 'src/cpp/server/server_cc.cc', + 'src/cpp/server/server_context.cc', + 'src/cpp/server/server_credentials.cc', + 'src/cpp/server/server_posix.cc', + 'src/cpp/server/thread_pool_interface.h', + 'src/cpp/thread_manager/thread_manager.cc', + 'src/cpp/thread_manager/thread_manager.h', + 'src/cpp/util/byte_buffer_cc.cc', + 'src/cpp/util/status.cc', + 'src/cpp/util/string_ref.cc', + 'src/cpp/util/time_cc.cc', 'third_party/upb/upb/decode.h', 'third_party/upb/upb/encode.h', 'third_party/upb/upb/generated_util.h', @@ -638,235 +639,6 @@ Pod::Spec.new do |s| 'third_party/upb/upb/upb.h' ss.private_header_files = 'include/grpcpp/impl/codegen/core_codegen.h', - 'src/core/ext/filters/client_channel/backend_metric.h', - 'src/core/ext/filters/client_channel/backup_poller.h', - 'src/core/ext/filters/client_channel/client_channel.h', - 'src/core/ext/filters/client_channel/client_channel_channelz.h', - 'src/core/ext/filters/client_channel/client_channel_factory.h', - 'src/core/ext/filters/client_channel/connector.h', - 'src/core/ext/filters/client_channel/global_subchannel_pool.h', - 'src/core/ext/filters/client_channel/health/health_check_client.h', - 'src/core/ext/filters/client_channel/http_connect_handshaker.h', - 'src/core/ext/filters/client_channel/http_proxy.h', - 'src/core/ext/filters/client_channel/lb_policy.h', - 'src/core/ext/filters/client_channel/lb_policy_factory.h', - 'src/core/ext/filters/client_channel/lb_policy_registry.h', - 'src/core/ext/filters/client_channel/local_subchannel_pool.h', - 'src/core/ext/filters/client_channel/parse_address.h', - 'src/core/ext/filters/client_channel/proxy_mapper.h', - 'src/core/ext/filters/client_channel/proxy_mapper_registry.h', - 'src/core/ext/filters/client_channel/resolver.h', - 'src/core/ext/filters/client_channel/resolver_factory.h', - 'src/core/ext/filters/client_channel/resolver_registry.h', - 'src/core/ext/filters/client_channel/resolver_result_parsing.h', - 'src/core/ext/filters/client_channel/resolving_lb_policy.h', - 'src/core/ext/filters/client_channel/retry_throttle.h', - 'src/core/ext/filters/client_channel/server_address.h', - 'src/core/ext/filters/client_channel/service_config.h', - 'src/core/ext/filters/client_channel/subchannel.h', - 'src/core/ext/filters/client_channel/subchannel_interface.h', - 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', - 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/transport/inproc/inproc_transport.h', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', - 'src/core/ext/upb-generated/google/api/annotations.upb.h', - 'src/core/ext/upb-generated/google/api/http.upb.h', - 'src/core/ext/upb-generated/google/protobuf/any.upb.h', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', - 'src/core/ext/upb-generated/google/rpc/status.upb.h', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', - 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h', - 'src/core/ext/upb-generated/validate/validate.upb.h', - 'src/core/lib/avl/avl.h', - 'src/core/lib/backoff/backoff.h', - 'src/core/lib/channel/channel_args.h', - 'src/core/lib/channel/channel_stack.h', - 'src/core/lib/channel/channel_stack_builder.h', - 'src/core/lib/channel/channel_trace.h', - 'src/core/lib/channel/channelz.h', - 'src/core/lib/channel/channelz_registry.h', - 'src/core/lib/channel/connected_channel.h', - 'src/core/lib/channel/context.h', - 'src/core/lib/channel/handshaker.h', - 'src/core/lib/channel/handshaker_factory.h', - 'src/core/lib/channel/handshaker_registry.h', - 'src/core/lib/channel/status_util.h', - 'src/core/lib/compression/algorithm_metadata.h', - 'src/core/lib/compression/compression_args.h', - 'src/core/lib/compression/compression_internal.h', - 'src/core/lib/compression/message_compress.h', - 'src/core/lib/compression/stream_compression.h', - 'src/core/lib/compression/stream_compression_gzip.h', - 'src/core/lib/compression/stream_compression_identity.h', - 'src/core/lib/debug/stats.h', - 'src/core/lib/debug/stats_data.h', - 'src/core/lib/debug/trace.h', - 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/arena.h', - 'src/core/lib/gpr/env.h', - 'src/core/lib/gpr/murmur_hash.h', - 'src/core/lib/gpr/spinlock.h', - 'src/core/lib/gpr/string.h', - 'src/core/lib/gpr/string_windows.h', - 'src/core/lib/gpr/time_precise.h', - 'src/core/lib/gpr/tls.h', - 'src/core/lib/gpr/tls_gcc.h', - 'src/core/lib/gpr/tls_msvc.h', - 'src/core/lib/gpr/tls_pthread.h', - 'src/core/lib/gpr/tmpfile.h', - 'src/core/lib/gpr/useful.h', - 'src/core/lib/gprpp/arena.h', - 'src/core/lib/gprpp/atomic.h', - 'src/core/lib/gprpp/debug_location.h', - 'src/core/lib/gprpp/fork.h', - 'src/core/lib/gprpp/global_config.h', - 'src/core/lib/gprpp/global_config_custom.h', - 'src/core/lib/gprpp/global_config_env.h', - 'src/core/lib/gprpp/global_config_generic.h', - 'src/core/lib/gprpp/host_port.h', - 'src/core/lib/gprpp/inlined_vector.h', - 'src/core/lib/gprpp/manual_constructor.h', - 'src/core/lib/gprpp/map.h', - 'src/core/lib/gprpp/memory.h', - 'src/core/lib/gprpp/mpscq.h', - 'src/core/lib/gprpp/optional.h', - 'src/core/lib/gprpp/orphanable.h', - 'src/core/lib/gprpp/ref_counted.h', - 'src/core/lib/gprpp/ref_counted_ptr.h', - 'src/core/lib/gprpp/string_view.h', - 'src/core/lib/gprpp/sync.h', - 'src/core/lib/gprpp/thd.h', - 'src/core/lib/http/format_request.h', - 'src/core/lib/http/httpcli.h', - 'src/core/lib/http/parser.h', - 'src/core/lib/iomgr/block_annotate.h', - 'src/core/lib/iomgr/buffer_list.h', - 'src/core/lib/iomgr/call_combiner.h', - 'src/core/lib/iomgr/cfstream_handle.h', - 'src/core/lib/iomgr/closure.h', - 'src/core/lib/iomgr/combiner.h', - 'src/core/lib/iomgr/dynamic_annotations.h', - 'src/core/lib/iomgr/endpoint.h', - 'src/core/lib/iomgr/endpoint_cfstream.h', - 'src/core/lib/iomgr/endpoint_pair.h', - 'src/core/lib/iomgr/error.h', - 'src/core/lib/iomgr/error_cfstream.h', - 'src/core/lib/iomgr/error_internal.h', - 'src/core/lib/iomgr/ev_epoll1_linux.h', - 'src/core/lib/iomgr/ev_epollex_linux.h', - 'src/core/lib/iomgr/ev_poll_posix.h', - 'src/core/lib/iomgr/ev_posix.h', - 'src/core/lib/iomgr/exec_ctx.h', - 'src/core/lib/iomgr/executor.h', - 'src/core/lib/iomgr/executor/mpmcqueue.h', - 'src/core/lib/iomgr/executor/threadpool.h', - 'src/core/lib/iomgr/gethostname.h', - 'src/core/lib/iomgr/grpc_if_nametoindex.h', - 'src/core/lib/iomgr/internal_errqueue.h', - 'src/core/lib/iomgr/iocp_windows.h', - 'src/core/lib/iomgr/iomgr.h', - 'src/core/lib/iomgr/iomgr_custom.h', - 'src/core/lib/iomgr/iomgr_internal.h', - 'src/core/lib/iomgr/iomgr_posix.h', - 'src/core/lib/iomgr/is_epollexclusive_available.h', - 'src/core/lib/iomgr/load_file.h', - 'src/core/lib/iomgr/lockfree_event.h', - 'src/core/lib/iomgr/logical_thread.h', - 'src/core/lib/iomgr/nameser.h', - 'src/core/lib/iomgr/polling_entity.h', - 'src/core/lib/iomgr/pollset.h', - 'src/core/lib/iomgr/pollset_custom.h', - 'src/core/lib/iomgr/pollset_set.h', - 'src/core/lib/iomgr/pollset_set_custom.h', - 'src/core/lib/iomgr/pollset_set_windows.h', - 'src/core/lib/iomgr/pollset_windows.h', - 'src/core/lib/iomgr/port.h', - 'src/core/lib/iomgr/resolve_address.h', - 'src/core/lib/iomgr/resolve_address_custom.h', - 'src/core/lib/iomgr/resource_quota.h', - 'src/core/lib/iomgr/sockaddr.h', - 'src/core/lib/iomgr/sockaddr_custom.h', - 'src/core/lib/iomgr/sockaddr_posix.h', - 'src/core/lib/iomgr/sockaddr_utils.h', - 'src/core/lib/iomgr/sockaddr_windows.h', - 'src/core/lib/iomgr/socket_factory_posix.h', - 'src/core/lib/iomgr/socket_mutator.h', - 'src/core/lib/iomgr/socket_utils.h', - 'src/core/lib/iomgr/socket_utils_posix.h', - 'src/core/lib/iomgr/socket_windows.h', - 'src/core/lib/iomgr/sys_epoll_wrapper.h', - 'src/core/lib/iomgr/tcp_client.h', - 'src/core/lib/iomgr/tcp_client_posix.h', - 'src/core/lib/iomgr/tcp_custom.h', - 'src/core/lib/iomgr/tcp_posix.h', - 'src/core/lib/iomgr/tcp_server.h', - 'src/core/lib/iomgr/tcp_server_utils_posix.h', - 'src/core/lib/iomgr/tcp_windows.h', - 'src/core/lib/iomgr/time_averaged_stats.h', - 'src/core/lib/iomgr/timer.h', - 'src/core/lib/iomgr/timer_custom.h', - 'src/core/lib/iomgr/timer_heap.h', - 'src/core/lib/iomgr/timer_manager.h', - 'src/core/lib/iomgr/udp_server.h', - 'src/core/lib/iomgr/unix_sockets_posix.h', - 'src/core/lib/iomgr/wakeup_fd_pipe.h', - 'src/core/lib/iomgr/wakeup_fd_posix.h', - 'src/core/lib/json/json.h', - 'src/core/lib/json/json_common.h', - 'src/core/lib/json/json_reader.h', - 'src/core/lib/json/json_writer.h', - 'src/core/lib/profiling/timers.h', - 'src/core/lib/slice/b64.h', - 'src/core/lib/slice/percent_encoding.h', - 'src/core/lib/slice/slice_hash_table.h', - 'src/core/lib/slice/slice_internal.h', - 'src/core/lib/slice/slice_string_helpers.h', - 'src/core/lib/slice/slice_utils.h', - 'src/core/lib/slice/slice_weak_hash_table.h', - 'src/core/lib/surface/api_trace.h', - 'src/core/lib/surface/call.h', - 'src/core/lib/surface/call_test_only.h', - 'src/core/lib/surface/channel.h', - 'src/core/lib/surface/channel_init.h', - 'src/core/lib/surface/channel_stack_type.h', - 'src/core/lib/surface/completion_queue.h', - 'src/core/lib/surface/completion_queue_factory.h', - 'src/core/lib/surface/event_string.h', - 'src/core/lib/surface/init.h', - 'src/core/lib/surface/lame_client.h', - 'src/core/lib/surface/server.h', - 'src/core/lib/surface/validate_metadata.h', - 'src/core/lib/transport/bdp_estimator.h', - 'src/core/lib/transport/byte_stream.h', - 'src/core/lib/transport/connectivity_state.h', - 'src/core/lib/transport/error_utils.h', - 'src/core/lib/transport/http2_errors.h', - 'src/core/lib/transport/metadata.h', - 'src/core/lib/transport/metadata_batch.h', - 'src/core/lib/transport/pid_controller.h', - 'src/core/lib/transport/static_metadata.h', - 'src/core/lib/transport/status_conversion.h', - 'src/core/lib/transport/status_metadata.h', - 'src/core/lib/transport/timeout_encoding.h', - 'src/core/lib/transport/transport.h', - 'src/core/lib/transport/transport_impl.h', - 'src/core/lib/uri/uri_parser.h', - 'src/cpp/client/create_channel_internal.h', - 'src/cpp/client/secure_credentials.h', - 'src/cpp/common/channel_filter.h', - 'src/cpp/common/secure_auth_context.h', - 'src/cpp/common/tls_credentials_options_util.h', - 'src/cpp/server/dynamic_thread_pool.h', - 'src/cpp/server/external_connection_acceptor_impl.h', - 'src/cpp/server/health/default_health_check_service.h', - 'src/cpp/server/secure_server_credentials.h', - 'src/cpp/server/thread_pool_interface.h', - 'src/cpp/thread_manager/thread_manager.h', 'src/core/ext/filters/client_channel/backend_metric.h', 'src/core/ext/filters/client_channel/backup_poller.h', 'src/core/ext/filters/client_channel/client_channel.h', @@ -1222,6 +994,17 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', + 'src/cpp/client/create_channel_internal.h', + 'src/cpp/client/secure_credentials.h', + 'src/cpp/common/channel_filter.h', + 'src/cpp/common/secure_auth_context.h', + 'src/cpp/common/tls_credentials_options_util.h', + 'src/cpp/server/dynamic_thread_pool.h', + 'src/cpp/server/external_connection_acceptor_impl.h', + 'src/cpp/server/health/default_health_check_service.h', + 'src/cpp/server/secure_server_credentials.h', + 'src/cpp/server/thread_pool_interface.h', + 'src/cpp/thread_manager/thread_manager.h', 'third_party/upb/upb/decode.h', 'third_party/upb/upb/encode.h', 'third_party/upb/upb/generated_util.h', @@ -1237,7 +1020,6 @@ Pod::Spec.new do |s| ss.dependency "#{s.name}/Interface", version ss.source_files = 'include/grpcpp/impl/codegen/config_protobuf.h', - 'include/grpcpp/impl/codegen/config_protobuf.h', 'include/grpcpp/impl/codegen/proto_buffer_reader.h', 'include/grpcpp/impl/codegen/proto_buffer_writer.h', 'include/grpcpp/impl/codegen/proto_utils.h' diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 5b306628b20..ec4a29465de 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -19,7 +19,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - Pod::Spec.new do |s| s.name = 'gRPC-Core' version = '1.26.0' @@ -97,7 +96,7 @@ Pod::Spec.new do |s| } s.default_subspecs = 'Interface', 'Implementation' - s.compiler_flags = '-DGRPC_ARES=0' + s.compiler_flags = '-DGRPC_ARES=0 -Wno-comma' s.libraries = 'c++' # Like many other C libraries, gRPC-Core has its public headers under `include//` and its @@ -123,40 +122,26 @@ Pod::Spec.new do |s| 'include/grpc/grpc_security.h', 'include/grpc/grpc_security_constants.h', 'include/grpc/impl/codegen/atm.h', - 'include/grpc/impl/codegen/atm.h', 'include/grpc/impl/codegen/atm_gcc_atomic.h', - 'include/grpc/impl/codegen/atm_gcc_atomic.h', - 'include/grpc/impl/codegen/atm_gcc_sync.h', 'include/grpc/impl/codegen/atm_gcc_sync.h', 'include/grpc/impl/codegen/atm_windows.h', - 'include/grpc/impl/codegen/atm_windows.h', 'include/grpc/impl/codegen/byte_buffer.h', 'include/grpc/impl/codegen/byte_buffer_reader.h', 'include/grpc/impl/codegen/compression_types.h', 'include/grpc/impl/codegen/connectivity_state.h', 'include/grpc/impl/codegen/fork.h', - 'include/grpc/impl/codegen/fork.h', - 'include/grpc/impl/codegen/gpr_slice.h', 'include/grpc/impl/codegen/gpr_slice.h', 'include/grpc/impl/codegen/gpr_types.h', - 'include/grpc/impl/codegen/gpr_types.h', 'include/grpc/impl/codegen/grpc_types.h', 'include/grpc/impl/codegen/log.h', - 'include/grpc/impl/codegen/log.h', - 'include/grpc/impl/codegen/port_platform.h', 'include/grpc/impl/codegen/port_platform.h', 'include/grpc/impl/codegen/propagation_bits.h', 'include/grpc/impl/codegen/slice.h', 'include/grpc/impl/codegen/status.h', 'include/grpc/impl/codegen/sync.h', - 'include/grpc/impl/codegen/sync.h', - 'include/grpc/impl/codegen/sync_custom.h', 'include/grpc/impl/codegen/sync_custom.h', 'include/grpc/impl/codegen/sync_generic.h', - 'include/grpc/impl/codegen/sync_generic.h', 'include/grpc/impl/codegen/sync_posix.h', - 'include/grpc/impl/codegen/sync_posix.h', - 'include/grpc/impl/codegen/sync_windows.h', 'include/grpc/impl/codegen/sync_windows.h', 'include/grpc/load_reporting.h', 'include/grpc/slice.h', @@ -186,6 +171,7 @@ Pod::Spec.new do |s| ss.libraries = 'z' ss.dependency "#{s.name}/Interface", version ss.dependency 'BoringSSL-GRPC', '0.0.5' + abseil_version = '0.20190808.1' ss.compiler_flags = '-DGRPC_SHADOW_BORINGSSL_SYMBOLS' ss.source_files = 'src/core/ext/filters/census/grpc_context.cc', @@ -969,7 +955,6 @@ Pod::Spec.new do |s| 'third_party/upb/upb/table.int.h', 'third_party/upb/upb/upb.c', 'third_party/upb/upb/upb.h' - ss.private_header_files = 'src/core/ext/filters/client_channel/backend_metric.h', 'src/core/ext/filters/client_channel/backup_poller.h', 'src/core/ext/filters/client_channel/client_channel.h', @@ -1372,54 +1357,15 @@ Pod::Spec.new do |s| 'test/core/end2end/data/server1_key.cc', 'test/core/end2end/data/ssl_test_data.h', 'test/core/end2end/data/test_root_cert.cc', + 'test/core/end2end/end2end_test_utils.cc', + 'test/core/end2end/end2end_tests.cc', + 'test/core/end2end/end2end_tests.h', 'test/core/end2end/fixtures/http_proxy_fixture.cc', 'test/core/end2end/fixtures/http_proxy_fixture.h', 'test/core/end2end/fixtures/local_util.cc', 'test/core/end2end/fixtures/local_util.h', 'test/core/end2end/fixtures/proxy.cc', 'test/core/end2end/fixtures/proxy.h', - 'test/core/iomgr/endpoint_tests.cc', - 'test/core/iomgr/endpoint_tests.h', - 'test/core/security/oauth2_utils.cc', - 'test/core/security/oauth2_utils.h', - 'test/core/util/cmdline.cc', - 'test/core/util/cmdline.h', - 'test/core/util/debugger_macros.cc', - 'test/core/util/debugger_macros.h', - 'test/core/util/fuzzer_util.cc', - 'test/core/util/fuzzer_util.h', - 'test/core/util/grpc_profiler.cc', - 'test/core/util/grpc_profiler.h', - 'test/core/util/histogram.cc', - 'test/core/util/histogram.h', - 'test/core/util/memory_counters.cc', - 'test/core/util/memory_counters.h', - 'test/core/util/mock_endpoint.cc', - 'test/core/util/mock_endpoint.h', - 'test/core/util/parse_hexstring.cc', - 'test/core/util/parse_hexstring.h', - 'test/core/util/passthru_endpoint.cc', - 'test/core/util/passthru_endpoint.h', - 'test/core/util/port.cc', - 'test/core/util/port.h', - 'test/core/util/port_isolated_runtime_environment.cc', - 'test/core/util/port_server_client.cc', - 'test/core/util/port_server_client.h', - 'test/core/util/slice_splitter.cc', - 'test/core/util/slice_splitter.h', - 'test/core/util/subprocess.h', - 'test/core/util/subprocess_windows.cc', - 'test/core/util/test_config.cc', - 'test/core/util/test_config.h', - 'test/core/util/test_lb_policies.cc', - 'test/core/util/test_lb_policies.h', - 'test/core/util/tracer_util.cc', - 'test/core/util/tracer_util.h', - 'test/core/util/trickle_endpoint.cc', - 'test/core/util/trickle_endpoint.h', - 'test/core/end2end/end2end_test_utils.cc', - 'test/core/end2end/end2end_tests.cc', - 'test/core/end2end/end2end_tests.h', 'test/core/end2end/tests/authority_not_supported.cc', 'test/core/end2end/tests/bad_hostname.cc', 'test/core/end2end/tests/bad_ping.cc', @@ -1498,7 +1444,46 @@ Pod::Spec.new do |s| 'test/core/end2end/tests/trailing_metadata.cc', 'test/core/end2end/tests/workaround_cronet_compression.cc', 'test/core/end2end/tests/write_buffering.cc', - 'test/core/end2end/tests/write_buffering_at_end.cc' + 'test/core/end2end/tests/write_buffering_at_end.cc', + 'test/core/iomgr/endpoint_tests.cc', + 'test/core/iomgr/endpoint_tests.h', + 'test/core/security/oauth2_utils.cc', + 'test/core/security/oauth2_utils.h', + 'test/core/util/cmdline.cc', + 'test/core/util/cmdline.h', + 'test/core/util/debugger_macros.cc', + 'test/core/util/debugger_macros.h', + 'test/core/util/fuzzer_util.cc', + 'test/core/util/fuzzer_util.h', + 'test/core/util/grpc_profiler.cc', + 'test/core/util/grpc_profiler.h', + 'test/core/util/histogram.cc', + 'test/core/util/histogram.h', + 'test/core/util/memory_counters.cc', + 'test/core/util/memory_counters.h', + 'test/core/util/mock_endpoint.cc', + 'test/core/util/mock_endpoint.h', + 'test/core/util/parse_hexstring.cc', + 'test/core/util/parse_hexstring.h', + 'test/core/util/passthru_endpoint.cc', + 'test/core/util/passthru_endpoint.h', + 'test/core/util/port.cc', + 'test/core/util/port.h', + 'test/core/util/port_isolated_runtime_environment.cc', + 'test/core/util/port_server_client.cc', + 'test/core/util/port_server_client.h', + 'test/core/util/slice_splitter.cc', + 'test/core/util/slice_splitter.h', + 'test/core/util/subprocess.h', + 'test/core/util/subprocess_windows.cc', + 'test/core/util/test_config.cc', + 'test/core/util/test_config.h', + 'test/core/util/test_lb_policies.cc', + 'test/core/util/test_lb_policies.h', + 'test/core/util/tracer_util.cc', + 'test/core/util/tracer_util.h', + 'test/core/util/trickle_endpoint.cc', + 'test/core/util/trickle_endpoint.h' end # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path? diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 0a31cc5066b..ef0801c6735 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -20,108 +20,84 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + <% + lib_maps = {lib.name: lib for lib in libs} + filegroup_maps = {filegroup.name: filegroup for filegroup in filegroups} - <%! - def grpc_lib_files(libs, expect_libs, groups): + def ruby_multiline_list(files, indent): + return (',\n' + indent*' ').join('\'%s\'' % f for f in files) + + def is_absl_lib(target_name): + return target_name.startswith("absl/") + + def get_absl_spec_name(label): + # e.g. absl/apple:banana -> abseil/apple/banana + return "abseil/" + label[5:].replace(":", "/") + + def lib_and_transitive_deps(lib): + return list(sorted(set({lib} | lib_maps[lib].transitive_deps))) + + def non_abseil_lib_and_transitive_deps(lib): + return [l for l in lib_and_transitive_deps(lib) if not is_absl_lib(l)] + + def list_abseil_specs(lib): + # This returns a list of abseil specs which the given lib and + # its non-abseil transitive dependencies depend on. + # As a result, internal abseil libraries are excluded from the result. + absl_specs = set() + for lib_name in lib_and_transitive_deps(lib): + if is_absl_lib(lib_name): continue + for dep in lib_maps[lib_name].deps: + if is_absl_lib(dep): + absl_specs.add(get_absl_spec_name(dep)) + return list(sorted(absl_specs)) + + def list_lib_files(lib, fields): + files = set() + for lib_name in non_abseil_lib_and_transitive_deps(lib): + lib = lib_maps[lib_name] + for field in fields: + files.update(lib.get(field, [])) + return list(sorted(files)) + + def list_filegroup_files(expect_filegroups, groups): out = [] - for lib in libs: - if lib.name in expect_libs: - for group in groups: - out += lib.get(group, []) - return sorted(out) + for filegroup_name in expect_filegroups: + filegroup = filegroup_maps[filegroup_name] + for group in groups: + out += filegroup.get(group, []) + return list(sorted(set(out))) def filter_grpcpp(files): - return [file for file in files if not file.startswith("include/grpc++")] - - grpc_libs = ("grpc", "gpr", "upb") - - def grpc_private_files(libs): - out = grpc_lib_files(libs, grpc_libs, ("headers", "src")) - return out - - def grpc_private_headers(libs): - out = grpc_lib_files(libs, grpc_libs, ("headers",)) - return out - - def grpc_public_headers(libs): - out = grpc_lib_files(libs, grpc_libs, ("public_headers",)) - return out - - def grpcpp_proto_files(filegroups): - out = grpc_lib_files(filegroups, ("grpc++_codegen_proto", "grpc++_config_proto"), ("headers", "src", "public_headers")) - excl_files = grpc_lib_files(filegroups, ("grpc++_codegen_base",), ("headers", "src", "public_headers")) - out = [file for file in out if file not in excl_files] - out = filter_grpcpp(out) - return out - - def grpcpp_private_files(libs, filegroups): - out = grpc_lib_files(libs, ("grpc++",), ("headers", "src")) - excl_files = grpc_private_files(libs) - + return sorted([file for file in files if not file.startswith("include/grpc++")]) + + grpc_private_files = list_lib_files("grpc", ("headers", "src")) + grpc_public_headers = list_lib_files("grpc", ("public_headers",)) + grpc_private_headers = list_lib_files("grpc", ("headers",)) + + grpcpp_proto_files = filter_grpcpp( + set(list_filegroup_files(("grpc++_codegen_proto", "grpc++_config_proto"), ("headers", "src", "public_headers"))) + - set(list_filegroup_files(("grpc++_codegen_base",), ("headers", "src", "public_headers"))) + ) + grpcpp_private_files = filter_grpcpp( + set(list_lib_files("grpc++", ("headers", "src"))) + - set(grpc_private_files) # We exclude proto related files in this particular podspec so that we can provide a protobuf-independent lib - excl_files += grpcpp_proto_files(filegroups) - out = [file for file in out if file not in excl_files] - - out = filter_grpcpp(out) - return out - - def grpcpp_private_headers(libs, filegroups): - out = grpc_lib_files(libs, ("grpc++",), ("headers",)) - excl_files = grpc_private_headers(libs) - + - set(grpcpp_proto_files) + ) + grpcpp_private_headers = filter_grpcpp( + set(list_lib_files("grpc++", ("headers",))) + - set(grpc_private_headers) # We exclude proto related files in this particular podspec so that we can provide a protobuf-independent lib - excl_files = grpcpp_proto_files(filegroups) - out = [file for file in out if file not in excl_files] - - out = filter_grpcpp(out) - return out - - def grpcpp_public_headers(libs, filegroups): - out = grpc_lib_files(libs, ("grpc++",), ("public_headers",)) - excl_files = grpc_public_headers(libs) - + - set(grpcpp_proto_files) + ) + grpcpp_public_headers = filter_grpcpp( + set(list_lib_files("grpc++", ("public_headers",))) + - set(grpc_public_headers) # We exclude proto related files in this particular podspec so that we can provide a protobuf-independent lib - excl_files += grpcpp_proto_files(filegroups) - - out = [file for file in out if file not in excl_files] - - out = filter_grpcpp(out) - - return out - - def grpc_test_util_files(libs): - out = grpc_lib_files(libs, ("grpc_test_util",), ("src", "headers")) - return out - - def grpc_test_util_headers(libs): - out = grpc_lib_files(libs, ("grpc_test_util",), ("headers",)) - return out - - # Tests subspec is currently disabled since the tests currently use `grpc++` include style instead of `grpcpp`. - # TODO (mxyan): enable Tests subspec after the inclusion style is updated in `test/` directory. - def grpcpp_test_util_files(libs, filegroups): - out = grpc_lib_files(libs, ("grpc++_test_util",), ("src", "headers")) - excl_files = grpc_test_util_files(libs) + grpcpp_private_files(libs, filegroups) - - # We exclude proto related files in this particular podspec so that we can provide a protobuf-independent lib - excl_files += grpc_lib_files(filegroups, ("grpc++_codegen_proto", "grpc++_config_proto"), ("headers", "src")) - excl_files += ["test/cpp/util/byte_buffer_proto_helper.cc", - "test/cpp/util/byte_buffer_proto_helper.h", - "test/cpp/end2end/test_service_impl.cc", - "test/cpp/end2end/test_service_impl.h"] - excl_files += [file for file in out if file.endswith(".proto")] - - out = [file for file in out if not file in excl_files] - - # Since some C++ test files directly included private headers in C core, we intentionally add these header - # files to this subspec - out += grpc_test_util_headers(libs) - - return out - - def ruby_multiline_list(files, indent): - return (',\n' + indent*' ').join('\'%s\'' % f for f in files) - + - set(grpcpp_proto_files) + ) + grpcpp_abseil_specs = list_abseil_specs("grpc++") %> Pod::Spec.new do |s| s.name = 'gRPC-C++' @@ -168,6 +144,7 @@ } s.libraries = 'c++' + s.compiler_flags = '-Wno-comma' s.default_subspecs = 'Interface', 'Implementation' @@ -179,24 +156,28 @@ s.subspec 'Interface' do |ss| ss.header_mappings_dir = 'include/grpcpp' - ss.source_files = ${ruby_multiline_list(grpcpp_public_headers(libs, filegroups), 22)} + ss.source_files = ${ruby_multiline_list(grpcpp_public_headers, 22)} end s.subspec 'Implementation' do |ss| ss.header_mappings_dir = '.' ss.dependency "#{s.name}/Interface", version ss.dependency 'gRPC-Core', version + abseil_version = '0.20190808.1' + % for abseil_spec in grpcpp_abseil_specs: + ss.dependency '${abseil_spec}', abseil_version + % endfor - ss.source_files = ${ruby_multiline_list(grpcpp_private_files(libs, filegroups) + grpc_private_headers(libs), 22)} + ss.source_files = ${ruby_multiline_list(sorted(grpcpp_private_files + grpc_private_headers), 22)} - ss.private_header_files = ${ruby_multiline_list(grpcpp_private_headers(libs, filegroups) + grpc_private_headers(libs), 30)} + ss.private_header_files = ${ruby_multiline_list(sorted(grpcpp_private_headers + grpc_private_headers), 30)} end s.subspec 'Protobuf' do |ss| ss.header_mappings_dir = 'include/grpcpp' ss.dependency "#{s.name}/Interface", version - ss.source_files = ${ruby_multiline_list(grpcpp_proto_files(filegroups), 22)} + ss.source_files = ${ruby_multiline_list(grpcpp_proto_files, 22)} end s.subspec 'Cronet-Interface' do |ss| diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index 9bebbdf4097..847aabc41d7 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -20,60 +20,70 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - <%! - def grpc_lib_files(libs, expect_libs, groups): - out = [] - for lib in libs: - if lib.name in expect_libs: - for group in groups: - out += lib.get(group, []) - return sorted(out) - - grpc_libs = ("grpc", "gpr", "upb") - - def grpc_private_files(libs): - out = grpc_lib_files(libs, grpc_libs, ("headers", "src")) - return out - - def grpc_public_headers(libs): - out = grpc_lib_files(libs, grpc_libs, ("public_headers",)) - return out - - def grpc_private_headers(libs): - out = grpc_lib_files(libs, grpc_libs, ("headers",)) - return out - - def grpc_cronet_files(libs): - out = grpc_lib_files(libs, ("grpc_cronet",), ("src", "headers")) - excl = grpc_private_files(libs) - excl += [ - # We do not need cronet dedicated plugin registry - "src/core/ext/transport/cronet/plugin_registry/grpc_cronet_plugin_registry.cc", - # We do not need dummy cronet API for ObjC - "src/core/ext/transport/cronet/transport/cronet_api_dummy.cc", - ] - return [file for file in out if not file in excl] - - def grpc_cronet_public_headers(libs): - out = grpc_lib_files(libs, ("grpc_cronet",), ("public_headers",)) - excl = grpc_public_headers(libs) - return [file for file in out if not file in excl] - - def grpc_test_util_files(libs): - out = grpc_lib_files(libs, ("grpc_test_util",), ("src", "headers")) - excl = grpc_private_files(libs) - # Subprocess is not supported in tvOS and not needed by our tests. - excl += ["test/core/util/subprocess_posix.cc"] - return [file for file in out if not file in excl] - - def end2end_tests_files(libs): - out = grpc_lib_files(libs, ("end2end_tests",), ("src", "headers")) - excl = grpc_private_files(libs) - return [file for file in out if not file in excl] + <% + lib_maps = {lib.name: lib for lib in libs} def ruby_multiline_list(files, indent): return (',\n' + indent*' ').join('\'%s\'' % f for f in files) + + def is_absl_lib(target_name): + return target_name.startswith("absl/") + + def get_absl_spec_name(label): + # e.g. absl/apple:banana -> abseil/apple/banana + return "abseil/" + label[5:].replace(":", "/") + + def lib_and_transitive_deps(lib): + return list(sorted(set({lib} | lib_maps[lib].transitive_deps))) + + def non_abseil_lib_and_transitive_deps(lib): + return [l for l in lib_and_transitive_deps(lib) if not is_absl_lib(l)] + + def list_abseil_specs(lib): + # This returns a list of abseil specs which the given lib and + # its non-abseil transitive dependencies depend on. + # As a result, internal abseil libraries are excluded from the result. + absl_specs = set() + for lib_name in lib_and_transitive_deps(lib): + if is_absl_lib(lib_name): continue + for dep in lib_maps[lib_name].deps: + if is_absl_lib(dep): + absl_specs.add(get_absl_spec_name(dep)) + return list(sorted(absl_specs)) + + def list_lib_files(lib, fields): + files = set() + for lib_name in non_abseil_lib_and_transitive_deps(lib): + lib = lib_maps[lib_name] + for field in fields: + files.update(lib.get(field, [])) + return list(sorted(files)) + + grpc_private_files = list_lib_files("grpc", ("headers", "src")) + grpc_public_headers = list_lib_files("grpc", ("public_headers",)) + grpc_private_headers = list_lib_files("grpc", ("headers",)) + grpc_abseil_specs = list_abseil_specs("grpc") + + grpc_cronet_files = list(sorted( + set(list_lib_files("grpc_cronet", ("src", "headers"))) + - set(grpc_private_files) + - set([ + # We do not need cronet dedicated plugin registry + "src/core/ext/transport/cronet/plugin_registry/grpc_cronet_plugin_registry.cc", + # We do not need dummy cronet API for ObjC + "src/core/ext/transport/cronet/transport/cronet_api_dummy.cc", + ]))) + grpc_cronet_public_headers = list(sorted( + set(list_lib_files("grpc_cronet", ("public_headers",))) + - set(grpc_public_headers))) + + grpc_test_util_files = list(sorted( + set(list_lib_files("end2end_tests", ("src", "headers"))) + - set(grpc_private_files) + - set([ + # Subprocess is not supported in tvOS and not needed by our tests. + "test/core/util/subprocess_posix.cc", + ]))) %> Pod::Spec.new do |s| s.name = 'gRPC-Core' @@ -152,7 +162,7 @@ } s.default_subspecs = 'Interface', 'Implementation' - s.compiler_flags = '-DGRPC_ARES=0' + s.compiler_flags = '-DGRPC_ARES=0 -Wno-comma' s.libraries = 'c++' # Like many other C libraries, gRPC-Core has its public headers under `include//` and its @@ -168,18 +178,21 @@ s.subspec 'Interface' do |ss| ss.header_mappings_dir = 'include/grpc' - ss.source_files = ${ruby_multiline_list(grpc_public_headers(libs), 22)} + ss.source_files = ${ruby_multiline_list(grpc_public_headers, 22)} end s.subspec 'Implementation' do |ss| ss.header_mappings_dir = '.' ss.libraries = 'z' ss.dependency "#{s.name}/Interface", version ss.dependency 'BoringSSL-GRPC', '0.0.5' + abseil_version = '0.20190808.1' + % for abseil_spec in grpc_abseil_specs: + ss.dependency '${abseil_spec}', abseil_version + % endfor ss.compiler_flags = '-DGRPC_SHADOW_BORINGSSL_SYMBOLS' - ss.source_files = ${ruby_multiline_list(grpc_private_files(libs), 22)} - - ss.private_header_files = ${ruby_multiline_list(grpc_private_headers(libs), 30)} + ss.source_files = ${ruby_multiline_list(grpc_private_files, 22)} + ss.private_header_files = ${ruby_multiline_list(grpc_private_headers, 30)} end # CFStream is now default. Leaving this subspec only for compatibility purpose. @@ -189,7 +202,7 @@ s.subspec 'Cronet-Interface' do |ss| ss.header_mappings_dir = 'include/grpc' - ss.source_files = ${ruby_multiline_list(grpc_cronet_public_headers(libs), 22)} + ss.source_files = ${ruby_multiline_list(grpc_cronet_public_headers, 22)} end s.subspec 'Cronet-Implementation' do |ss| @@ -199,7 +212,7 @@ ss.dependency "#{s.name}/Implementation", version ss.dependency "#{s.name}/Cronet-Interface", version - ss.source_files = ${ruby_multiline_list(grpc_cronet_files(libs), 22)} + ss.source_files = ${ruby_multiline_list(grpc_cronet_files, 22)} end s.subspec 'Tests' do |ss| @@ -208,8 +221,7 @@ ss.dependency "#{s.name}/Interface", version ss.dependency "#{s.name}/Implementation", version - ss.source_files = ${ruby_multiline_list(grpc_test_util_files(libs), 22)}, - ${ruby_multiline_list(end2end_tests_files(libs), 22)} + ss.source_files = ${ruby_multiline_list(grpc_test_util_files, 22)} end # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?