diff --git a/BUILD b/BUILD index 026045f076b..96d36708e33 100644 --- a/BUILD +++ b/BUILD @@ -1392,6 +1392,7 @@ grpc_cc_library( "grpc++_base", "grpc_secure", ], + alwayslink = 1, ) grpc_cc_library( @@ -1438,7 +1439,6 @@ grpc_cc_library( "lb_server_load_reporting_filter", "lb_server_load_reporting_service_server_builder_plugin", ], - alwayslink = 1, ) grpc_cc_library( diff --git a/CMakeLists.txt b/CMakeLists.txt index 51eb38c9e49..b87c77f064c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,12 +23,17 @@ cmake_minimum_required(VERSION 3.5.1) -set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.25.0-dev") -set(gRPC_CORE_VERSION "8.0.0") -set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") -set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") -set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") +set(PACKAGE_NAME "grpc") +set(PACKAGE_VERSION "1.25.0-dev") +set(gRPC_CORE_VERSION "8.0.0") +set(gRPC_CORE_SOVERSION "8") +set(gRPC_CPP_VERSION "1.25.0-dev") +set(gRPC_CPP_SOVERSION "1") +set(gRPC_CSHARP_VERSION "2.25.0-dev") +set(gRPC_CSHARP_SOVERSION "2") +set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") +set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") project(${PACKAGE_NAME} LANGUAGES C CXX) set(gRPC_INSTALL_BINDIR "bin" CACHE STRING "Installation directory for executables") @@ -769,6 +774,11 @@ add_library(address_sorting third_party/address_sorting/address_sorting_windows.c ) +set_target_properties(address_sorting PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(address_sorting PROPERTIES COMPILE_PDB_NAME "address_sorting" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -817,6 +827,11 @@ add_library(alts_test_util test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc ) +set_target_properties(alts_test_util PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(alts_test_util PROPERTIES COMPILE_PDB_NAME "alts_test_util" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -895,6 +910,11 @@ add_library(gpr src/core/lib/profiling/stap_timers.cc ) +set_target_properties(gpr PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(gpr PROPERTIES COMPILE_PDB_NAME "gpr" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -1361,6 +1381,11 @@ add_library(grpc src/core/plugin_registry/grpc_plugin_registry.cc ) +set_target_properties(grpc PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc PROPERTIES COMPILE_PDB_NAME "grpc" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -1776,6 +1801,11 @@ add_library(grpc_cronet src/core/tsi/transport_security_grpc.cc ) +set_target_properties(grpc_cronet PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_cronet PROPERTIES COMPILE_PDB_NAME "grpc_cronet" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -2127,6 +2157,11 @@ add_library(grpc_test_util src/core/ext/filters/http/server/http_server_filter.cc ) +set_target_properties(grpc_test_util PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_test_util PROPERTIES COMPILE_PDB_NAME "grpc_test_util" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -2475,6 +2510,11 @@ add_library(grpc_test_util_unsecure src/core/ext/filters/http/server/http_server_filter.cc ) +set_target_properties(grpc_test_util_unsecure PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_test_util_unsecure PROPERTIES COMPILE_PDB_NAME "grpc_test_util_unsecure" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -2865,6 +2905,11 @@ add_library(grpc_unsecure src/core/plugin_registry/grpc_unsecure_plugin_registry.cc ) +set_target_properties(grpc_unsecure PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_unsecure PROPERTIES COMPILE_PDB_NAME "grpc_unsecure" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -2962,6 +3007,11 @@ add_library(reconnect_server test/core/util/reconnect_server.cc ) +set_target_properties(reconnect_server PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(reconnect_server PROPERTIES COMPILE_PDB_NAME "reconnect_server" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3004,6 +3054,11 @@ add_library(test_tcp_server test/core/util/test_tcp_server.cc ) +set_target_properties(test_tcp_server PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(test_tcp_server PROPERTIES COMPILE_PDB_NAME "test_tcp_server" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3051,6 +3106,11 @@ add_library(bm_callback_test_service_impl test/cpp/microbenchmarks/callback_test_service.cc ) +set_target_properties(bm_callback_test_service_impl PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(bm_callback_test_service_impl PROPERTIES COMPILE_PDB_NAME "bm_callback_test_service_impl" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3108,6 +3168,11 @@ add_library(dns_test_util test/cpp/naming/dns_test_util.cc ) +set_target_properties(dns_test_util PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(dns_test_util PROPERTIES COMPILE_PDB_NAME "dns_test_util" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3204,6 +3269,11 @@ add_library(grpc++ src/cpp/codegen/codegen_init.cc ) +set_target_properties(grpc++ PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++ PROPERTIES COMPILE_PDB_NAME "grpc++" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3531,6 +3601,11 @@ add_library(grpc++_core_stats src/cpp/util/core_stats.cc ) +set_target_properties(grpc++_core_stats PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_core_stats PROPERTIES COMPILE_PDB_NAME "grpc++_core_stats" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3585,6 +3660,11 @@ add_library(grpc++_error_details src/cpp/util/error_details.cc ) +set_target_properties(grpc++_error_details PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_error_details PROPERTIES COMPILE_PDB_NAME "grpc++_error_details" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3657,6 +3737,11 @@ add_library(grpc++_proto_reflection_desc_db ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h ) +set_target_properties(grpc++_proto_reflection_desc_db PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_proto_reflection_desc_db PROPERTIES COMPILE_PDB_NAME "grpc++_proto_reflection_desc_db" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3723,6 +3808,11 @@ add_library(grpc++_reflection ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h ) +set_target_properties(grpc++_reflection PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_reflection PROPERTIES COMPILE_PDB_NAME "grpc++_reflection" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3790,6 +3880,11 @@ add_library(grpc++_test_config test/cpp/util/test_config_cc.cc ) +set_target_properties(grpc++_test_config PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_test_config PROPERTIES COMPILE_PDB_NAME "grpc++_test_config" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -3869,6 +3964,11 @@ add_library(grpc++_test_util src/cpp/codegen/codegen_init.cc ) +set_target_properties(grpc++_test_util PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_test_util PROPERTIES COMPILE_PDB_NAME "grpc++_test_util" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4082,6 +4182,11 @@ add_library(grpc++_test_util_unsecure src/cpp/codegen/codegen_init.cc ) +set_target_properties(grpc++_test_util_unsecure PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_test_util_unsecure PROPERTIES COMPILE_PDB_NAME "grpc++_test_util_unsecure" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4309,6 +4414,11 @@ add_library(grpc++_unsecure src/cpp/codegen/codegen_init.cc ) +set_target_properties(grpc++_unsecure PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc++_unsecure PROPERTIES COMPILE_PDB_NAME "grpc++_unsecure" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4624,6 +4734,11 @@ add_library(grpc_benchmark test/cpp/microbenchmarks/helpers.cc ) +set_target_properties(grpc_benchmark PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_benchmark PROPERTIES COMPILE_PDB_NAME "grpc_benchmark" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4682,6 +4797,11 @@ add_library(grpc_cli_libs ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h ) +set_target_properties(grpc_cli_libs PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_cli_libs PROPERTIES COMPILE_PDB_NAME "grpc_cli_libs" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4749,6 +4869,11 @@ add_library(grpc_plugin_support src/compiler/ruby_generator.cc ) +set_target_properties(grpc_plugin_support PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_plugin_support PROPERTIES COMPILE_PDB_NAME "grpc_plugin_support" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4813,6 +4938,11 @@ add_library(grpcpp_channelz ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h ) +set_target_properties(grpcpp_channelz PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpcpp_channelz PROPERTIES COMPILE_PDB_NAME "grpcpp_channelz" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4892,6 +5022,11 @@ add_library(http2_client_main test/cpp/interop/http2_client.cc ) +set_target_properties(http2_client_main PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(http2_client_main PROPERTIES COMPILE_PDB_NAME "http2_client_main" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -4957,6 +5092,11 @@ add_library(interop_client_helper test/cpp/interop/client_helper.cc ) +set_target_properties(interop_client_helper PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(interop_client_helper PROPERTIES COMPILE_PDB_NAME "interop_client_helper" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5025,6 +5165,11 @@ add_library(interop_client_main test/cpp/interop/interop_client.cc ) +set_target_properties(interop_client_main PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(interop_client_main PROPERTIES COMPILE_PDB_NAME "interop_client_main" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5087,6 +5232,11 @@ add_library(interop_server_helper test/cpp/interop/server_helper.cc ) +set_target_properties(interop_server_helper PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(interop_server_helper PROPERTIES COMPILE_PDB_NAME "interop_server_helper" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5150,6 +5300,11 @@ add_library(interop_server_lib test/cpp/interop/interop_server.cc ) +set_target_properties(interop_server_lib PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(interop_server_lib PROPERTIES COMPILE_PDB_NAME "interop_server_lib" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5212,6 +5367,11 @@ add_library(interop_server_main test/cpp/interop/interop_server_bootstrap.cc ) +set_target_properties(interop_server_main PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(interop_server_main PROPERTIES COMPILE_PDB_NAME "interop_server_main" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5299,6 +5459,11 @@ add_library(qps test/cpp/qps/usage_timer.cc ) +set_target_properties(qps PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(qps PROPERTIES COMPILE_PDB_NAME "qps" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5371,6 +5536,11 @@ add_library(grpc_csharp_ext SHARED src/csharp/ext/grpc_csharp_ext.c ) +set_target_properties(grpc_csharp_ext PROPERTIES + VERSION ${gRPC_CSHARP_VERSION} + SOVERSION ${gRPC_CSHARP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(grpc_csharp_ext PROPERTIES COMPILE_PDB_NAME "grpc_csharp_ext" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5420,6 +5590,11 @@ add_library(bad_client_test test/core/bad_client/bad_client.cc ) +set_target_properties(bad_client_test PROPERTIES + VERSION ${gRPC_CPP_VERSION} + SOVERSION ${gRPC_CPP_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(bad_client_test PROPERTIES COMPILE_PDB_NAME "bad_client_test" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5468,6 +5643,11 @@ add_library(bad_ssl_test_server test/core/bad_ssl/server_common.cc ) +set_target_properties(bad_ssl_test_server PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(bad_ssl_test_server PROPERTIES COMPILE_PDB_NAME "bad_ssl_test_server" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5588,6 +5768,11 @@ add_library(end2end_tests test/core/end2end/tests/write_buffering_at_end.cc ) +set_target_properties(end2end_tests PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(end2end_tests PROPERTIES COMPILE_PDB_NAME "end2end_tests" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" @@ -5708,6 +5893,11 @@ add_library(end2end_nosec_tests test/core/end2end/tests/write_buffering_at_end.cc ) +set_target_properties(end2end_nosec_tests PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +) + if(WIN32 AND MSVC) set_target_properties(end2end_nosec_tests PROPERTIES COMPILE_PDB_NAME "end2end_nosec_tests" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" diff --git a/doc/grpc_security_audit.pdf b/doc/grpc_security_audit.pdf new file mode 100644 index 00000000000..fe0219f7b92 Binary files /dev/null and b/doc/grpc_security_audit.pdf differ diff --git a/doc/security_audit.md b/doc/security_audit.md new file mode 100644 index 00000000000..f8a84a127d1 --- /dev/null +++ b/doc/security_audit.md @@ -0,0 +1,4 @@ +# gRPC Security Audit + +A third-party security audit of gRPC C++ stack was performed by [Cure53](https://cure53.de) in October 2019. The full report can be found [here](https://github.com/grpc/grpc/tree/master/doc/grpc_security_audit.pdf). The medium severity issue (GRP-01-001) identified in this report was fixed in version 1.24.0 and above. The fix was also patched in version 1.23.1. + diff --git a/src/core/ext/filters/client_channel/http_proxy.cc b/src/core/ext/filters/client_channel/http_proxy.cc index b21bf4696b0..1c4a227576a 100644 --- a/src/core/ext/filters/client_channel/http_proxy.cc +++ b/src/core/ext/filters/client_channel/http_proxy.cc @@ -99,7 +99,7 @@ bool http_proxy_enabled(const grpc_channel_args* args) { return grpc_channel_arg_get_bool(arg, true); } -static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper, +static bool proxy_mapper_map_name(grpc_proxy_mapper* /*mapper*/, const char* server_uri, const grpc_channel_args* args, char** name_to_resolve, @@ -195,15 +195,15 @@ no_use_proxy: return false; } -static bool proxy_mapper_map_address(grpc_proxy_mapper* mapper, - const grpc_resolved_address* address, - const grpc_channel_args* args, - grpc_resolved_address** new_address, - grpc_channel_args** new_args) { +static bool proxy_mapper_map_address(grpc_proxy_mapper* /*mapper*/, + const grpc_resolved_address* /*address*/, + const grpc_channel_args* /*args*/, + grpc_resolved_address** /*new_address*/, + grpc_channel_args** /*new_args*/) { return false; } -static void proxy_mapper_destroy(grpc_proxy_mapper* mapper) {} +static void proxy_mapper_destroy(grpc_proxy_mapper* /*mapper*/) {} static const grpc_proxy_mapper_vtable proxy_mapper_vtable = { proxy_mapper_map_name, proxy_mapper_map_address, proxy_mapper_destroy}; diff --git a/src/core/ext/filters/client_channel/lb_policy.cc b/src/core/ext/filters/client_channel/lb_policy.cc index d601b9f31b4..c7d756c9ace 100644 --- a/src/core/ext/filters/client_channel/lb_policy.cc +++ b/src/core/ext/filters/client_channel/lb_policy.cc @@ -90,7 +90,7 @@ LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=( // LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick( - PickArgs args) { + PickArgs /*args*/) { // We invoke the parent's ExitIdleLocked() via a closure instead // of doing it directly here, for two reasons: // 1. ExitIdleLocked() may cause the policy's state to change and @@ -115,7 +115,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick( } void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg, - grpc_error* error) { + grpc_error* /*error*/) { LoadBalancingPolicy* parent = static_cast(arg); parent->ExitIdleLocked(); parent->Unref(); @@ -126,7 +126,7 @@ void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg, // LoadBalancingPolicy::PickResult -LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs args) { +LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs /*args*/) { PickResult result; result.type = PickResult::PICK_FAILED; result.error = GRPC_ERROR_REF(error_); diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc index 09dd75b041f..27f5bb8c030 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc @@ -30,12 +30,12 @@ #include "src/core/lib/iomgr/error.h" #include "src/core/lib/profiling/timers.h" -static grpc_error* clr_init_channel_elem(grpc_channel_element* elem, - grpc_channel_element_args* args) { +static grpc_error* clr_init_channel_elem(grpc_channel_element* /*elem*/, + grpc_channel_element_args* /*args*/) { return GRPC_ERROR_NONE; } -static void clr_destroy_channel_elem(grpc_channel_element* elem) {} +static void clr_destroy_channel_elem(grpc_channel_element* /*elem*/) {} namespace { @@ -79,8 +79,8 @@ static grpc_error* clr_init_call_elem(grpc_call_element* elem, } static void clr_destroy_call_elem(grpc_call_element* elem, - const grpc_call_final_info* final_info, - grpc_closure* ignored) { + const grpc_call_final_info* /*final_info*/, + grpc_closure* /*ignored*/) { call_data* calld = static_cast(elem->call_data); if (calld->client_stats != nullptr) { // Record call finished, optionally setting client_failed_to_send and diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 84f5da7f9b4..49267128959 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -468,7 +468,7 @@ void client_stats_destroy(void* p) { GrpcLbClientStats* client_stats = static_cast(p); client_stats->Unref(); } -int equal_cmp(void* p1, void* p2) { +int equal_cmp(void* /*p1*/, void* /*p2*/) { // Always indicate a match, since we don't want this channel arg to // affect the subchannel's key in the index. // TODO(roth): Is this right? This does prevent us from needlessly @@ -1025,8 +1025,8 @@ void GrpcLb::BalancerCallState::OnInitialRequestSent(void* arg, GRPC_ERROR_REF(error)); } -void GrpcLb::BalancerCallState::OnInitialRequestSentLocked(void* arg, - grpc_error* error) { +void GrpcLb::BalancerCallState::OnInitialRequestSentLocked( + void* arg, grpc_error* /*error*/) { BalancerCallState* lb_calld = static_cast(arg); grpc_byte_buffer_destroy(lb_calld->send_message_payload_); lb_calld->send_message_payload_ = nullptr; @@ -1050,7 +1050,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceived(void* arg, } void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked( - void* arg, grpc_error* error) { + void* arg, grpc_error* /*error*/) { BalancerCallState* lb_calld = static_cast(arg); GrpcLb* grpclb_policy = lb_calld->grpclb_policy(); // Null payload means the LB call was cancelled. @@ -1547,7 +1547,7 @@ void GrpcLb::OnBalancerChannelConnectivityChanged(void* arg, } void GrpcLb::OnBalancerChannelConnectivityChangedLocked(void* arg, - grpc_error* error) { + grpc_error* /*error*/) { GrpcLb* self = static_cast(arg); if (!self->shutting_down_ && self->fallback_at_startup_checks_pending_) { if (self->lb_channel_connectivity_ != GRPC_CHANNEL_TRANSIENT_FAILURE) { diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc index c7237632c0a..f8197a89bfb 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc @@ -25,7 +25,7 @@ namespace grpc_core { grpc_channel_args* ModifyGrpclbBalancerChannelArgs( - const ServerAddressList& addresses, grpc_channel_args* args) { + const ServerAddressList& /*addresses*/, grpc_channel_args* args) { return args; } diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 1b14f96748c..1063167ec00 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -112,7 +112,7 @@ class PickFirst : public LoadBalancingPolicy { explicit Picker(RefCountedPtr subchannel) : subchannel_(std::move(subchannel)) {} - PickResult Pick(PickArgs args) override { + PickResult Pick(PickArgs /*args*/) override { PickResult result; result.type = PickResult::PICK_COMPLETE; result.subchannel = subchannel_; @@ -490,7 +490,7 @@ class PickFirstFactory : public LoadBalancingPolicyFactory { const char* name() const override { return kPickFirst; } RefCountedPtr ParseLoadBalancingConfig( - const grpc_json* json, grpc_error** error) const override { + const grpc_json* json, grpc_error** /*error*/) const override { if (json != nullptr) { GPR_DEBUG_ASSERT(strcmp(json->key, name()) == 0); } diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 66fa66f4eff..b567a6ba4bf 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -204,7 +204,7 @@ RoundRobin::Picker::Picker(RoundRobin* parent, } } -RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs args) { +RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs /*args*/) { last_picked_index_ = (last_picked_index_ + 1) % subchannels_.size(); if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { gpr_log(GPR_INFO, @@ -486,7 +486,7 @@ class RoundRobinFactory : public LoadBalancingPolicyFactory { const char* name() const override { return kRoundRobin; } RefCountedPtr ParseLoadBalancingConfig( - const grpc_json* json, grpc_error** error) const override { + const grpc_json* json, grpc_error** /*error*/) const override { if (json != nullptr) { GPR_DEBUG_ASSERT(strcmp(json->key, name()) == 0); } diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 5354af7acd4..70acb50cf45 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -267,7 +267,8 @@ void SubchannelData::Watcher:: template SubchannelData::SubchannelData( SubchannelList* subchannel_list, - const ServerAddress& address, RefCountedPtr subchannel) + const ServerAddress& /*address*/, + RefCountedPtr subchannel) : subchannel_list_(subchannel_list), subchannel_(std::move(subchannel)), // We assume that the current state is IDLE. If not, we'll get a @@ -286,10 +287,10 @@ void SubchannelData:: if (GRPC_TRACE_FLAG_ENABLED(*subchannel_list_->tracer())) { gpr_log(GPR_INFO, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): unreffing subchannel", + " (subchannel %p): unreffing subchannel (%s)", subchannel_list_->tracer()->name(), subchannel_list_->policy(), subchannel_list_, Index(), subchannel_list_->num_subchannels(), - subchannel_.get()); + subchannel_.get(), reason); } subchannel_.reset(); } diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc index e2e6c4f3332..362dfd9f1a1 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc @@ -77,14 +77,9 @@ constexpr char kXds[] = "xds_experimental"; class ParsedXdsConfig : public LoadBalancingPolicy::Config { public: ParsedXdsConfig(RefCountedPtr child_policy, - RefCountedPtr fallback_policy, - UniquePtr eds_service_name, - UniquePtr lrs_load_reporting_server_name) + RefCountedPtr fallback_policy) : child_policy_(std::move(child_policy)), - fallback_policy_(std::move(fallback_policy)), - eds_service_name_(std::move(eds_service_name)), - lrs_load_reporting_server_name_( - std::move(lrs_load_reporting_server_name)) {} + fallback_policy_(std::move(fallback_policy)) {} const char* name() const override { return kXds; } @@ -96,17 +91,9 @@ class ParsedXdsConfig : public LoadBalancingPolicy::Config { return fallback_policy_; } - const char* eds_service_name() const { return eds_service_name_.get(); }; - - const char* lrs_load_reporting_server_name() const { - return lrs_load_reporting_server_name_.get(); - }; - private: RefCountedPtr child_policy_; RefCountedPtr fallback_policy_; - UniquePtr eds_service_name_; - UniquePtr lrs_load_reporting_server_name_; }; class XdsLb : public LoadBalancingPolicy { @@ -124,17 +111,16 @@ class XdsLb : public LoadBalancingPolicy { // We need this wrapper for the following reasons: // 1. To process per-locality load reporting. // 2. Since pickers are UniquePtrs we use this RefCounted wrapper to control - // references to it by the xds picker and the locality. - class EndpointPickerWrapper : public RefCounted { + // references to it by the xds picker and the locality. + class PickerWrapper : public RefCounted { public: - EndpointPickerWrapper( - UniquePtr picker, - RefCountedPtr locality_stats) + PickerWrapper(UniquePtr picker, + RefCountedPtr locality_stats) : picker_(std::move(picker)), locality_stats_(std::move(locality_stats)) { locality_stats_->RefByPicker(); } - ~EndpointPickerWrapper() { locality_stats_->UnrefByPicker(); } + ~PickerWrapper() { locality_stats_->UnrefByPicker(); } PickResult Pick(PickArgs args); @@ -145,16 +131,15 @@ class XdsLb : public LoadBalancingPolicy { // The picker will use a stateless weighting algorithm to pick the locality to // use for each request. - class LocalityPicker : public SubchannelPicker { + class Picker : public SubchannelPicker { public: // Maintains a weighted list of pickers from each locality that is in ready // state. The first element in the pair represents the end of a range // proportional to the locality's weight. The start of the range is the // previous value in the vector and is 0 for the first element. using PickerList = - InlinedVector>, - 1>; - LocalityPicker(RefCountedPtr xds_policy, PickerList pickers) + InlinedVector>, 1>; + Picker(RefCountedPtr xds_policy, PickerList pickers) : xds_policy_(std::move(xds_policy)), pickers_(std::move(pickers)), drop_config_(xds_policy_->drop_config_) {} @@ -219,7 +204,7 @@ class XdsLb : public LoadBalancingPolicy { return connectivity_state_; } uint32_t weight() const { return weight_; } - RefCountedPtr picker_wrapper() const { + RefCountedPtr picker_wrapper() const { return picker_wrapper_; } @@ -271,7 +256,7 @@ class XdsLb : public LoadBalancingPolicy { RefCountedPtr name_; OrphanablePtr child_policy_; OrphanablePtr pending_child_policy_; - RefCountedPtr picker_wrapper_; + RefCountedPtr picker_wrapper_; grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE; uint32_t weight_; @@ -392,24 +377,16 @@ class XdsLb : public LoadBalancingPolicy { const char* name, const grpc_channel_args* args); void MaybeExitFallbackMode(); - const char* eds_service_name() const { - if (config_ != nullptr && config_->eds_service_name() != nullptr) { - return config_->eds_service_name(); - } - return server_name_.get(); - } - XdsClient* xds_client() const { return xds_client_from_channel_ != nullptr ? xds_client_from_channel_.get() : xds_client_.get(); } - // Server name from target URI. - UniquePtr server_name_; + // Name of the backend server to connect to. + const char* server_name_ = nullptr; - // Current channel args and config from the resolver. + // Current channel args from the resolver. const grpc_channel_args* args_ = nullptr; - RefCountedPtr config_; // Internal state. bool shutting_down_ = false; @@ -441,10 +418,14 @@ class XdsLb : public LoadBalancingPolicy { grpc_timer lb_fallback_timer_; grpc_closure lb_on_fallback_; + // The policy to use for the fallback backends. + RefCountedPtr fallback_policy_config_; // Non-null iff we are in fallback mode. OrphanablePtr fallback_policy_; OrphanablePtr pending_fallback_policy_; + // The policy to use for the backends. + RefCountedPtr child_policy_config_; const grpc_millis locality_retention_interval_ms_; const grpc_millis locality_map_failover_timeout_ms_; // A list of locality maps indexed by priority. @@ -460,10 +441,10 @@ class XdsLb : public LoadBalancingPolicy { }; // -// XdsLb::EndpointPickerWrapper +// XdsLb::PickerWrapper::Pick // -LoadBalancingPolicy::PickResult XdsLb::EndpointPickerWrapper::Pick( +LoadBalancingPolicy::PickResult XdsLb::PickerWrapper::Pick( LoadBalancingPolicy::PickArgs args) { // Forward the pick to the picker returned from the child policy. PickResult result = picker_->Pick(args); @@ -479,8 +460,8 @@ LoadBalancingPolicy::PickResult XdsLb::EndpointPickerWrapper::Pick( result.recv_trailing_metadata_ready = // Note: This callback does not run in either the control plane // combiner or in the data plane mutex. - [locality_stats](grpc_error* error, MetadataInterface* metadata, - CallState* call_state) { + [locality_stats](grpc_error* error, MetadataInterface* /*metadata*/, + CallState* /*call_state*/) { const bool call_failed = error != GRPC_ERROR_NONE; locality_stats->AddCallFinished(call_failed); locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call"); @@ -489,10 +470,10 @@ LoadBalancingPolicy::PickResult XdsLb::EndpointPickerWrapper::Pick( } // -// XdsLb::LocalityPicker +// XdsLb::Picker // -XdsLb::PickResult XdsLb::LocalityPicker::Pick(PickArgs args) { +XdsLb::PickResult XdsLb::Picker::Pick(PickArgs args) { // Handle drop. const UniquePtr* drop_category; if (drop_config_->ShouldDrop(&drop_category)) { @@ -508,8 +489,8 @@ XdsLb::PickResult XdsLb::LocalityPicker::Pick(PickArgs args) { return PickFromLocality(key, args); } -XdsLb::PickResult XdsLb::LocalityPicker::PickFromLocality(const uint32_t key, - PickArgs args) { +XdsLb::PickResult XdsLb::Picker::PickFromLocality(const uint32_t key, + PickArgs args) { size_t mid = 0; size_t start_index = 0; size_t end_index = pickers_.size() - 1; @@ -705,11 +686,11 @@ XdsLb::XdsLb(Args args) GPR_ASSERT(server_uri != nullptr); grpc_uri* uri = grpc_uri_parse(server_uri, true); GPR_ASSERT(uri->path[0] != '\0'); - server_name_.reset( - gpr_strdup(uri->path[0] == '/' ? uri->path + 1 : uri->path)); + server_name_ = gpr_strdup(uri->path[0] == '/' ? uri->path + 1 : uri->path); if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { - gpr_log(GPR_INFO, "[xdslb %p] server name from channel: %s", this, - server_name_.get()); + gpr_log(GPR_INFO, + "[xdslb %p] Will use '%s' as the server name for LB request.", this, + server_name_); } grpc_uri_destroy(uri); } @@ -718,6 +699,7 @@ XdsLb::~XdsLb() { if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { gpr_log(GPR_INFO, "[xdslb %p] destroying xds LB policy", this); } + gpr_free((void*)server_name_); grpc_channel_args_destroy(args_); } @@ -740,13 +722,9 @@ void XdsLb::ShutdownLocked() { pending_fallback_policy_.reset(); // Cancel the endpoint watch here instead of in our dtor, because the // watcher holds a ref to us. - xds_client()->CancelEndpointDataWatch(StringView(eds_service_name()), + xds_client()->CancelEndpointDataWatch(StringView(server_name_), endpoint_watcher_); - if (config_->lrs_load_reporting_server_name() != nullptr) { - xds_client()->RemoveClientStats( - StringView(config_->lrs_load_reporting_server_name()), - StringView(eds_service_name()), &client_stats_); - } + xds_client()->RemoveClientStats(StringView(server_name_), &client_stats_); xds_client_from_channel_.reset(); xds_client_.reset(); } @@ -775,9 +753,9 @@ void XdsLb::UpdateLocked(UpdateArgs args) { } const bool is_initial_update = args_ == nullptr; // Update config. - const char* old_eds_service_name = eds_service_name(); - auto old_config = std::move(config_); - config_ = std::move(args.config); + auto* xds_config = static_cast(args.config.get()); + child_policy_config_ = xds_config->child_policy(); + fallback_policy_config_ = xds_config->fallback_policy(); // Update fallback address list. fallback_backend_addresses_ = std::move(args.addresses); // Update args. @@ -794,7 +772,7 @@ void XdsLb::UpdateLocked(UpdateArgs args) { if (xds_client_from_channel_ == nullptr) { grpc_error* error = GRPC_ERROR_NONE; xds_client_ = MakeOrphanable( - combiner(), interested_parties(), StringView(eds_service_name()), + combiner(), interested_parties(), StringView(server_name_), nullptr /* service config watcher */, *args_, &error); // TODO(roth): If we decide that we care about fallback mode, add // proper error handling here. @@ -804,6 +782,11 @@ void XdsLb::UpdateLocked(UpdateArgs args) { xds_client_.get()); } } + auto watcher = MakeUnique(Ref()); + endpoint_watcher_ = watcher.get(); + xds_client()->WatchEndpointData(StringView(server_name_), + std::move(watcher)); + xds_client()->AddClientStats(StringView(server_name_), &client_stats_); // Start fallback-at-startup checks. grpc_millis deadline = ExecCtx::Get()->Now() + lb_fallback_timeout_ms_; Ref(DEBUG_LOCATION, "on_fallback_timer").release(); // Held by closure @@ -812,42 +795,6 @@ void XdsLb::UpdateLocked(UpdateArgs args) { fallback_at_startup_checks_pending_ = true; grpc_timer_init(&lb_fallback_timer_, deadline, &lb_on_fallback_); } - // Update endpoint watcher if needed. - if (is_initial_update || - strcmp(old_eds_service_name, eds_service_name()) != 0) { - if (!is_initial_update) { - xds_client()->CancelEndpointDataWatch(StringView(old_eds_service_name), - endpoint_watcher_); - } - auto watcher = MakeUnique(Ref()); - endpoint_watcher_ = watcher.get(); - xds_client()->WatchEndpointData(StringView(eds_service_name()), - std::move(watcher)); - } - // Update load reporting if needed. - // TODO(roth): Ideally, we should not collect any stats if load reporting - // is disabled, which would require changing this code to recreate - // all of the pickers whenever load reporting is enabled or disabled - // here. - if (is_initial_update || - (config_->lrs_load_reporting_server_name() == nullptr) != - (old_config->lrs_load_reporting_server_name() == nullptr) || - (config_->lrs_load_reporting_server_name() != nullptr && - old_config->lrs_load_reporting_server_name() != nullptr && - strcmp(config_->lrs_load_reporting_server_name(), - old_config->lrs_load_reporting_server_name()) != 0)) { - if (old_config != nullptr && - old_config->lrs_load_reporting_server_name() != nullptr) { - xds_client()->RemoveClientStats( - StringView(old_config->lrs_load_reporting_server_name()), - StringView(old_eds_service_name), &client_stats_); - } - if (config_->lrs_load_reporting_server_name() != nullptr) { - xds_client()->AddClientStats( - StringView(config_->lrs_load_reporting_server_name()), - StringView(eds_service_name()), &client_stats_); - } - } } // @@ -892,7 +839,9 @@ void XdsLb::UpdateFallbackPolicyLocked() { // Construct update args. UpdateArgs update_args; update_args.addresses = fallback_backend_addresses_; - update_args.config = config_->fallback_policy(); + update_args.config = fallback_policy_config_ == nullptr + ? nullptr + : fallback_policy_config_->Ref(); update_args.args = grpc_channel_args_copy(args_); // If the child policy name changes, we need to create a new child // policy. When this happens, we leave child_policy_ as-is and store @@ -943,9 +892,9 @@ void XdsLb::UpdateFallbackPolicyLocked() { // that was there before, which will be immediately shut down) // and will later be swapped into child_policy_ by the helper // when the new child transitions into state READY. - const char* fallback_policy_name = update_args.config == nullptr + const char* fallback_policy_name = fallback_policy_config_ == nullptr ? "round_robin" - : update_args.config->name(); + : fallback_policy_config_->name(); const bool create_policy = // case 1 fallback_policy_ == nullptr || @@ -1226,7 +1175,7 @@ void XdsLb::PriorityList::LocalityMap::UpdateXdsPickerLocked() { // that are ready. Each locality is represented by a portion of the range // proportional to its weight, such that the total range is the sum of the // weights of all localities. - LocalityPicker::PickerList picker_list; + Picker::PickerList picker_list; uint32_t end = 0; for (const auto& p : localities_) { const auto& locality_name = p.first; @@ -1238,9 +1187,9 @@ void XdsLb::PriorityList::LocalityMap::UpdateXdsPickerLocked() { picker_list.push_back(std::make_pair(end, locality->picker_wrapper())); } xds_policy()->channel_control_helper()->UpdateState( - GRPC_CHANNEL_READY, MakeUnique( - xds_policy_->Ref(DEBUG_LOCATION, "XdsLb+Picker"), - std::move(picker_list))); + GRPC_CHANNEL_READY, + MakeUnique(xds_policy_->Ref(DEBUG_LOCATION, "XdsLb+Picker"), + std::move(picker_list))); } OrphanablePtr @@ -1541,7 +1490,9 @@ void XdsLb::PriorityList::LocalityMap::Locality::UpdateLocked( // Construct update args. UpdateArgs update_args; update_args.addresses = std::move(serverlist); - update_args.config = xds_policy()->config_->child_policy(); + update_args.config = xds_policy()->child_policy_config_ == nullptr + ? nullptr + : xds_policy()->child_policy_config_->Ref(); update_args.args = CreateChildPolicyArgsLocked(xds_policy()->args_); // If the child policy name changes, we need to create a new child // policy. When this happens, we leave child_policy_ as-is and store @@ -1594,9 +1545,10 @@ void XdsLb::PriorityList::LocalityMap::Locality::UpdateLocked( // when the new child transitions into state READY. // TODO(juanlishen): If the child policy is not configured via service config, // use whatever algorithm is specified by the balancer. - const char* child_policy_name = update_args.config == nullptr - ? "round_robin" - : update_args.config->name(); + const char* child_policy_name = + xds_policy()->child_policy_config_ == nullptr + ? "round_robin" + : xds_policy()->child_policy_config_->name(); const bool create_policy = // case 1 child_policy_ == nullptr || @@ -1763,11 +1715,7 @@ void XdsLb::PriorityList::LocalityMap::Locality::Helper::UpdateState( return; } // Cache the picker and its state in the locality. - // TODO(roth): If load reporting is not configured, we should ideally - // pass a null LocalityStats ref to the EndpointPickerWrapper and have it - // not collect any stats, since they're not going to be used. This would - // require recreating all of the pickers whenever we get a config update. - locality_->picker_wrapper_ = MakeRefCounted( + locality_->picker_wrapper_ = MakeRefCounted( std::move(picker), locality_->xds_policy()->client_stats_.FindLocalityStats( locality_->name_)); @@ -1814,8 +1762,6 @@ class XdsFactory : public LoadBalancingPolicyFactory { InlinedVector error_list; RefCountedPtr child_policy; RefCountedPtr fallback_policy; - const char* eds_service_name = nullptr; - const char* lrs_load_reporting_server_name = nullptr; for (const grpc_json* field = json->child; field != nullptr; field = field->next) { if (field->key == nullptr) continue; @@ -1843,35 +1789,11 @@ class XdsFactory : public LoadBalancingPolicyFactory { GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE); error_list.push_back(parse_error); } - } else if (strcmp(field->key, "edsServiceName") == 0) { - if (eds_service_name != nullptr) { - error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "field:edsServiceName error:Duplicate entry")); - } - if (field->type != GRPC_JSON_STRING) { - error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "field:edsServiceName error:type should be string")); - continue; - } - eds_service_name = field->value; - } else if (strcmp(field->key, "lrsLoadReportingServerName") == 0) { - if (lrs_load_reporting_server_name != nullptr) { - error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "field:lrsLoadReportingServerName error:Duplicate entry")); - } - if (field->type != GRPC_JSON_STRING) { - error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "field:lrsLoadReportingServerName error:type should be string")); - continue; - } - lrs_load_reporting_server_name = field->value; } } if (error_list.empty()) { - return MakeRefCounted( - std::move(child_policy), std::move(fallback_policy), - UniquePtr(gpr_strdup(eds_service_name)), - UniquePtr(gpr_strdup(lrs_load_reporting_server_name))); + return RefCountedPtr(New( + std::move(child_policy), std::move(fallback_policy))); } else { *error = GRPC_ERROR_CREATE_FROM_VECTOR("Xds Parser", &error_list); return nullptr; diff --git a/src/core/ext/filters/client_channel/local_subchannel_pool.cc b/src/core/ext/filters/client_channel/local_subchannel_pool.cc index d1c1cacb441..e94ede0b9cb 100644 --- a/src/core/ext/filters/client_channel/local_subchannel_pool.cc +++ b/src/core/ext/filters/client_channel/local_subchannel_pool.cc @@ -62,26 +62,26 @@ Subchannel* LocalSubchannelPool::FindSubchannel(SubchannelKey* key) { namespace { -void sck_avl_destroy(void* p, void* user_data) { +void sck_avl_destroy(void* p, void* /*user_data*/) { SubchannelKey* key = static_cast(p); Delete(key); } -void* sck_avl_copy(void* p, void* unused) { +void* sck_avl_copy(void* p, void* /*unused*/) { const SubchannelKey* key = static_cast(p); auto new_key = New(*key); return static_cast(new_key); } -long sck_avl_compare(void* a, void* b, void* unused) { +long sck_avl_compare(void* a, void* b, void* /*unused*/) { const SubchannelKey* key_a = static_cast(a); const SubchannelKey* key_b = static_cast(b); return key_a->Cmp(*key_b); } -void scv_avl_destroy(void* p, void* user_data) {} +void scv_avl_destroy(void* /*p*/, void* /*user_data*/) {} -void* scv_avl_copy(void* p, void* unused) { return p; } +void* scv_avl_copy(void* p, void* /*unused*/) { return p; } } // namespace diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc index 7b142f79001..7500fa189d2 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -451,7 +451,7 @@ void AresDnsResolver::StartResolvingLocked() { class AresDnsResolverFactory : public ResolverFactory { public: - bool IsValidUri(const grpc_uri* uri) const override { return true; } + bool IsValidUri(const grpc_uri* /*uri*/) const override { return true; } OrphanablePtr CreateResolver(ResolverArgs args) const override { return MakeOrphanable(std::move(args)); diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc index cb2ab885807..621db723dc7 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc @@ -138,7 +138,7 @@ static void on_timeout_locked(void* arg, grpc_error* error); static void on_ares_backup_poll_alarm(void* arg, grpc_error* error); static void on_ares_backup_poll_alarm_locked(void* arg, grpc_error* error); -static void noop_inject_channel_config(ares_channel channel) {} +static void noop_inject_channel_config(ares_channel /*channel*/) {} void (*grpc_ares_test_only_inject_config)(ares_channel channel) = noop_inject_channel_config; diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc index e588010badb..e185116e222 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc @@ -90,14 +90,14 @@ class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory { public: GrpcPolledFd* NewGrpcPolledFdLocked(ares_socket_t as, grpc_pollset_set* driver_pollset_set, - Combiner* combiner) override { + Combiner* /*combiner*/) override { return New(as, driver_pollset_set); } - void ConfigureAresChannelLocked(ares_channel channel) override {} + void ConfigureAresChannelLocked(ares_channel /*channel*/) override {} }; -UniquePtr NewGrpcPolledFdFactory(Combiner* combiner) { +UniquePtr NewGrpcPolledFdFactory(Combiner* /*combiner*/) { return MakeUnique(); } diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index fc1bca76de9..381cbf63b9c 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -175,7 +175,7 @@ static void destroy_hostbyname_request_locked( gpr_free(hr); } -static void on_hostbyname_done_locked(void* arg, int status, int timeouts, +static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/, struct hostent* hostent) { grpc_ares_hostbyname_request* hr = static_cast(arg); @@ -248,7 +248,7 @@ static void on_hostbyname_done_locked(void* arg, int status, int timeouts, destroy_hostbyname_request_locked(hr); } -static void on_srv_query_done_locked(void* arg, int status, int timeouts, +static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/, unsigned char* abuf, int alen) { grpc_ares_request* r = static_cast(arg); if (status == ARES_SUCCESS) { @@ -293,7 +293,7 @@ static void on_srv_query_done_locked(void* arg, int status, int timeouts, static const char g_service_config_attribute_prefix[] = "grpc_config="; -static void on_txt_done_locked(void* arg, int status, int timeouts, +static void on_txt_done_locked(void* arg, int status, int /*timeouts*/, unsigned char* buf, int len) { char* error_msg; grpc_ares_request* r = static_cast(arg); @@ -579,8 +579,8 @@ static bool grpc_ares_maybe_resolve_localhost_manually_locked( } #else /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */ static bool grpc_ares_maybe_resolve_localhost_manually_locked( - const char* name, const char* default_port, - grpc_core::UniquePtr* addrs) { + const char* /*name*/, const char* /*default_port*/, + grpc_core::UniquePtr* /*addrs*/) { return false; } #endif /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */ @@ -728,7 +728,7 @@ static void on_dns_lookup_done(void* arg, grpc_error* error) { } static void grpc_resolve_address_invoke_dns_lookup_ares_locked( - void* arg, grpc_error* unused_error) { + void* arg, grpc_error* /*unused_error*/) { grpc_resolve_address_ares_request* r = static_cast(arg); GRPC_CLOSURE_INIT(&r->on_dns_lookup_done_locked, on_dns_lookup_done, r, diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc index 83b16afbd00..bba9bb749c7 100644 --- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc @@ -159,7 +159,7 @@ void FakeResolver::MaybeSendResultLocked() { } } -void FakeResolver::ReturnReresolutionResult(void* arg, grpc_error* error) { +void FakeResolver::ReturnReresolutionResult(void* arg, grpc_error* /*error*/) { FakeResolver* self = static_cast(arg); self->reresolution_closure_pending_ = false; self->MaybeSendResultLocked(); @@ -183,7 +183,7 @@ struct SetResponseClosureArg { }; void FakeResolverResponseGenerator::SetResponseLocked(void* arg, - grpc_error* error) { + grpc_error* /*error*/) { SetResponseClosureArg* closure_arg = static_cast(arg); auto& resolver = closure_arg->resolver; if (!resolver->shutdown_) { @@ -215,7 +215,7 @@ void FakeResolverResponseGenerator::SetResponse(Resolver::Result result) { } void FakeResolverResponseGenerator::SetReresolutionResponseLocked( - void* arg, grpc_error* error) { + void* arg, grpc_error* /*error*/) { SetResponseClosureArg* closure_arg = static_cast(arg); auto& resolver = closure_arg->resolver; if (!resolver->shutdown_) { @@ -259,7 +259,7 @@ void FakeResolverResponseGenerator::UnsetReresolutionResponse() { } void FakeResolverResponseGenerator::SetFailureLocked(void* arg, - grpc_error* error) { + grpc_error* /*error*/) { SetResponseClosureArg* closure_arg = static_cast(arg); auto& resolver = closure_arg->resolver; if (!resolver->shutdown_) { @@ -371,7 +371,7 @@ namespace { class FakeResolverFactory : public ResolverFactory { public: - bool IsValidUri(const grpc_uri* uri) const override { return true; } + bool IsValidUri(const grpc_uri* /*uri*/) const override { return true; } OrphanablePtr CreateResolver(ResolverArgs args) const override { return MakeOrphanable(std::move(args)); diff --git a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc index ece5ffe86d4..066e3fd0b49 100644 --- a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc @@ -78,7 +78,7 @@ void SockaddrResolver::StartLocked() { // Factory // -void DoNothing(void* ignored) {} +void DoNothing(void* /*ignored*/) {} bool ParseUri(const grpc_uri* uri, bool parse(const grpc_uri* uri, grpc_resolved_address* dst), @@ -160,7 +160,7 @@ class UnixResolverFactory : public ResolverFactory { return CreateSockaddrResolver(std::move(args), grpc_parse_unix); } - UniquePtr GetDefaultAuthority(grpc_uri* uri) const override { + UniquePtr GetDefaultAuthority(grpc_uri* /*uri*/) const override { return UniquePtr(gpr_strdup("localhost")); } diff --git a/src/core/ext/filters/client_channel/resolving_lb_policy.cc b/src/core/ext/filters/client_channel/resolving_lb_policy.cc index a2b946bb5c6..9cac0ed702c 100644 --- a/src/core/ext/filters/client_channel/resolving_lb_policy.cc +++ b/src/core/ext/filters/client_channel/resolving_lb_policy.cc @@ -152,7 +152,8 @@ class ResolvingLoadBalancingPolicy::ResolvingControlHelper } } - void AddTraceEvent(TraceSeverity severity, StringView message) override {} + void AddTraceEvent(TraceSeverity /*severity*/, + StringView /*message*/) override {} void set_child(LoadBalancingPolicy* child) { child_ = child; } diff --git a/src/core/ext/filters/client_channel/resolving_lb_policy.h b/src/core/ext/filters/client_channel/resolving_lb_policy.h index d8447c18cf5..342a30e88a5 100644 --- a/src/core/ext/filters/client_channel/resolving_lb_policy.h +++ b/src/core/ext/filters/client_channel/resolving_lb_policy.h @@ -74,7 +74,7 @@ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy { // No-op -- should never get updates from the channel. // TODO(roth): Need to support updating child LB policy's config for xds // use case. - void UpdateLocked(UpdateArgs args) override {} + void UpdateLocked(UpdateArgs /*args*/) override {} void ExitIdleLocked() override; diff --git a/src/core/ext/filters/client_channel/retry_throttle.cc b/src/core/ext/filters/client_channel/retry_throttle.cc index bdeb7e4cacd..65df8034d71 100644 --- a/src/core/ext/filters/client_channel/retry_throttle.cc +++ b/src/core/ext/filters/client_channel/retry_throttle.cc @@ -118,27 +118,27 @@ void ServerRetryThrottleData::RecordSuccess() { namespace { -void* copy_server_name(void* key, void* unused) { +void* copy_server_name(void* key, void* /*unused*/) { return gpr_strdup(static_cast(key)); } -long compare_server_name(void* key1, void* key2, void* unused) { +long compare_server_name(void* key1, void* key2, void* /*unused*/) { return strcmp(static_cast(key1), static_cast(key2)); } -void destroy_server_retry_throttle_data(void* value, void* unused) { +void destroy_server_retry_throttle_data(void* value, void* /*unused*/) { ServerRetryThrottleData* throttle_data = static_cast(value); throttle_data->Unref(); } -void* copy_server_retry_throttle_data(void* value, void* unused) { +void* copy_server_retry_throttle_data(void* value, void* /*unused*/) { ServerRetryThrottleData* throttle_data = static_cast(value); return throttle_data->Ref().release(); } -void destroy_server_name(void* key, void* unused) { gpr_free(key); } +void destroy_server_name(void* key, void* /*unused*/) { gpr_free(key); } const grpc_avl_vtable avl_vtable = { destroy_server_name, copy_server_name, compare_server_name, diff --git a/src/core/ext/filters/client_channel/service_config.h b/src/core/ext/filters/client_channel/service_config.h index 9c13917e620..1eac424d628 100644 --- a/src/core/ext/filters/client_channel/service_config.h +++ b/src/core/ext/filters/client_channel/service_config.h @@ -71,12 +71,16 @@ class ServiceConfig : public RefCounted { virtual UniquePtr ParseGlobalParams( const grpc_json* /* json */, grpc_error** error) { + // Avoid unused parameter warning on debug-only parameter + (void)error; GPR_DEBUG_ASSERT(error != nullptr); return nullptr; } virtual UniquePtr ParsePerMethodParams( const grpc_json* /* json */, grpc_error** error) { + // Avoid unused parameter warning on debug-only parameter + (void)error; GPR_DEBUG_ASSERT(error != nullptr); return nullptr; } diff --git a/src/core/ext/filters/client_channel/xds/xds_api.cc b/src/core/ext/filters/client_channel/xds/xds_api.cc index eeb6145c8f2..389970466a0 100644 --- a/src/core/ext/filters/client_channel/xds/xds_api.cc +++ b/src/core/ext/filters/client_channel/xds/xds_api.cc @@ -30,7 +30,6 @@ #include "envoy/api/v2/core/address.upb.h" #include "envoy/api/v2/core/base.upb.h" -#include "envoy/api/v2/core/health_check.upb.h" #include "envoy/api/v2/discovery.upb.h" #include "envoy/api/v2/eds.upb.h" #include "envoy/api/v2/endpoint/endpoint.upb.h" @@ -224,13 +223,6 @@ namespace { grpc_error* ServerAddressParseAndAppend( const envoy_api_v2_endpoint_LbEndpoint* lb_endpoint, ServerAddressList* list) { - // If health_status is not HEALTHY or UNKNOWN, skip this endpoint. - const int32_t health_status = - envoy_api_v2_endpoint_LbEndpoint_health_status(lb_endpoint); - if (health_status != envoy_api_v2_core_UNKNOWN && - health_status != envoy_api_v2_core_HEALTHY) { - return GRPC_ERROR_NONE; - } // Find the ip:port. const envoy_api_v2_endpoint_Endpoint* endpoint = envoy_api_v2_endpoint_LbEndpoint_endpoint(lb_endpoint); diff --git a/src/core/ext/filters/client_channel/xds/xds_client.cc b/src/core/ext/filters/client_channel/xds/xds_client.cc index 2f09e12ab94..7bb835071a6 100644 --- a/src/core/ext/filters/client_channel/xds/xds_client.cc +++ b/src/core/ext/filters/client_channel/xds/xds_client.cc @@ -736,11 +736,8 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked( } } // Start load reporting if needed. - auto& lrs_call = ads_calld->chand()->lrs_calld_; - if (lrs_call != nullptr) { - LrsCallState* lrs_calld = lrs_call->calld(); - if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked(); - } + LrsCallState* lrs_calld = ads_calld->chand()->lrs_calld_->calld(); + if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked(); // Ignore identical update. const EdsUpdate& prev_update = xds_client->cluster_state_.eds_update; const bool priority_list_changed = @@ -1322,18 +1319,14 @@ void XdsClient::CancelEndpointDataWatch(StringView cluster, } } -void XdsClient::AddClientStats(StringView lrs_server, StringView cluster, +void XdsClient::AddClientStats(StringView cluster, XdsClientStats* client_stats) { - // TODO(roth): When we add support for direct federation, use the - // server name specified in lrs_server. cluster_state_.client_stats.insert(client_stats); chand_->MaybeStartLrsCall(); } -void XdsClient::RemoveClientStats(StringView lrs_server, StringView cluster, +void XdsClient::RemoveClientStats(StringView cluster, XdsClientStats* client_stats) { - // TODO(roth): When we add support for direct federation, use the - // server name specified in lrs_server. // TODO(roth): In principle, we should try to send a final load report // containing whatever final stats have been accumulated since the // last load report. @@ -1372,9 +1365,7 @@ void XdsClient::NotifyOnServiceConfig(void* arg, grpc_error* error) { static const char* json = "{\n" " \"loadBalancingConfig\":[\n" - " { \"xds_experimental\":{\n" - " \"lrsLoadReportingServerName\": \"\"\n" - " } }\n" + " { \"xds_experimental\":{} }\n" " ]\n" "}"; RefCountedPtr service_config = diff --git a/src/core/ext/filters/client_channel/xds/xds_client.h b/src/core/ext/filters/client_channel/xds/xds_client.h index c5fc08cf0c2..d2d9dc7558a 100644 --- a/src/core/ext/filters/client_channel/xds/xds_client.h +++ b/src/core/ext/filters/client_channel/xds/xds_client.h @@ -100,10 +100,8 @@ class XdsClient : public InternallyRefCounted { EndpointWatcherInterface* watcher); // Adds and removes client stats for cluster. - void AddClientStats(StringView lrs_server, StringView cluster, - XdsClientStats* client_stats); - void RemoveClientStats(StringView lrs_server, StringView cluster, - XdsClientStats* client_stats); + void AddClientStats(StringView cluster, XdsClientStats* client_stats); + void RemoveClientStats(StringView cluster, XdsClientStats* client_stats); // Resets connection backoff state. void ResetBackoff(); @@ -210,9 +208,8 @@ class XdsClient : public InternallyRefCounted { // The channel for communicating with the xds server. OrphanablePtr chand_; - // TODO(juanlishen): As part of adding CDS support, replace - // cluster_state_ with a map keyed by cluster name, so that we can - // support multiple clusters for both CDS and EDS. + // TODO(roth): When we need support for multiple clusters, replace + // cluster_state_ with a map keyed by cluster name. ClusterState cluster_state_; // Map clusters_; diff --git a/src/core/ext/filters/message_size/message_size_filter.cc b/src/core/ext/filters/message_size/message_size_filter.cc index 7e6c71de77e..f13efd76236 100644 --- a/src/core/ext/filters/message_size/message_size_filter.cc +++ b/src/core/ext/filters/message_size/message_size_filter.cc @@ -286,8 +286,8 @@ static grpc_error* message_size_init_call_elem( // Destructor for call_data. static void message_size_destroy_call_elem( - grpc_call_element* elem, const grpc_call_final_info* final_info, - grpc_closure* ignored) { + grpc_call_element* elem, const grpc_call_final_info* /*final_info*/, + grpc_closure* /*ignored*/) { call_data* calld = (call_data*)elem->call_data; calld->~call_data(); } @@ -375,7 +375,7 @@ const grpc_channel_filter grpc_message_size_filter = { // Used for GRPC_CLIENT_SUBCHANNEL static bool maybe_add_message_size_filter_subchannel( - grpc_channel_stack_builder* builder, void* arg) { + grpc_channel_stack_builder* builder, void* /*arg*/) { const grpc_channel_args* channel_args = grpc_channel_stack_builder_get_channel_arguments(builder); if (grpc_channel_args_want_minimal_stack(channel_args)) { @@ -388,7 +388,7 @@ static bool maybe_add_message_size_filter_subchannel( // Used for GRPC_CLIENT_DIRECT_CHANNEL and GRPC_SERVER_CHANNEL. Adds the filter // only if message size limits or service config is specified. static bool maybe_add_message_size_filter(grpc_channel_stack_builder* builder, - void* arg) { + void* /*arg*/) { const grpc_channel_args* channel_args = grpc_channel_stack_builder_get_channel_arguments(builder); bool enable = false; diff --git a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc index 0426e008e40..ee491411cfd 100644 --- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +++ b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc @@ -105,7 +105,7 @@ static void cronet_compression_start_transport_stream_op_batch( // Constructor for call_data. static grpc_error* cronet_compression_init_call_elem( - grpc_call_element* elem, const grpc_call_element_args* args) { + grpc_call_element* elem, const grpc_call_element_args* /*args*/) { call_data* calld = static_cast(elem->call_data); calld->next_recv_initial_metadata_ready = nullptr; calld->workaround_active = false; @@ -117,18 +117,18 @@ static grpc_error* cronet_compression_init_call_elem( // Destructor for call_data. static void cronet_compression_destroy_call_elem( - grpc_call_element* elem, const grpc_call_final_info* final_info, - grpc_closure* ignored) {} + grpc_call_element* /*elem*/, const grpc_call_final_info* /*final_info*/, + grpc_closure* /*ignored*/) {} // Constructor for channel_data. static grpc_error* cronet_compression_init_channel_elem( - grpc_channel_element* elem, grpc_channel_element_args* args) { + grpc_channel_element* /*elem*/, grpc_channel_element_args* /*args*/) { return GRPC_ERROR_NONE; } // Destructor for channel_data. static void cronet_compression_destroy_channel_elem( - grpc_channel_element* elem) {} + grpc_channel_element* /*elem*/) {} // Parse the user agent static bool parse_user_agent(grpc_mdelem md) { @@ -183,7 +183,7 @@ const grpc_channel_filter grpc_workaround_cronet_compression_filter = { "workaround_cronet_compression"}; static bool register_workaround_cronet_compression( - grpc_channel_stack_builder* builder, void* arg) { + grpc_channel_stack_builder* builder, void* /*arg*/) { const grpc_channel_args* channel_args = grpc_channel_stack_builder_get_channel_arguments(builder); const grpc_arg* a = grpc_channel_args_find( diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index c0ae64eb2cc..4761af78bcf 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -240,7 +240,7 @@ static void on_accept(void* arg, grpc_endpoint* tcp, } /* Server callback: start listening on our ports */ -static void server_start_listener(grpc_server* server, void* arg, +static void server_start_listener(grpc_server* /*server*/, void* arg, grpc_pollset** pollsets, size_t pollset_count) { server_state* state = static_cast(arg); @@ -276,7 +276,7 @@ static void tcp_server_shutdown_complete(void* arg, grpc_error* error) { /* Server callback: destroy the tcp listener (so we don't generate further callbacks) */ -static void server_destroy_listener(grpc_server* server, void* arg, +static void server_destroy_listener(grpc_server* /*server*/, void* arg, grpc_closure* destroy_done) { server_state* state = static_cast(arg); gpr_mu_lock(&state->mu); diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 40cf83e44e7..0936ee854cc 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -525,7 +525,7 @@ grpc_chttp2_transport::grpc_chttp2_transport( post_benign_reclaimer(this); } -static void destroy_transport_locked(void* tp, grpc_error* error) { +static void destroy_transport_locked(void* tp, grpc_error* /*error*/) { grpc_chttp2_transport* t = static_cast(tp); t->destroying = 1; close_transport_locked( @@ -718,7 +718,7 @@ static int init_stream(grpc_transport* gt, grpc_stream* gs, return 0; } -static void destroy_stream_locked(void* sp, grpc_error* error) { +static void destroy_stream_locked(void* sp, grpc_error* /*error*/) { GPR_TIMER_SCOPE("destroy_stream", 0); grpc_chttp2_stream* s = static_cast(sp); s->~grpc_chttp2_stream(); @@ -935,7 +935,7 @@ static const char* begin_writing_desc(bool partial) { } } -static void write_action_begin_locked(void* gt, grpc_error* error_ignored) { +static void write_action_begin_locked(void* gt, grpc_error* /*error_ignored*/) { GPR_TIMER_SCOPE("write_action_begin_locked", 0); grpc_chttp2_transport* t = static_cast(gt); GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE); @@ -974,7 +974,7 @@ static void write_action_begin_locked(void* gt, grpc_error* error_ignored) { } } -static void write_action(void* gt, grpc_error* error) { +static void write_action(void* gt, grpc_error* /*error*/) { GPR_TIMER_SCOPE("write_action", 0); grpc_chttp2_transport* t = static_cast(gt); void* cl = t->cl; @@ -1181,7 +1181,7 @@ static void null_then_sched_closure(grpc_closure** closure) { } void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t, - grpc_chttp2_stream* s, + grpc_chttp2_stream* /*s*/, grpc_closure** pclosure, grpc_error* error, const char* desc) { grpc_closure* closure = *pclosure; @@ -1338,7 +1338,7 @@ static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id, } static void perform_stream_op_locked(void* stream_op, - grpc_error* error_ignored) { + grpc_error* /*error_ignored*/) { GPR_TIMER_SCOPE("perform_stream_op_locked", 0); grpc_transport_stream_op_batch* op = @@ -1792,7 +1792,7 @@ void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) { } static void perform_transport_op_locked(void* stream_op, - grpc_error* error_ignored) { + grpc_error* /*error_ignored*/) { grpc_transport_op* op = static_cast(stream_op); grpc_chttp2_transport* t = static_cast(op->handler_private.extra_arg); @@ -1854,8 +1854,8 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) { * INPUT PROCESSING - GENERAL */ -void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t, - grpc_chttp2_stream* s) { +void grpc_chttp2_maybe_complete_recv_initial_metadata( + grpc_chttp2_transport* /*t*/, grpc_chttp2_stream* s) { if (s->recv_initial_metadata_ready != nullptr && s->published_metadata[0] != GRPC_METADATA_NOT_PUBLISHED) { if (s->seen_error) { @@ -1871,7 +1871,7 @@ void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t, } } -void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t, +void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* /*t*/, grpc_chttp2_stream* s) { grpc_error* error = GRPC_ERROR_NONE; if (s->recv_message_ready != nullptr) { @@ -2400,7 +2400,7 @@ typedef struct { grpc_chttp2_transport* t; } cancel_stream_cb_args; -static void cancel_stream_cb(void* user_data, uint32_t key, void* stream) { +static void cancel_stream_cb(void* user_data, uint32_t /*key*/, void* stream) { cancel_stream_cb_args* args = static_cast(user_data); grpc_chttp2_stream* s = static_cast(stream); grpc_chttp2_cancel_stream(args->t, s, GRPC_ERROR_REF(args->error)); @@ -2909,13 +2909,13 @@ static void connectivity_state_set(grpc_chttp2_transport* t, * POLLSET STUFF */ -static void set_pollset(grpc_transport* gt, grpc_stream* gs, +static void set_pollset(grpc_transport* gt, grpc_stream* /*gs*/, grpc_pollset* pollset) { grpc_chttp2_transport* t = reinterpret_cast(gt); grpc_endpoint_add_to_pollset(t->ep, pollset); } -static void set_pollset_set(grpc_transport* gt, grpc_stream* gs, +static void set_pollset_set(grpc_transport* gt, grpc_stream* /*gs*/, grpc_pollset_set* pollset_set) { grpc_chttp2_transport* t = reinterpret_cast(gt); grpc_endpoint_add_to_pollset_set(t->ep, pollset_set); @@ -2957,7 +2957,7 @@ Chttp2IncomingByteStream::Chttp2IncomingByteStream( } void Chttp2IncomingByteStream::OrphanLocked(void* arg, - grpc_error* error_ignored) { + grpc_error* /*error_ignored*/) { Chttp2IncomingByteStream* bs = static_cast(arg); grpc_chttp2_stream* s = bs->stream_; grpc_chttp2_transport* t = s->t; @@ -2976,7 +2976,7 @@ void Chttp2IncomingByteStream::Orphan() { } void Chttp2IncomingByteStream::NextLocked(void* arg, - grpc_error* error_ignored) { + grpc_error* /*error_ignored*/) { Chttp2IncomingByteStream* bs = static_cast(arg); grpc_chttp2_transport* t = bs->transport_; grpc_chttp2_stream* s = bs->stream_; diff --git a/src/core/ext/transport/chttp2/transport/frame_data.cc b/src/core/ext/transport/chttp2/transport/frame_data.cc index c50d7e48d41..20ea966c047 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.cc +++ b/src/core/ext/transport/chttp2/transport/frame_data.cc @@ -40,10 +40,9 @@ grpc_chttp2_data_parser::~grpc_chttp2_data_parser() { GRPC_ERROR_UNREF(error); } -grpc_error* grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser* parser, - uint8_t flags, - uint32_t stream_id, - grpc_chttp2_stream* s) { +grpc_error* grpc_chttp2_data_parser_begin_frame( + grpc_chttp2_data_parser* /*parser*/, uint8_t flags, uint32_t stream_id, + grpc_chttp2_stream* s) { if (flags & ~GRPC_CHTTP2_DATA_FLAG_END_STREAM) { char* msg; gpr_asprintf(&msg, "unsupported data flags: 0x%02x", flags); @@ -279,7 +278,7 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames( return GRPC_ERROR_NONE; } -grpc_error* grpc_chttp2_data_parser_parse(void* parser, +grpc_error* grpc_chttp2_data_parser_parse(void* /*parser*/, grpc_chttp2_transport* t, grpc_chttp2_stream* s, const grpc_slice& slice, diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.cc b/src/core/ext/transport/chttp2/transport/frame_goaway.cc index 6dad3497ec6..c1916a1e115 100644 --- a/src/core/ext/transport/chttp2/transport/frame_goaway.cc +++ b/src/core/ext/transport/chttp2/transport/frame_goaway.cc @@ -37,7 +37,7 @@ void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser* p) { grpc_error* grpc_chttp2_goaway_parser_begin_frame(grpc_chttp2_goaway_parser* p, uint32_t length, - uint8_t flags) { + uint8_t /*flags*/) { if (length < 8) { char* msg; gpr_asprintf(&msg, "goaway frame too short (%d bytes)", length); @@ -56,7 +56,7 @@ grpc_error* grpc_chttp2_goaway_parser_begin_frame(grpc_chttp2_goaway_parser* p, grpc_error* grpc_chttp2_goaway_parser_parse(void* parser, grpc_chttp2_transport* t, - grpc_chttp2_stream* s, + grpc_chttp2_stream* /*s*/, const grpc_slice& slice, int is_last) { const uint8_t* const beg = GRPC_SLICE_START_PTR(slice); diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.cc b/src/core/ext/transport/chttp2/transport/frame_ping.cc index 87c92dffc38..9ecd7a8caa4 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.cc +++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc @@ -72,7 +72,7 @@ grpc_error* grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser* parser, grpc_error* grpc_chttp2_ping_parser_parse(void* parser, grpc_chttp2_transport* t, - grpc_chttp2_stream* s, + grpc_chttp2_stream* /*s*/, const grpc_slice& slice, int is_last) { const uint8_t* const beg = GRPC_SLICE_START_PTR(slice); diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index ba57afa74b9..4d739e85daa 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -110,7 +110,7 @@ grpc_error* grpc_chttp2_settings_parser_begin_frame( } grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t, - grpc_chttp2_stream* s, + grpc_chttp2_stream* /*s*/, const grpc_slice& slice, int is_last) { grpc_chttp2_settings_parser* parser = diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index 31ae9d0d8fc..16a46953cfc 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -224,7 +224,7 @@ static void UpdateAddOrEvict(Hashtable hashtable, const ValueType& value, } /* halve all counts because an element reached max */ -static void HalveFilter(uint8_t idx, uint32_t* sum, uint8_t* elems) { +static void HalveFilter(uint8_t /*idx*/, uint32_t* sum, uint8_t* elems) { *sum = 0; for (int i = 0; i < GRPC_CHTTP2_HPACKC_NUM_VALUES; i++) { elems[i] /= 2; @@ -452,8 +452,8 @@ static void add_key(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem, } } -static void emit_indexed(grpc_chttp2_hpack_compressor* c, uint32_t elem_index, - framer_state* st) { +static void emit_indexed(grpc_chttp2_hpack_compressor* /*c*/, + uint32_t elem_index, framer_state* st) { GRPC_STATS_INC_HPACK_SEND_INDEXED(); uint32_t len = GRPC_CHTTP2_VARINT_LENGTH(elem_index, 1); GRPC_CHTTP2_WRITE_VARINT(elem_index, 1, 0x80, add_tiny_header_data(st, len), @@ -511,7 +511,7 @@ enum class EmitLitHdrVType { INC_IDX_V, NO_IDX_V }; } // namespace template -static void emit_lithdr(grpc_chttp2_hpack_compressor* c, uint32_t key_index, +static void emit_lithdr(grpc_chttp2_hpack_compressor* /*c*/, uint32_t key_index, grpc_mdelem elem, framer_state* st) { switch (type) { case EmitLitHdrType::INC_IDX: @@ -549,7 +549,7 @@ static void emit_lithdr(grpc_chttp2_hpack_compressor* c, uint32_t key_index, } template -static void emit_lithdr_v(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem, +static void emit_lithdr_v(grpc_chttp2_hpack_compressor* /*c*/, grpc_mdelem elem, framer_state* st) { switch (type) { case EmitLitHdrVType::INC_IDX_V: diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index 6c2496dc7ca..19f02168620 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -659,7 +659,7 @@ static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md) { } static grpc_core::UnmanagedMemorySlice take_string_extern( - grpc_chttp2_hpack_parser* p, grpc_chttp2_hpack_parser_string* str) { + grpc_chttp2_hpack_parser* /*p*/, grpc_chttp2_hpack_parser_string* str) { grpc_core::UnmanagedMemorySlice s; if (!str->copied) { GPR_DEBUG_ASSERT(!grpc_slice_is_interned(str->data.referenced)); @@ -675,7 +675,7 @@ static grpc_core::UnmanagedMemorySlice take_string_extern( } static grpc_core::ManagedMemorySlice take_string_intern( - grpc_chttp2_hpack_parser* p, grpc_chttp2_hpack_parser_string* str) { + grpc_chttp2_hpack_parser* /*p*/, grpc_chttp2_hpack_parser_string* str) { grpc_core::ManagedMemorySlice s; if (!str->copied) { s = grpc_core::ManagedMemorySlice(&str->data.referenced); @@ -1067,8 +1067,9 @@ static grpc_error* parse_max_tbl_size_x(grpc_chttp2_hpack_parser* p, } /* a parse error: jam the parse state into parse_error, and return error */ -static grpc_error* parse_error(grpc_chttp2_hpack_parser* p, const uint8_t* cur, - const uint8_t* end, grpc_error* err) { +static grpc_error* parse_error(grpc_chttp2_hpack_parser* p, + const uint8_t* /*cur*/, const uint8_t* /*end*/, + grpc_error* err) { GPR_ASSERT(err != GRPC_ERROR_NONE); if (p->last_error == GRPC_ERROR_NONE) { p->last_error = GRPC_ERROR_REF(err); @@ -1078,7 +1079,8 @@ static grpc_error* parse_error(grpc_chttp2_hpack_parser* p, const uint8_t* cur, } static grpc_error* still_parse_error(grpc_chttp2_hpack_parser* p, - const uint8_t* cur, const uint8_t* end) { + const uint8_t* /*cur*/, + const uint8_t* /*end*/) { return GRPC_ERROR_REF(p->last_error); } @@ -1593,7 +1595,8 @@ static grpc_error* parse_value_string_with_literal_key( } /* "Uninitialized" header parser to save us a branch in on_hdr(). */ -static grpc_error* on_header_uninitialized(void* user_data, grpc_mdelem md) { +static grpc_error* on_header_uninitialized(void* /*user_data*/, + grpc_mdelem md) { GRPC_MDELEM_UNREF(md); return GRPC_ERROR_CREATE_FROM_STATIC_STRING("on_header callback not set"); } @@ -1666,7 +1669,7 @@ static const maybe_complete_func_type maybe_complete_funcs[] = { grpc_chttp2_maybe_complete_recv_initial_metadata, grpc_chttp2_maybe_complete_recv_trailing_metadata}; -static void force_client_rst_stream(void* sp, grpc_error* error) { +static void force_client_rst_stream(void* sp, grpc_error* /*error*/) { grpc_chttp2_stream* s = static_cast(sp); grpc_chttp2_transport* t = s->t; if (!s->write_closed) { @@ -1678,7 +1681,7 @@ static void force_client_rst_stream(void* sp, grpc_error* error) { GRPC_CHTTP2_STREAM_UNREF(s, "final_rst"); } -static void parse_stream_compression_md(grpc_chttp2_transport* t, +static void parse_stream_compression_md(grpc_chttp2_transport* /*t*/, grpc_chttp2_stream* s, grpc_metadata_batch* initial_metadata) { if (initial_metadata->idx.named.content_encoding == nullptr || diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index 6a4a8031ec4..ac7b40e58a5 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -116,12 +116,13 @@ typedef TraceFlag DebugOnlyTraceFlag; #else class DebugOnlyTraceFlag { public: - constexpr DebugOnlyTraceFlag(bool default_enabled, const char* name) {} + constexpr DebugOnlyTraceFlag(bool /*default_enabled*/, const char* /*name*/) { + } constexpr bool enabled() const { return false; } constexpr const char* name() const { return "DebugOnlyTraceFlag"; } private: - void set_enabled(bool enabled) {} + void set_enabled(bool /*enabled*/) {} }; #endif diff --git a/src/core/lib/gprpp/memory.h b/src/core/lib/gprpp/memory.h index f0c6bb14658..9a1628b6ec0 100644 --- a/src/core/lib/gprpp/memory.h +++ b/src/core/lib/gprpp/memory.h @@ -107,7 +107,7 @@ class Allocator { pointer address(reference x) const { return &x; } const_pointer address(const_reference x) const { return &x; } pointer allocate(std::size_t n, - std::allocator::const_pointer hint = nullptr) { + std::allocator::const_pointer /*hint*/ = nullptr) { return static_cast(gpr_malloc(n * sizeof(T))); } void deallocate(T* p, std::size_t /* n */) { gpr_free(p); } @@ -132,7 +132,7 @@ bool operator==(Allocator const&, Allocator const&) noexcept { } template -bool operator!=(Allocator const& x, Allocator const& y) noexcept { +bool operator!=(Allocator const& /*x*/, Allocator const& /*y*/) noexcept { return false; } diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index ff0d3a03527..e8288a34286 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -69,7 +69,14 @@ class RefCount { // Note: RefCount tracing is only enabled on debug builds, even when a // TraceFlag is used. template - constexpr explicit RefCount(Value init = 1, TraceFlagT* trace_flag = nullptr) + constexpr explicit RefCount( + Value init = 1, + TraceFlagT* +#ifndef NDEBUG + // Leave unnamed if NDEBUG to avoid unused parameter warning + trace_flag +#endif + = nullptr) : #ifndef NDEBUG trace_flag_(trace_flag), @@ -98,6 +105,10 @@ class RefCount { prior, prior + n, reason); } #else + // Use conditionally-important parameters + (void)location; + (void)reason; + value_.FetchAdd(n, MemoryOrder::RELAXED); #endif } @@ -125,6 +136,9 @@ class RefCount { } assert(prior > 0); #else + // Avoid unused-parameter warnings for debug-only parameters + (void)location; + (void)reason; RefNonZero(); #endif } @@ -150,6 +164,9 @@ class RefCount { prior, prior + 1, reason); } #endif + // Avoid unused-parameter warnings for debug-only parameters + (void)location; + (void)reason; return value_.IncrementIfNonzero(); } @@ -184,6 +201,10 @@ class RefCount { prior - 1, reason); } GPR_DEBUG_ASSERT(prior > 0); +#else + // Avoid unused-parameter warnings for debug-only parameters + (void)location; + (void)reason; #endif return prior == 1; } diff --git a/src/core/lib/http/httpcli.cc b/src/core/lib/http/httpcli.cc index 93bb1432b16..7319409c66f 100644 --- a/src/core/lib/http/httpcli.cc +++ b/src/core/lib/http/httpcli.cc @@ -66,7 +66,7 @@ static grpc_httpcli_get_override g_get_override = nullptr; static grpc_httpcli_post_override g_post_override = nullptr; static void plaintext_handshake(void* arg, grpc_endpoint* endpoint, - const char* host, grpc_millis deadline, + const char* /*host*/, grpc_millis /*deadline*/, void (*on_done)(void* arg, grpc_endpoint* endpoint)) { on_done(arg, endpoint); diff --git a/src/core/lib/http/httpcli_security_connector.cc b/src/core/lib/http/httpcli_security_connector.cc index e6750621c2e..fef467e8afa 100644 --- a/src/core/lib/http/httpcli_security_connector.cc +++ b/src/core/lib/http/httpcli_security_connector.cc @@ -67,7 +67,7 @@ class grpc_httpcli_ssl_channel_security_connector final } void add_handshakers(const grpc_channel_args* args, - grpc_pollset_set* interested_parties, + grpc_pollset_set* /*interested_parties*/, grpc_core::HandshakeManager* handshake_mgr) override { tsi_handshaker* handshaker = nullptr; if (handshaker_factory_ != nullptr) { @@ -86,7 +86,7 @@ class grpc_httpcli_ssl_channel_security_connector final return handshaker_factory_; } - void check_peer(tsi_peer peer, grpc_endpoint* ep, + void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/, grpc_core::RefCountedPtr* /*auth_context*/, grpc_closure* on_peer_checked) override { grpc_error* error = GRPC_ERROR_NONE; @@ -111,15 +111,15 @@ class grpc_httpcli_ssl_channel_security_connector final return strcmp(secure_peer_name_, other->secure_peer_name_); } - bool check_call_host(grpc_core::StringView host, - grpc_auth_context* auth_context, - grpc_closure* on_call_host_checked, + bool check_call_host(grpc_core::StringView /*host*/, + grpc_auth_context* /*auth_context*/, + grpc_closure* /*on_call_host_checked*/, grpc_error** error) override { *error = GRPC_ERROR_NONE; return true; } - void cancel_check_call_host(grpc_closure* on_call_host_checked, + void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/, grpc_error* error) override { GRPC_ERROR_UNREF(error); } @@ -134,7 +134,7 @@ class grpc_httpcli_ssl_channel_security_connector final static grpc_core::RefCountedPtr httpcli_ssl_channel_security_connector_create( const char* pem_root_certs, const tsi_ssl_root_certs_store* root_store, - const char* secure_peer_name, grpc_channel_args* channel_args) { + const char* secure_peer_name, grpc_channel_args* /*channel_args*/) { if (secure_peer_name != nullptr && pem_root_certs == nullptr) { gpr_log(GPR_ERROR, "Cannot assert a secure peer name without a trust root."); diff --git a/src/core/lib/http/parser.cc b/src/core/lib/http/parser.cc index 58608da982c..022ef9a2e7b 100644 --- a/src/core/lib/http/parser.cc +++ b/src/core/lib/http/parser.cc @@ -327,7 +327,7 @@ void grpc_http_parser_init(grpc_http_parser* parser, grpc_http_type type, parser->cur_line_end_length = 2; } -void grpc_http_parser_destroy(grpc_http_parser* parser) {} +void grpc_http_parser_destroy(grpc_http_parser* /*parser*/) {} void grpc_http_request_destroy(grpc_http_request* request) { size_t i; diff --git a/src/core/lib/iomgr/buffer_list.cc b/src/core/lib/iomgr/buffer_list.cc index 73915933eee..f2691b0826a 100644 --- a/src/core/lib/iomgr/buffer_list.cc +++ b/src/core/lib/iomgr/buffer_list.cc @@ -39,8 +39,8 @@ void fill_gpr_from_timestamp(gpr_timespec* gts, const struct timespec* ts) { gts->clock_type = GPR_CLOCK_REALTIME; } -void default_timestamps_callback(void* arg, grpc_core::Timestamps* ts, - grpc_error* shudown_err) { +void default_timestamps_callback(void* /*arg*/, grpc_core::Timestamps* /*ts*/, + grpc_error* /*shudown_err*/) { gpr_log(GPR_DEBUG, "Timestamps callback has not been registered"); } @@ -293,9 +293,8 @@ void grpc_tcp_set_write_timestamps_callback(void (*fn)(void*, #else /* GRPC_LINUX_ERRQUEUE */ namespace grpc_core { -void grpc_tcp_set_write_timestamps_callback(void (*fn)(void*, - grpc_core::Timestamps*, - grpc_error* error)) { +void grpc_tcp_set_write_timestamps_callback( + void (*/*fn*/)(void*, grpc_core::Timestamps*, grpc_error* error)) { gpr_log(GPR_DEBUG, "Timestamps callback is not enabled for this platform"); } } /* namespace grpc_core */ diff --git a/src/core/lib/iomgr/buffer_list.h b/src/core/lib/iomgr/buffer_list.h index 8818f3c3b64..c2552ca26bf 100644 --- a/src/core/lib/iomgr/buffer_list.h +++ b/src/core/lib/iomgr/buffer_list.h @@ -146,7 +146,7 @@ class TracedBuffer { class TracedBuffer { public: /* Dummy shutdown function */ - static void Shutdown(grpc_core::TracedBuffer** head, void* remaining, + static void Shutdown(grpc_core::TracedBuffer** /*head*/, void* /*remaining*/, grpc_error* shutdown_err) { GRPC_ERROR_UNREF(shutdown_err); } diff --git a/src/core/lib/iomgr/combiner.cc b/src/core/lib/iomgr/combiner.cc index cfb4bbdd96a..3800b5133ab 100644 --- a/src/core/lib/iomgr/combiner.cc +++ b/src/core/lib/iomgr/combiner.cc @@ -168,7 +168,7 @@ static void move_next() { } } -static void offload(void* arg, grpc_error* error) { +static void offload(void* arg, grpc_error* /*error*/) { grpc_core::Combiner* lock = static_cast(arg); push_last_on_exec_ctx(lock); } diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 0c357dd2758..f8f9aa2192c 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -658,7 +658,7 @@ static int poll_deadline_to_millis_timeout(grpc_millis millis) { NOTE ON SYNCRHONIZATION: Similar to do_epoll_wait(), this function is only called by g_active_poller thread. So there is no need for synchronization when accessing fields in g_epoll_set */ -static grpc_error* process_epoll_events(grpc_pollset* pollset) { +static grpc_error* process_epoll_events(grpc_pollset* /*pollset*/) { GPR_TIMER_SCOPE("process_epoll_events", 0); static const char* err_desc = "process_events"; @@ -1219,7 +1219,7 @@ done: return ret_err; } -static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) {} +static void pollset_add_fd(grpc_pollset* /*pollset*/, grpc_fd* /*fd*/) {} /******************************************************************************* * Pollset-set Definitions @@ -1229,21 +1229,23 @@ static grpc_pollset_set* pollset_set_create(void) { return (grpc_pollset_set*)(static_cast(0xdeafbeef)); } -static void pollset_set_destroy(grpc_pollset_set* pss) {} +static void pollset_set_destroy(grpc_pollset_set* /*pss*/) {} -static void pollset_set_add_fd(grpc_pollset_set* pss, grpc_fd* fd) {} +static void pollset_set_add_fd(grpc_pollset_set* /*pss*/, grpc_fd* /*fd*/) {} -static void pollset_set_del_fd(grpc_pollset_set* pss, grpc_fd* fd) {} +static void pollset_set_del_fd(grpc_pollset_set* /*pss*/, grpc_fd* /*fd*/) {} -static void pollset_set_add_pollset(grpc_pollset_set* pss, grpc_pollset* ps) {} +static void pollset_set_add_pollset(grpc_pollset_set* /*pss*/, + grpc_pollset* /*ps*/) {} -static void pollset_set_del_pollset(grpc_pollset_set* pss, grpc_pollset* ps) {} +static void pollset_set_del_pollset(grpc_pollset_set* /*pss*/, + grpc_pollset* /*ps*/) {} -static void pollset_set_add_pollset_set(grpc_pollset_set* bag, - grpc_pollset_set* item) {} +static void pollset_set_add_pollset_set(grpc_pollset_set* /*bag*/, + grpc_pollset_set* /*item*/) {} -static void pollset_set_del_pollset_set(grpc_pollset_set* bag, - grpc_pollset_set* item) {} +static void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/, + grpc_pollset_set* /*item*/) {} /******************************************************************************* * Event engine binding @@ -1253,8 +1255,8 @@ static bool is_any_background_poller_thread(void) { return false; } static void shutdown_background_closure(void) {} -static bool add_closure_to_background_poller(grpc_closure* closure, - grpc_error* error) { +static bool add_closure_to_background_poller(grpc_closure* /*closure*/, + grpc_error* /*error*/) { return false; } @@ -1325,7 +1327,8 @@ static void reset_event_manager_on_fork() { /* It is possible that GLIBC has epoll but the underlying kernel doesn't. * Create epoll_fd (epoll_set_init() takes care of that) to make sure epoll * support is available */ -const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) { +const grpc_event_engine_vtable* grpc_init_epoll1_linux( + bool /*explicit_request*/) { if (!grpc_has_wakeup_fd()) { gpr_log(GPR_ERROR, "Skipping epoll1 because of no wakeup fd."); return nullptr; @@ -1356,7 +1359,8 @@ const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) { #include "src/core/lib/iomgr/ev_epoll1_linux.h" /* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return * NULL */ -const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) { +const grpc_event_engine_vtable* grpc_init_epoll1_linux( + bool /*explicit_request*/) { return nullptr; } #endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLL1) */ diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc index 4a83cb6c215..927ed57e762 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ b/src/core/lib/iomgr/ev_epollex_linux.cc @@ -352,15 +352,23 @@ static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file, gpr_atm_no_barrier_load(&fd->refst) + n, reason, file, line); } #else -#define REF_BY(fd, n, reason) ref_by(fd, n) -#define UNREF_BY(fd, n, reason) unref_by(fd, n) +#define REF_BY(fd, n, reason) \ + do { \ + ref_by(fd, n); \ + (void)(reason); \ + } while (0) +#define UNREF_BY(fd, n, reason) \ + do { \ + unref_by(fd, n); \ + (void)(reason); \ + } while (0) static void ref_by(grpc_fd* fd, int n) { #endif GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0); } /* Uninitialize and add to the freelist */ -static void fd_destroy(void* arg, grpc_error* error) { +static void fd_destroy(void* arg, grpc_error* /*error*/) { grpc_fd* fd = static_cast(arg); fd->destroy(); @@ -1042,7 +1050,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, } static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, - grpc_pollset_worker** worker_hdl) { + grpc_pollset_worker** /*worker_hdl*/) { GPR_TIMER_SCOPE("end_worker", 0); gpr_mu_lock(&pollset->mu); gpr_mu_lock(&worker->pollable_obj->mu); @@ -1542,8 +1550,8 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a, gpr_mu_unlock(&b->mu); } -static void pollset_set_del_pollset_set(grpc_pollset_set* bag, - grpc_pollset_set* item) {} +static void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/, + grpc_pollset_set* /*item*/) {} /******************************************************************************* * Event engine binding @@ -1553,8 +1561,8 @@ static bool is_any_background_poller_thread(void) { return false; } static void shutdown_background_closure(void) {} -static bool add_closure_to_background_poller(grpc_closure* closure, - grpc_error* error) { +static bool add_closure_to_background_poller(grpc_closure* /*closure*/, + grpc_error* /*error*/) { return false; } @@ -1603,7 +1611,7 @@ static const grpc_event_engine_vtable vtable = { }; const grpc_event_engine_vtable* grpc_init_epollex_linux( - bool explicitly_requested) { + bool /*explicitly_requested*/) { if (!grpc_has_wakeup_fd()) { gpr_log(GPR_ERROR, "Skipping epollex because of no wakeup fd."); return nullptr; @@ -1631,7 +1639,7 @@ const grpc_event_engine_vtable* grpc_init_epollex_linux( /* If GRPC_LINUX_EPOLL_CREATE1 is not defined, it means epoll_create1 is not available. Return NULL */ const grpc_event_engine_vtable* grpc_init_epollex_linux( - bool explicitly_requested) { + bool /*explicitly_requested*/) { return nullptr; } #endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLLEX) */ diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index cee6dcbe530..d25553a6dec 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -323,8 +323,16 @@ static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file, gpr_atm_no_barrier_load(&fd->refst) + n, reason, file, line); } #else -#define REF_BY(fd, n, reason) ref_by(fd, n) -#define UNREF_BY(fd, n, reason) unref_by(fd, n) +#define REF_BY(fd, n, reason) \ + do { \ + ref_by(fd, n); \ + (void)(reason); \ + } while (0) +#define UNREF_BY(fd, n, reason) \ + do { \ + unref_by(fd, n); \ + (void)(reason); \ + } while (0) static void ref_by(grpc_fd* fd, int n) { #endif GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0); @@ -355,6 +363,8 @@ static void unref_by(grpc_fd* fd, int n) { } static grpc_fd* fd_create(int fd, const char* name, bool track_err) { + // Avoid unused-parameter warning for debug-only parameter + (void)track_err; GPR_DEBUG_ASSERT(track_err == false); grpc_fd* r = static_cast(gpr_malloc(sizeof(*r))); gpr_mu_init(&r->mu); @@ -560,7 +570,7 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) { gpr_mu_unlock(&fd->mu); } -static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) { +static void fd_notify_on_error(grpc_fd* /*fd*/, grpc_closure* closure) { if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { gpr_log(GPR_ERROR, "Polling engine does not support tracking errors."); } @@ -579,7 +589,7 @@ static void fd_set_writable(grpc_fd* fd) { gpr_mu_unlock(&fd->mu); } -static void fd_set_error(grpc_fd* fd) { +static void fd_set_error(grpc_fd* /*fd*/) { if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { gpr_log(GPR_ERROR, "Polling engine does not support tracking errors."); } @@ -696,7 +706,7 @@ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write) { GPR_TLS_DECL(g_current_thread_poller); GPR_TLS_DECL(g_current_thread_worker); -static void remove_worker(grpc_pollset* p, grpc_pollset_worker* worker) { +static void remove_worker(grpc_pollset* /*p*/, grpc_pollset_worker* worker) { worker->prev->next = worker->next; worker->next->prev = worker->prev; } @@ -1320,8 +1330,8 @@ static bool is_any_background_poller_thread(void) { return false; } static void shutdown_background_closure(void) {} -static bool add_closure_to_background_poller(grpc_closure* closure, - grpc_error* error) { +static bool add_closure_to_background_poller(grpc_closure* /*closure*/, + grpc_error* /*error*/) { return false; } @@ -1392,7 +1402,8 @@ static void reset_event_manager_on_fork() { gpr_mu_unlock(&fork_fd_list_mu); } -const grpc_event_engine_vtable* grpc_init_poll_posix(bool explicit_request) { +const grpc_event_engine_vtable* grpc_init_poll_posix( + bool /*explicit_request*/) { if (!grpc_has_wakeup_fd()) { gpr_log(GPR_ERROR, "Skipping poll because of no wakeup fd."); return nullptr; diff --git a/src/core/lib/iomgr/executor/threadpool.cc b/src/core/lib/iomgr/executor/threadpool.cc index e203252ef08..8c9fd18380e 100644 --- a/src/core/lib/iomgr/executor/threadpool.cc +++ b/src/core/lib/iomgr/executor/threadpool.cc @@ -58,8 +58,7 @@ void ThreadPool::SharedThreadPoolConstructor() { threads_ = static_cast( gpr_zalloc(num_threads_ * sizeof(ThreadPoolWorker*))); for (int i = 0; i < num_threads_; ++i) { - threads_[i] = - New(thd_name_, this, queue_, thread_options_, i); + threads_[i] = New(thd_name_, queue_, thread_options_, i); threads_[i]->Start(); } } diff --git a/src/core/lib/iomgr/executor/threadpool.h b/src/core/lib/iomgr/executor/threadpool.h index 3336ca0ccc1..01a00c025f0 100644 --- a/src/core/lib/iomgr/executor/threadpool.h +++ b/src/core/lib/iomgr/executor/threadpool.h @@ -62,9 +62,8 @@ class ThreadPoolInterface { // NULL closure. class ThreadPoolWorker { public: - ThreadPoolWorker(const char* thd_name, ThreadPoolInterface* /*pool*/, - MPMCQueueInterface* queue, Thread::Options& options, - int index) + ThreadPoolWorker(const char* thd_name, MPMCQueueInterface* queue, + Thread::Options& options, int index) : queue_(queue), thd_name_(thd_name), index_(index) { thd_ = Thread(thd_name, [](void* th) { static_cast(th)->Run(); }, diff --git a/src/core/lib/iomgr/iomgr_custom.cc b/src/core/lib/iomgr/iomgr_custom.cc index f5ac8a0670a..684044a5bbf 100644 --- a/src/core/lib/iomgr/iomgr_custom.cc +++ b/src/core/lib/iomgr/iomgr_custom.cc @@ -45,7 +45,7 @@ static bool iomgr_platform_is_any_background_poller_thread(void) { return false; } static bool iomgr_platform_add_closure_to_background_poller( - grpc_closure* closure, grpc_error* error) { + grpc_closure* /*closure*/, grpc_error* /*error*/) { return false; } diff --git a/src/core/lib/iomgr/pollset_custom.cc b/src/core/lib/iomgr/pollset_custom.cc index 70e8a4596fa..3ec2d3d573b 100644 --- a/src/core/lib/iomgr/pollset_custom.cc +++ b/src/core/lib/iomgr/pollset_custom.cc @@ -53,7 +53,7 @@ static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { *mu = &pollset->mu; } -static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) { +static void pollset_shutdown(grpc_pollset* /*pollset*/, grpc_closure* closure) { GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD(); GRPC_CLOSURE_SCHED(closure, GRPC_ERROR_NONE); } @@ -64,7 +64,7 @@ static void pollset_destroy(grpc_pollset* pollset) { } static grpc_error* pollset_work(grpc_pollset* pollset, - grpc_pollset_worker** worker_hdl, + grpc_pollset_worker** /*worker_hdl*/, grpc_millis deadline) { GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD(); gpr_mu_unlock(&pollset->mu); @@ -87,8 +87,8 @@ static grpc_error* pollset_work(grpc_pollset* pollset, return GRPC_ERROR_NONE; } -static grpc_error* pollset_kick(grpc_pollset* pollset, - grpc_pollset_worker* specific_worker) { +static grpc_error* pollset_kick(grpc_pollset* /*pollset*/, + grpc_pollset_worker* /*specific_worker*/) { GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD(); poller_vtable->kick(); return GRPC_ERROR_NONE; diff --git a/src/core/lib/iomgr/pollset_set_custom.cc b/src/core/lib/iomgr/pollset_set_custom.cc index b1ee66020d9..099388f7c5b 100644 --- a/src/core/lib/iomgr/pollset_set_custom.cc +++ b/src/core/lib/iomgr/pollset_set_custom.cc @@ -26,19 +26,19 @@ grpc_pollset_set* pollset_set_create(void) { return (grpc_pollset_set*)((intptr_t)0xdeafbeef); } -void pollset_set_destroy(grpc_pollset_set* pollset_set) {} +void pollset_set_destroy(grpc_pollset_set* /*pollset_set*/) {} -void pollset_set_add_pollset(grpc_pollset_set* pollset_set, - grpc_pollset* pollset) {} +void pollset_set_add_pollset(grpc_pollset_set* /*pollset_set*/, + grpc_pollset* /*pollset*/) {} -void pollset_set_del_pollset(grpc_pollset_set* pollset_set, - grpc_pollset* pollset) {} +void pollset_set_del_pollset(grpc_pollset_set* /*pollset_set*/, + grpc_pollset* /*pollset*/) {} -void pollset_set_add_pollset_set(grpc_pollset_set* bag, - grpc_pollset_set* item) {} +void pollset_set_add_pollset_set(grpc_pollset_set* /*bag*/, + grpc_pollset_set* /*item*/) {} -void pollset_set_del_pollset_set(grpc_pollset_set* bag, - grpc_pollset_set* item) {} +void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/, + grpc_pollset_set* /*item*/) {} static grpc_pollset_set_vtable vtable = { pollset_set_create, pollset_set_destroy, diff --git a/src/core/lib/iomgr/resolve_address_custom.cc b/src/core/lib/iomgr/resolve_address_custom.cc index b5c922b3ee5..2b3452cc1d7 100644 --- a/src/core/lib/iomgr/resolve_address_custom.cc +++ b/src/core/lib/iomgr/resolve_address_custom.cc @@ -151,7 +151,7 @@ static grpc_error* blocking_resolve_address_impl( } static void resolve_address_impl(const char* name, const char* default_port, - grpc_pollset_set* interested_parties, + grpc_pollset_set* /*interested_parties*/, grpc_closure* on_done, grpc_resolved_addresses** addrs) { grpc_custom_resolver* r = nullptr; diff --git a/src/core/lib/iomgr/resolve_address_posix.cc b/src/core/lib/iomgr/resolve_address_posix.cc index e02dc19bb27..a8bd7acb8ce 100644 --- a/src/core/lib/iomgr/resolve_address_posix.cc +++ b/src/core/lib/iomgr/resolve_address_posix.cc @@ -150,7 +150,7 @@ typedef struct { /* Callback to be passed to grpc Executor to asynch-ify * grpc_blocking_resolve_address */ -static void do_request_thread(void* rp, grpc_error* error) { +static void do_request_thread(void* rp, grpc_error* /*error*/) { request* r = static_cast(rp); GRPC_CLOSURE_SCHED(r->on_done, grpc_blocking_resolve_address( r->name, r->default_port, r->addrs_out)); @@ -160,7 +160,7 @@ static void do_request_thread(void* rp, grpc_error* error) { } static void posix_resolve_address(const char* name, const char* default_port, - grpc_pollset_set* interested_parties, + grpc_pollset_set* /*interested_parties*/, grpc_closure* on_done, grpc_resolved_addresses** addrs) { request* r = static_cast(gpr_malloc(sizeof(request))); diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc index ce982a64106..661783eeedd 100644 --- a/src/core/lib/iomgr/resource_quota.cc +++ b/src/core/lib/iomgr/resource_quota.cc @@ -274,7 +274,7 @@ static bool rq_reclaim_from_per_user_free_pool( grpc_resource_quota* resource_quota); static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive); -static void rq_step(void* rq, grpc_error* error) { +static void rq_step(void* rq, grpc_error* /*error*/) { grpc_resource_quota* resource_quota = static_cast(rq); resource_quota->step_scheduled = false; do { @@ -479,7 +479,7 @@ static grpc_slice ru_slice_create(grpc_resource_user* resource_user, * the combiner */ -static void ru_allocate(void* ru, grpc_error* error) { +static void ru_allocate(void* ru, grpc_error* /*error*/) { grpc_resource_user* resource_user = static_cast(ru); if (rulist_empty(resource_user->resource_quota, GRPC_RULIST_AWAITING_ALLOCATION)) { @@ -488,7 +488,7 @@ static void ru_allocate(void* ru, grpc_error* error) { rulist_add_tail(resource_user, GRPC_RULIST_AWAITING_ALLOCATION); } -static void ru_add_to_free_pool(void* ru, grpc_error* error) { +static void ru_add_to_free_pool(void* ru, grpc_error* /*error*/) { grpc_resource_user* resource_user = static_cast(ru); if (!rulist_empty(resource_user->resource_quota, GRPC_RULIST_AWAITING_ALLOCATION) && @@ -513,7 +513,7 @@ static bool ru_post_reclaimer(grpc_resource_user* resource_user, return true; } -static void ru_post_benign_reclaimer(void* ru, grpc_error* error) { +static void ru_post_benign_reclaimer(void* ru, grpc_error* /*error*/) { grpc_resource_user* resource_user = static_cast(ru); if (!ru_post_reclaimer(resource_user, false)) return; if (!rulist_empty(resource_user->resource_quota, @@ -527,7 +527,7 @@ static void ru_post_benign_reclaimer(void* ru, grpc_error* error) { rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_BENIGN); } -static void ru_post_destructive_reclaimer(void* ru, grpc_error* error) { +static void ru_post_destructive_reclaimer(void* ru, grpc_error* /*error*/) { grpc_resource_user* resource_user = static_cast(ru); if (!ru_post_reclaimer(resource_user, true)) return; if (!rulist_empty(resource_user->resource_quota, @@ -543,7 +543,7 @@ static void ru_post_destructive_reclaimer(void* ru, grpc_error* error) { rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE); } -static void ru_shutdown(void* ru, grpc_error* error) { +static void ru_shutdown(void* ru, grpc_error* /*error*/) { if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { gpr_log(GPR_INFO, "RU shutdown %p", ru); } @@ -561,7 +561,7 @@ static void ru_shutdown(void* ru, grpc_error* error) { gpr_mu_unlock(&resource_user->mu); } -static void ru_destroy(void* ru, grpc_error* error) { +static void ru_destroy(void* ru, grpc_error* /*error*/) { grpc_resource_user* resource_user = static_cast(ru); GPR_ASSERT(gpr_atm_no_barrier_load(&resource_user->refs) == 0); // Free all the remaining thread quota @@ -611,7 +611,7 @@ typedef struct { grpc_closure closure; } rq_resize_args; -static void rq_resize(void* args, grpc_error* error) { +static void rq_resize(void* args, grpc_error* /*error*/) { rq_resize_args* a = static_cast(args); int64_t delta = a->size - a->resource_quota->size; a->resource_quota->size += delta; @@ -622,7 +622,7 @@ static void rq_resize(void* args, grpc_error* error) { gpr_free(a); } -static void rq_reclamation_done(void* rq, grpc_error* error) { +static void rq_reclamation_done(void* rq, grpc_error* /*error*/) { grpc_resource_quota* resource_quota = static_cast(rq); resource_quota->reclaiming = false; rq_step_sched(resource_quota); diff --git a/src/core/lib/iomgr/socket_utils_common_posix.cc b/src/core/lib/iomgr/socket_utils_common_posix.cc index 30c98d00915..f46cbd51c88 100644 --- a/src/core/lib/iomgr/socket_utils_common_posix.cc +++ b/src/core/lib/iomgr/socket_utils_common_posix.cc @@ -84,11 +84,16 @@ grpc_error* grpc_set_socket_no_sigpipe_if_possible(int fd) { if ((newval != 0) != (val != 0)) { return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to set SO_NOSIGPIPE"); } +#else + // Avoid unused parameter warning for conditional parameter + (void)fd; #endif return GRPC_ERROR_NONE; } grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd) { + // Use conditionally-important parameter to avoid warning + (void)fd; #ifdef GRPC_HAVE_IP_PKTINFO int get_local_ip = 1; if (0 != setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &get_local_ip, @@ -100,6 +105,8 @@ grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd) { } grpc_error* grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) { + // Use conditionally-important parameter to avoid warning + (void)fd; #ifdef GRPC_HAVE_IPV6_RECVPKTINFO int get_local_ip = 1; if (0 != setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &get_local_ip, @@ -256,6 +263,10 @@ void config_default_tcp_user_timeout(bool enable, int timeout, bool is_client) { /* Set TCP_USER_TIMEOUT */ grpc_error* grpc_set_socket_tcp_user_timeout( int fd, const grpc_channel_args* channel_args, bool is_client) { + // Use conditionally-important parameter to avoid warning + (void)fd; + (void)channel_args; + (void)is_client; #ifdef GRPC_HAVE_TCP_USER_TIMEOUT bool enable; int timeout; diff --git a/src/core/lib/iomgr/tcp_client_custom.cc b/src/core/lib/iomgr/tcp_client_custom.cc index 6f236ae4d4e..28da83366df 100644 --- a/src/core/lib/iomgr/tcp_client_custom.cc +++ b/src/core/lib/iomgr/tcp_client_custom.cc @@ -58,7 +58,7 @@ static void custom_tcp_connect_cleanup(grpc_custom_tcp_connect* connect) { } } -static void custom_close_callback(grpc_custom_socket* socket) {} +static void custom_close_callback(grpc_custom_socket* /*socket*/) {} static void on_alarm(void* acp, grpc_error* error) { int done; diff --git a/src/core/lib/iomgr/tcp_custom.cc b/src/core/lib/iomgr/tcp_custom.cc index 0b1cff401c5..d594f01d89a 100644 --- a/src/core/lib/iomgr/tcp_custom.cc +++ b/src/core/lib/iomgr/tcp_custom.cc @@ -193,7 +193,7 @@ static void tcp_read_allocation_done(void* tcpp, grpc_error* error) { } static void endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices, - grpc_closure* cb, bool urgent) { + grpc_closure* cb, bool /*urgent*/) { custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)ep; GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD(); GPR_ASSERT(tcp->read_cb == nullptr); @@ -224,7 +224,7 @@ static void custom_write_callback(grpc_custom_socket* socket, } static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices, - grpc_closure* cb, void* arg) { + grpc_closure* cb, void* /*arg*/) { custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)ep; GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD(); @@ -327,9 +327,9 @@ static grpc_resource_user* endpoint_get_resource_user(grpc_endpoint* ep) { return tcp->resource_user; } -static int endpoint_get_fd(grpc_endpoint* ep) { return -1; } +static int endpoint_get_fd(grpc_endpoint* /*ep*/) { return -1; } -static bool endpoint_can_track_err(grpc_endpoint* ep) { return false; } +static bool endpoint_can_track_err(grpc_endpoint* /*ep*/) { return false; } static grpc_endpoint_vtable vtable = {endpoint_read, endpoint_write, diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 8e673c88ce4..48267a95dad 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -161,7 +161,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error); static void tcp_drop_uncovered_then_handle_write(void* arg /* grpc_tcp */, grpc_error* error); -static void done_poller(void* bp, grpc_error* error_ignored) { +static void done_poller(void* bp, grpc_error* /*error_ignored*/) { backup_poller* p = static_cast(bp); if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p destroy", p); @@ -170,7 +170,7 @@ static void done_poller(void* bp, grpc_error* error_ignored) { gpr_free(p); } -static void run_poller(void* bp, grpc_error* error_ignored) { +static void run_poller(void* bp, grpc_error* /*error_ignored*/) { backup_poller* p = static_cast(bp); if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p run", p); @@ -206,7 +206,7 @@ static void run_poller(void* bp, grpc_error* error_ignored) { } } -static void drop_uncovered(grpc_tcp* tcp) { +static void drop_uncovered(grpc_tcp* /*tcp*/) { backup_poller* p = (backup_poller*)gpr_atm_acq_load(&g_backup_poller); gpr_atm old_count = gpr_atm_full_fetch_add(&g_uncovered_notifications_pending, -1); @@ -876,15 +876,16 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) { } #else /* GRPC_LINUX_ERRQUEUE */ -static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg, - size_t sending_length, - ssize_t* sent_length) { +static bool tcp_write_with_timestamps(grpc_tcp* /*tcp*/, struct msghdr* /*msg*/, + size_t /*sending_length*/, + ssize_t* /*sent_length*/) { gpr_log(GPR_ERROR, "Write with timestamps not supported for this platform"); GPR_ASSERT(0); return false; } -static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) { +static void tcp_handle_error(void* /*arg*/ /* grpc_tcp */, + grpc_error* /*error*/) { gpr_log(GPR_ERROR, "Error handling is not supported for this platform"); GPR_ASSERT(0); } diff --git a/src/core/lib/iomgr/tcp_server_custom.cc b/src/core/lib/iomgr/tcp_server_custom.cc index 7107dcc4b02..90ed555f38a 100644 --- a/src/core/lib/iomgr/tcp_server_custom.cc +++ b/src/core/lib/iomgr/tcp_server_custom.cc @@ -439,13 +439,13 @@ static void tcp_server_start(grpc_tcp_server* server, grpc_pollset** pollsets, } } -static unsigned tcp_server_port_fd_count(grpc_tcp_server* s, - unsigned port_index) { +static unsigned tcp_server_port_fd_count(grpc_tcp_server* /*s*/, + unsigned /*port_index*/) { return 0; } -static int tcp_server_port_fd(grpc_tcp_server* s, unsigned port_index, - unsigned fd_index) { +static int tcp_server_port_fd(grpc_tcp_server* /*s*/, unsigned /*port_index*/, + unsigned /*fd_index*/) { return -1; } @@ -459,7 +459,7 @@ static void tcp_server_shutdown_listeners(grpc_tcp_server* s) { } static grpc_core::TcpServerFdHandler* tcp_server_create_fd_handler( - grpc_tcp_server* s) { + grpc_tcp_server* /*s*/) { return nullptr; } diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc index 689c005bf0d..b1637e9981a 100644 --- a/src/core/lib/iomgr/tcp_server_posix.cc +++ b/src/core/lib/iomgr/tcp_server_posix.cc @@ -124,7 +124,7 @@ static void finish_shutdown(grpc_tcp_server* s) { gpr_free(s); } -static void destroyed_port(void* server, grpc_error* error) { +static void destroyed_port(void* server, grpc_error* /*error*/) { grpc_tcp_server* s = static_cast(server); gpr_mu_lock(&s->mu); s->destroyed_ports++; diff --git a/src/core/lib/iomgr/timer_custom.cc b/src/core/lib/iomgr/timer_custom.cc index 57675c27a8f..0af30ca5497 100644 --- a/src/core/lib/iomgr/timer_custom.cc +++ b/src/core/lib/iomgr/timer_custom.cc @@ -30,7 +30,7 @@ static grpc_custom_timer_vtable* custom_timer_impl; -void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error* error) { +void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error* /*error*/) { GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD(); grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; @@ -75,7 +75,7 @@ static void timer_cancel(grpc_timer* timer) { } } -static grpc_timer_check_result timer_check(grpc_millis* next) { +static grpc_timer_check_result timer_check(grpc_millis* /*next*/) { return GRPC_TIMERS_NOT_CHECKED; } diff --git a/src/core/lib/iomgr/udp_server.cc b/src/core/lib/iomgr/udp_server.cc index 3e853945555..5f30a1d33d3 100644 --- a/src/core/lib/iomgr/udp_server.cc +++ b/src/core/lib/iomgr/udp_server.cc @@ -260,7 +260,7 @@ static void finish_shutdown(grpc_udp_server* s) { grpc_core::Delete(s); } -static void destroyed_port(void* server, grpc_error* error) { +static void destroyed_port(void* server, grpc_error* /*error*/) { grpc_udp_server* s = static_cast(server); gpr_mu_lock(&s->mu); s->destroyed_ports++; @@ -495,7 +495,8 @@ void GrpcUdpListener::OnRead(grpc_error* error, void* do_read_arg) { // static // Wrapper of grpc_fd_notify_on_write() with a grpc_closure callback interface. -void GrpcUdpListener::fd_notify_on_write_wrapper(void* arg, grpc_error* error) { +void GrpcUdpListener::fd_notify_on_write_wrapper(void* arg, + grpc_error* /*error*/) { GrpcUdpListener* sp = static_cast(arg); gpr_mu_lock(sp->mutex()); if (!sp->notify_on_write_armed_) { diff --git a/src/core/lib/profiling/basic_timers.cc b/src/core/lib/profiling/basic_timers.cc index 37689fe89d1..2056940f3a6 100644 --- a/src/core/lib/profiling/basic_timers.cc +++ b/src/core/lib/profiling/basic_timers.cc @@ -287,7 +287,7 @@ void gpr_timers_global_init(void) {} void gpr_timers_global_destroy(void) {} -void gpr_timers_set_log_filename(const char* filename) {} +void gpr_timers_set_log_filename(const char* /*filename*/) {} -void gpr_timer_set_enabled(int enabled) {} +void gpr_timer_set_enabled(int /*enabled*/) {} #endif /* GRPC_BASIC_PROFILER */ diff --git a/src/core/lib/security/credentials/alts/alts_credentials.cc b/src/core/lib/security/credentials/alts/alts_credentials.cc index 9a337903063..4c3c7e113ee 100644 --- a/src/core/lib/security/credentials/alts/alts_credentials.cc +++ b/src/core/lib/security/credentials/alts/alts_credentials.cc @@ -50,8 +50,8 @@ grpc_alts_credentials::~grpc_alts_credentials() { grpc_core::RefCountedPtr grpc_alts_credentials::create_security_connector( grpc_core::RefCountedPtr call_creds, - const char* target_name, const grpc_channel_args* args, - grpc_channel_args** new_args) { + const char* target_name, const grpc_channel_args* /*args*/, + grpc_channel_args** /*new_args*/) { return grpc_alts_channel_security_connector_create( this->Ref(), std::move(call_creds), target_name); } diff --git a/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc b/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc index 1a59c456758..72c654211f1 100644 --- a/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +++ b/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc @@ -31,7 +31,7 @@ static grpc_alts_credentials_options* alts_server_options_copy( const grpc_alts_credentials_options* options); static void alts_server_options_destroy( - grpc_alts_credentials_options* options) {} + grpc_alts_credentials_options* /*options*/) {} static const grpc_alts_credentials_options_vtable vtable = { alts_server_options_copy, alts_server_options_destroy}; diff --git a/src/core/lib/security/credentials/fake/fake_credentials.cc b/src/core/lib/security/credentials/fake/fake_credentials.cc index 337dd7679fd..f6a04db3c1a 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.cc +++ b/src/core/lib/security/credentials/fake/fake_credentials.cc @@ -45,7 +45,7 @@ class grpc_fake_channel_credentials final : public grpc_channel_credentials { create_security_connector( grpc_core::RefCountedPtr call_creds, const char* target, const grpc_channel_args* args, - grpc_channel_args** new_args) override { + grpc_channel_args** /*new_args*/) override { return grpc_fake_channel_security_connector_create( this->Ref(), std::move(call_creds), target, args); } @@ -89,9 +89,9 @@ const char* grpc_fake_transport_get_expected_targets( /* -- Metadata-only test credentials. -- */ bool grpc_md_only_test_credentials::get_request_metadata( - grpc_polling_entity* pollent, grpc_auth_metadata_context context, + grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context /*context*/, grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata, - grpc_error** error) { + grpc_error** /*error*/) { grpc_credentials_mdelem_array_add(md_array, md_); if (is_async_) { GRPC_CLOSURE_SCHED(on_request_metadata, GRPC_ERROR_NONE); @@ -101,7 +101,7 @@ bool grpc_md_only_test_credentials::get_request_metadata( } void grpc_md_only_test_credentials::cancel_get_request_metadata( - grpc_credentials_mdelem_array* md_array, grpc_error* error) { + grpc_credentials_mdelem_array* /*md_array*/, grpc_error* error) { GRPC_ERROR_UNREF(error); } diff --git a/src/core/lib/security/security_connector/load_system_roots_linux.cc b/src/core/lib/security/security_connector/load_system_roots_linux.cc index 82d5bf6bcdd..61b0b9be5b9 100644 --- a/src/core/lib/security/security_connector/load_system_roots_linux.cc +++ b/src/core/lib/security/security_connector/load_system_roots_linux.cc @@ -66,6 +66,8 @@ grpc_slice GetSystemRootCerts() { grpc_load_file(kLinuxCertFiles[i], 1, &valid_bundle_slice); if (error == GRPC_ERROR_NONE) { return valid_bundle_slice; + } else { + GRPC_ERROR_UNREF(error); } } return grpc_empty_slice(); diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 3d3a68119f2..9631df3c1a2 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -37,11 +37,8 @@ extern grpc_core::DebugOnlyTraceFlag grpc_trace_metadata; /* This file provides a mechanism for tracking metadata through the grpc stack. It's not intended for consumption outside of the library. - Metadata is tracked in the context of a grpc_mdctx. For the time being there - is one of these per-channel, avoiding cross channel interference with memory - use and lock contention. - - The context tracks unique strings (grpc_mdstr) and pairs of strings + Metadata is tracked in the context of a sharded global grpc_mdctx. The + context tracks unique strings (grpc_mdstr) and pairs of strings (grpc_mdelem). Any of these objects can be checked for equality by comparing their pointers. These objects are reference counted. diff --git a/src/core/lib/transport/status_conversion.cc b/src/core/lib/transport/status_conversion.cc index e58bef5ba98..5f86dac078a 100644 --- a/src/core/lib/transport/status_conversion.cc +++ b/src/core/lib/transport/status_conversion.cc @@ -97,4 +97,4 @@ grpc_status_code grpc_http2_status_to_grpc_status(int status) { } } -int grpc_status_to_http2_status(grpc_status_code status) { return 200; } +int grpc_status_to_http2_status(grpc_status_code /*status*/) { return 200; } diff --git a/src/core/lib/transport/status_metadata.cc b/src/core/lib/transport/status_metadata.cc index 8ef96821c3d..bdb3bbb82cc 100644 --- a/src/core/lib/transport/status_metadata.cc +++ b/src/core/lib/transport/status_metadata.cc @@ -28,7 +28,7 @@ */ #define STATUS_OFFSET 1 -static void destroy_status(void* ignored) {} +static void destroy_status(void* /*ignored*/) {} grpc_status_code grpc_get_status_code_from_metadata(grpc_mdelem md) { if (grpc_mdelem_static_value_eq(md, GRPC_MDELEM_GRPC_STATUS_0)) { diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc index 80ffabce0e5..fe436e6f87f 100644 --- a/src/core/lib/transport/transport.cc +++ b/src/core/lib/transport/transport.cc @@ -80,12 +80,12 @@ grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount* refcount, } #ifndef NDEBUG -void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs, +void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/, grpc_iomgr_cb_func cb, void* cb_arg, const char* object_type) { refcount->object_type = object_type; #else -void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs, +void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/, grpc_iomgr_cb_func cb, void* cb_arg) { #endif GRPC_CLOSURE_INIT(&refcount->destroy, cb, cb_arg, grpc_schedule_on_exec_ctx); diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 8f46ce82c38..18374511cde 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -72,7 +72,10 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs, void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs, grpc_iomgr_cb_func cb, void* cb_arg); #define GRPC_STREAM_REF_INIT(rc, ir, cb, cb_arg, objtype) \ - grpc_stream_ref_init(rc, ir, cb, cb_arg) + do { \ + grpc_stream_ref_init(rc, ir, cb, cb_arg); \ + (void)(objtype); \ + } while (0) #endif #ifndef NDEBUG diff --git a/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc b/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc index 51bea24f1fa..a5b70032313 100644 --- a/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc +++ b/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc @@ -33,7 +33,7 @@ static void maybe_copy_error_msg(const char* src, char** dst) { /* Perform input santity check. */ static grpc_status_code unseal_check(alts_crypter* c, const unsigned char* data, - size_t data_allocated_size, + size_t /*data_allocated_size*/, size_t data_size, size_t* output_size, char** error_details) { /* Do common input sanity check. */ diff --git a/src/core/tsi/alts/handshaker/alts_shared_resource.cc b/src/core/tsi/alts/handshaker/alts_shared_resource.cc index 3501257f052..255eda5df31 100644 --- a/src/core/tsi/alts/handshaker/alts_shared_resource.cc +++ b/src/core/tsi/alts/handshaker/alts_shared_resource.cc @@ -30,7 +30,7 @@ alts_shared_resource_dedicated* grpc_alts_get_shared_resource_dedicated(void) { return &g_alts_resource_dedicated; } -static void thread_worker(void* arg) { +static void thread_worker(void* /*arg*/) { while (true) { grpc_event event = grpc_completion_queue_next(g_alts_resource_dedicated.cq, diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc index c5383b3a0ba..c6018af533a 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc @@ -264,18 +264,18 @@ static void on_handshaker_service_resp_recv(void* arg, grpc_error* error) { /* gRPC provided callback used when dedicatd CQ and thread are used. * It serves to safely bring the control back to application. */ static void on_handshaker_service_resp_recv_dedicated(void* arg, - grpc_error* error) { + grpc_error* /*error*/) { alts_shared_resource_dedicated* resource = grpc_alts_get_shared_resource_dedicated(); grpc_cq_end_op(resource->cq, arg, GRPC_ERROR_NONE, - [](void* done_arg, grpc_cq_completion* storage) {}, nullptr, - &resource->storage); + [](void* /*done_arg*/, grpc_cq_completion* /*storage*/) {}, + nullptr, &resource->storage); } static tsi_result handshaker_next( tsi_handshaker* self, const unsigned char* received_bytes, - size_t received_bytes_size, const unsigned char** bytes_to_send, - size_t* bytes_to_send_size, tsi_handshaker_result** result, + size_t received_bytes_size, const unsigned char** /*bytes_to_send*/, + size_t* /*bytes_to_send_size*/, tsi_handshaker_result** /*result*/, tsi_handshaker_on_next_done_cb cb, void* user_data) { if (self == nullptr || cb == nullptr) { gpr_log(GPR_ERROR, "Invalid arguments to handshaker_next()"); diff --git a/src/core/tsi/fake_transport_security.cc b/src/core/tsi/fake_transport_security.cc index 8fe9013cbcc..b12ae9b8250 100644 --- a/src/core/tsi/fake_transport_security.cc +++ b/src/core/tsi/fake_transport_security.cc @@ -495,7 +495,7 @@ typedef struct { } fake_handshaker_result; static tsi_result fake_handshaker_result_extract_peer( - const tsi_handshaker_result* self, tsi_peer* peer) { + const tsi_handshaker_result* /*self*/, tsi_peer* peer) { /* Construct a tsi_peer with 1 property: certificate type. */ tsi_result result = tsi_construct_peer(1, peer); if (result != TSI_OK) return result; @@ -507,7 +507,8 @@ static tsi_result fake_handshaker_result_extract_peer( } static tsi_result fake_handshaker_result_create_zero_copy_grpc_protector( - const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, + const tsi_handshaker_result* /*self*/, + size_t* max_output_protected_frame_size, tsi_zero_copy_grpc_protector** protector) { *protector = tsi_create_fake_zero_copy_grpc_protector(max_output_protected_frame_size); @@ -515,8 +516,8 @@ static tsi_result fake_handshaker_result_create_zero_copy_grpc_protector( } static tsi_result fake_handshaker_result_create_frame_protector( - const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, - tsi_frame_protector** protector) { + const tsi_handshaker_result* /*self*/, + size_t* max_output_protected_frame_size, tsi_frame_protector** protector) { *protector = tsi_create_fake_frame_protector(max_output_protected_frame_size); return TSI_OK; } @@ -670,7 +671,7 @@ static tsi_result fake_handshaker_next( tsi_handshaker* self, const unsigned char* received_bytes, size_t received_bytes_size, const unsigned char** bytes_to_send, size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result, - tsi_handshaker_on_next_done_cb cb, void* user_data) { + tsi_handshaker_on_next_done_cb /*cb*/, void* /*user_data*/) { /* Sanity check the arguments. */ if ((received_bytes_size > 0 && received_bytes == nullptr) || bytes_to_send == nullptr || bytes_to_send_size == nullptr || diff --git a/src/core/tsi/local_transport_security.cc b/src/core/tsi/local_transport_security.cc index ffd19a2d08a..f7e004f4a7c 100644 --- a/src/core/tsi/local_transport_security.cc +++ b/src/core/tsi/local_transport_security.cc @@ -105,12 +105,13 @@ tsi_result local_zero_copy_grpc_protector_create( /* --- tsi_handshaker_result methods implementation. --- */ static tsi_result handshaker_result_extract_peer( - const tsi_handshaker_result* self, tsi_peer* peer) { + const tsi_handshaker_result* /*self*/, tsi_peer* /*peer*/) { return TSI_OK; } static tsi_result handshaker_result_create_zero_copy_grpc_protector( - const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, + const tsi_handshaker_result* self, + size_t* /*max_output_protected_frame_size*/, tsi_zero_copy_grpc_protector** protector) { if (self == nullptr || protector == nullptr) { gpr_log(GPR_ERROR, @@ -158,10 +159,10 @@ static tsi_result create_handshaker_result(bool is_client, /* --- tsi_handshaker methods implementation. --- */ static tsi_result handshaker_next( - tsi_handshaker* self, const unsigned char* received_bytes, - size_t received_bytes_size, const unsigned char** bytes_to_send, + tsi_handshaker* self, const unsigned char* /*received_bytes*/, + size_t /*received_bytes_size*/, const unsigned char** /*bytes_to_send*/, size_t* bytes_to_send_size, tsi_handshaker_result** result, - tsi_handshaker_on_next_done_cb cb, void* user_data) { + tsi_handshaker_on_next_done_cb /*cb*/, void* /*user_data*/) { if (self == nullptr) { gpr_log(GPR_ERROR, "Invalid arguments to handshaker_next()"); return TSI_INVALID_ARGUMENT; diff --git a/src/core/tsi/ssl/session_cache/ssl_session_cache.cc b/src/core/tsi/ssl/session_cache/ssl_session_cache.cc index ba0745a2359..8e3a78f6393 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +++ b/src/core/tsi/ssl/session_cache/ssl_session_cache.cc @@ -28,18 +28,20 @@ namespace tsi { -static void cache_key_avl_destroy(void* key, void* unused) {} +static void cache_key_avl_destroy(void* /*key*/, void* /*unused*/) {} -static void* cache_key_avl_copy(void* key, void* unused) { return key; } +static void* cache_key_avl_copy(void* key, void* /*unused*/) { return key; } -static long cache_key_avl_compare(void* key1, void* key2, void* unused) { +static long cache_key_avl_compare(void* key1, void* key2, void* /*unused*/) { return grpc_slice_cmp(*static_cast(key1), *static_cast(key2)); } -static void cache_value_avl_destroy(void* value, void* unused) {} +static void cache_value_avl_destroy(void* /*value*/, void* /*unused*/) {} -static void* cache_value_avl_copy(void* value, void* unused) { return value; } +static void* cache_value_avl_copy(void* value, void* /*unused*/) { + return value; +} // AVL only stores pointers, ownership belonges to the linked list. static const grpc_avl_vtable cache_avl_vtable = { diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index a5b4a55badd..f062c458ae8 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -774,7 +774,7 @@ static tsi_result build_alpn_protocol_name_list( // the server's certificate, but we need to pull it anyway, in case a higher // layer wants to look at it. In this case the verification may fail, but // we don't really care. -static int NullVerifyCallback(int preverify_ok, X509_STORE_CTX* ctx) { +static int NullVerifyCallback(int /*preverify_ok*/, X509_STORE_CTX* /*ctx*/) { return 1; } @@ -1265,7 +1265,7 @@ static tsi_result ssl_handshaker_next( tsi_handshaker* self, const unsigned char* received_bytes, size_t received_bytes_size, const unsigned char** bytes_to_send, size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result, - tsi_handshaker_on_next_done_cb cb, void* user_data) { + tsi_handshaker_on_next_done_cb /*cb*/, void* /*user_data*/) { /* Input sanity check. */ if ((received_bytes_size > 0 && received_bytes == nullptr) || bytes_to_send == nullptr || bytes_to_send_size == nullptr || @@ -1465,11 +1465,9 @@ static void tsi_ssl_client_handshaker_factory_destroy( gpr_free(self); } -static int client_handshaker_factory_npn_callback(SSL* ssl, unsigned char** out, - unsigned char* outlen, - const unsigned char* in, - unsigned int inlen, - void* arg) { +static int client_handshaker_factory_npn_callback( + SSL* /*ssl*/, unsigned char** out, unsigned char* outlen, + const unsigned char* in, unsigned int inlen, void* arg) { tsi_ssl_client_handshaker_factory* factory = static_cast(arg); return select_protocol_list((const unsigned char**)out, outlen, @@ -1556,7 +1554,8 @@ static int does_entry_match_name(grpc_core::StringView entry, return !entry.empty() && name_subdomain == entry; } -static int ssl_server_handshaker_factory_servername_callback(SSL* ssl, int* ap, +static int ssl_server_handshaker_factory_servername_callback(SSL* ssl, + int* /*ap*/, void* arg) { tsi_ssl_server_handshaker_factory* impl = static_cast(arg); @@ -1579,7 +1578,7 @@ static int ssl_server_handshaker_factory_servername_callback(SSL* ssl, int* ap, #if TSI_OPENSSL_ALPN_SUPPORT static int server_handshaker_factory_alpn_callback( - SSL* ssl, const unsigned char** out, unsigned char* outlen, + SSL* /*ssl*/, const unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen, void* arg) { tsi_ssl_server_handshaker_factory* factory = static_cast(arg); @@ -1590,7 +1589,7 @@ static int server_handshaker_factory_alpn_callback( #endif /* TSI_OPENSSL_ALPN_SUPPORT */ static int server_handshaker_factory_npn_advertised_callback( - SSL* ssl, const unsigned char** out, unsigned int* outlen, void* arg) { + SSL* /*ssl*/, const unsigned char** out, unsigned int* outlen, void* arg) { tsi_ssl_server_handshaker_factory* factory = static_cast(arg); *out = factory->alpn_protocol_list; diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index de0f4e1787b..601bc1d41a3 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -180,7 +180,7 @@ class TagSaver final : public ::grpc::internal::CompletionQueueTag { public: explicit TagSaver(void* tag) : tag_(tag) {} ~TagSaver() override {} - bool FinalizeResult(void** tag, bool* status) override { + bool FinalizeResult(void** tag, bool* /*status*/) override { *tag = tag_; delete this; return true; diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index fc44b654efe..0aaaa5401ea 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -39,8 +39,8 @@ class DefaultGlobalClientCallbacks final : public ClientContext::GlobalCallbacks { public: ~DefaultGlobalClientCallbacks() override {} - void DefaultConstructor(ClientContext* context) override {} - void Destructor(ClientContext* context) override {} + void DefaultConstructor(ClientContext* /*context*/) override {} + void Destructor(ClientContext* /*context*/) override {} }; static grpc::internal::GrpcLibraryInitializer g_gli_initializer; diff --git a/src/cpp/common/alarm.cc b/src/cpp/common/alarm.cc index dbec80cde4f..2757350d47d 100644 --- a/src/cpp/common/alarm.cc +++ b/src/cpp/common/alarm.cc @@ -41,7 +41,7 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag { grpc_timer_init_unset(&timer_); } ~AlarmImpl() {} - bool FinalizeResult(void** tag, bool* status) override { + bool FinalizeResult(void** tag, bool* /*status*/) override { *tag = tag_; Unref(); return true; @@ -53,22 +53,23 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag { cq_ = cq->cq(); tag_ = tag; GPR_ASSERT(grpc_cq_begin_op(cq_, this)); - GRPC_CLOSURE_INIT(&on_alarm_, - [](void* arg, grpc_error* error) { - // queue the op on the completion queue - AlarmImpl* alarm = static_cast(arg); - alarm->Ref(); - // Preserve the cq and reset the cq_ so that the alarm - // can be reset when the alarm tag is delivered. - grpc_completion_queue* cq = alarm->cq_; - alarm->cq_ = nullptr; - grpc_cq_end_op( - cq, alarm, error, - [](void* arg, grpc_cq_completion* completion) {}, - arg, &alarm->completion_); - GRPC_CQ_INTERNAL_UNREF(cq, "alarm"); - }, - this, grpc_schedule_on_exec_ctx); + GRPC_CLOSURE_INIT( + &on_alarm_, + [](void* arg, grpc_error* error) { + // queue the op on the completion queue + AlarmImpl* alarm = static_cast(arg); + alarm->Ref(); + // Preserve the cq and reset the cq_ so that the alarm + // can be reset when the alarm tag is delivered. + grpc_completion_queue* cq = alarm->cq_; + alarm->cq_ = nullptr; + grpc_cq_end_op( + cq, alarm, error, + [](void* /*arg*/, grpc_cq_completion* /*completion*/) {}, arg, + &alarm->completion_); + GRPC_CQ_INTERNAL_UNREF(cq, "alarm"); + }, + this, grpc_schedule_on_exec_ctx); grpc_timer_init(&timer_, grpc_timespec_to_millis_round_up(deadline), &on_alarm_); } diff --git a/src/cpp/server/channel_argument_option.cc b/src/cpp/server/channel_argument_option.cc index 4d6be9011c1..9bd091c8872 100644 --- a/src/cpp/server/channel_argument_option.cc +++ b/src/cpp/server/channel_argument_option.cc @@ -31,7 +31,8 @@ std::unique_ptr MakeChannelArgumentOption( args->SetString(name_, value_); } virtual void UpdatePlugins( - std::vector>* plugins) override {} + std::vector>* /*plugins*/) + override {} private: const grpc::string name_; @@ -51,7 +52,8 @@ std::unique_ptr MakeChannelArgumentOption( args->SetInt(name_, value_); } virtual void UpdatePlugins( - std::vector>* plugins) override {} + std::vector>* /*plugins*/) + override {} private: const grpc::string name_; diff --git a/src/cpp/server/health/health_check_service_server_builder_option.cc b/src/cpp/server/health/health_check_service_server_builder_option.cc index 7148265d271..3fa384ace9e 100644 --- a/src/cpp/server/health/health_check_service_server_builder_option.cc +++ b/src/cpp/server/health/health_check_service_server_builder_option.cc @@ -30,6 +30,6 @@ void HealthCheckServiceServerBuilderOption::UpdateArguments( } void HealthCheckServiceServerBuilderOption::UpdatePlugins( - std::vector>* plugins) {} + std::vector>* /*plugins*/) {} } // namespace grpc diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 143fa3f8c98..bf20c843c30 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -74,6 +74,9 @@ class ServerContext::CompletionOp final // But this class is not trivially destructible, so must actually call delete // before allowing the arena to be freed static void operator delete(void* /*ptr*/, std::size_t size) { + // Use size to avoid unused-parameter warning since assert seems to be + // compiled out and treated as unused in some gcc optimized versions. + (void)size; assert(size == sizeof(CompletionOp)); } diff --git a/src/objective-c/BoringSSL-GRPC.podspec b/src/objective-c/BoringSSL-GRPC.podspec index 48acefa0e57..26c20a0609f 100644 --- a/src/objective-c/BoringSSL-GRPC.podspec +++ b/src/objective-c/BoringSSL-GRPC.podspec @@ -4,7 +4,9 @@ # Please make modifications to # `templates/src/objective-c/BoringSSL-GRPC.podspec.template` instead. This # file can be regenerated from the template by running -# `tools/buildgen/generate_projects.sh`. +# `tools/buildgen/generate_projects.sh`. Because of some limitations of this +# template, you might actually need to run the same script twice in a row. +# (see err_data.c section) # BoringSSL CocoaPods podspec @@ -199,9 +201,14 @@ Pod::Spec.new do |s| } EOF - # This is a bit ridiculous, but requiring people to install Go in order to build is slightly - # more ridiculous IMO. - # TODO(jcanizales): Translate err_data_generate.go into a Bash or Ruby script. + # To build boringssl, we need the generated file err_data.c, which is normally generated + # by boringssl's err_data_generate.go, but we already have a copy of err_data.c checked into the + # grpc/grpc repository that gets regenerated whenever we update the third_party/boringssl submodule. + # To make the podspec independent of the grpc repository, the .podspec.template just copies + # the contents of err_data.c directly into the .podspec. + # TODO(jtattermusch): avoid needing to run tools/buildgen/generate_projects.sh twice on update + # TODO(jtattermusch): another pre-generated copy of err_data.c is under third_party/boringssl-with-bazel + # investigate if we could use it. cat > err_data.c < #include #include - - + + OPENSSL_STATIC_ASSERT(ERR_LIB_NONE == 1, "library value changed"); OPENSSL_STATIC_ASSERT(ERR_LIB_SYS == 2, "library value changed"); OPENSSL_STATIC_ASSERT(ERR_LIB_BN == 3, "library value changed"); @@ -257,7 +264,7 @@ Pod::Spec.new do |s| OPENSSL_STATIC_ASSERT(ERR_LIB_HKDF == 31, "library value changed"); OPENSSL_STATIC_ASSERT(ERR_LIB_USER == 32, "library value changed"); OPENSSL_STATIC_ASSERT(ERR_NUM_LIBS == 33, "number of libraries changed"); - + const uint32_t kOpenSSLReasonValues[] = { 0xc32083a, 0xc328854, @@ -280,54 +287,54 @@ Pod::Spec.new do |s| 0xc3b00ea, 0xc3b88d6, 0x10320847, - 0x10329574, - 0x10331580, - 0x10339599, - 0x103415ac, + 0x1032959f, + 0x103315ab, + 0x103395c4, + 0x103415d7, 0x10348f27, 0x10350c60, - 0x103595bf, - 0x103615e9, - 0x103695fc, - 0x1037161b, - 0x10379634, - 0x10381649, - 0x10389667, - 0x10391676, - 0x10399692, - 0x103a16ad, - 0x103a96bc, - 0x103b16d8, - 0x103b96f3, - 0x103c1719, + 0x103595ea, + 0x10361614, + 0x10369627, + 0x10371646, + 0x1037965f, + 0x10381674, + 0x10389692, + 0x103916a1, + 0x103996bd, + 0x103a16d8, + 0x103a96e7, + 0x103b1703, + 0x103b971e, + 0x103c1744, 0x103c80ea, - 0x103d172a, - 0x103d973e, - 0x103e175d, - 0x103e976c, - 0x103f1783, - 0x103f9796, + 0x103d1755, + 0x103d9769, + 0x103e1788, + 0x103e9797, + 0x103f17ae, + 0x103f97c1, 0x10400c24, - 0x104097a9, - 0x104117c7, - 0x104197da, - 0x104217f4, - 0x10429804, - 0x10431818, - 0x1043982e, - 0x10441846, - 0x1044985b, - 0x1045186f, - 0x10459881, + 0x104097d4, + 0x104117f2, + 0x10419805, + 0x1042181f, + 0x1042982f, + 0x10431843, + 0x10439859, + 0x10441871, + 0x10449886, + 0x1045189a, + 0x104598ac, 0x104605fd, 0x1046894f, - 0x10471896, - 0x104798ad, - 0x104818c2, - 0x104898d0, + 0x104718c1, + 0x104798d8, + 0x104818ed, + 0x104898fb, 0x10490e73, - 0x1049970a, - 0x104a15d4, + 0x10499735, + 0x104a15ff, 0x14320c07, 0x14328c15, 0x14330c24, @@ -350,41 +357,43 @@ Pod::Spec.new do |s| 0x1838905b, 0x18390a75, 0x1839906b, - 0x183a1080, - 0x183a90a6, + 0x183a1091, + 0x183a90b7, 0x183b0c7f, - 0x183b90db, - 0x183c10ed, - 0x183c90f8, - 0x183d1108, - 0x183d9119, - 0x183e112a, - 0x183e913c, - 0x183f1165, - 0x183f917e, - 0x18401196, + 0x183b9106, + 0x183c1118, + 0x183c9123, + 0x183d1133, + 0x183d9144, + 0x183e1155, + 0x183e9167, + 0x183f1190, + 0x183f91a9, + 0x184011c1, 0x184086d5, - 0x184110c9, - 0x18419094, - 0x184210b3, + 0x184110da, + 0x184190a5, + 0x184210c4, 0x18428c6c, - 0x203211d0, - 0x203291bd, - 0x243211dc, + 0x18431080, + 0x184390ec, + 0x203211fb, + 0x203291e8, + 0x24321207, 0x24328995, - 0x243311ee, - 0x243391fb, - 0x24341208, - 0x2434921a, - 0x24351229, - 0x24359246, - 0x24361253, - 0x24369261, - 0x2437126f, - 0x2437927d, - 0x24381286, - 0x24389293, - 0x243912a6, + 0x24331219, + 0x24339226, + 0x24341233, + 0x24349245, + 0x24351254, + 0x24359271, + 0x2436127e, + 0x2436928c, + 0x2437129a, + 0x243792a8, + 0x243812b1, + 0x243892be, + 0x243912d1, 0x28320c54, 0x28328c7f, 0x28330c24, @@ -393,44 +402,44 @@ Pod::Spec.new do |s| 0x283480ac, 0x283500ea, 0x28358c6c, - 0x2c322ec7, - 0x2c3292bd, - 0x2c332ed5, - 0x2c33aee7, - 0x2c342efb, - 0x2c34af0d, - 0x2c352f28, - 0x2c35af3a, - 0x2c362f4d, + 0x2c322f0c, + 0x2c3292e8, + 0x2c332f1a, + 0x2c33af2c, + 0x2c342f40, + 0x2c34af52, + 0x2c352f6d, + 0x2c35af7f, + 0x2c362f92, 0x2c36832d, - 0x2c372f5a, - 0x2c37af6c, - 0x2c382f91, - 0x2c38afa8, - 0x2c392fb6, - 0x2c39afc6, - 0x2c3a2fd8, - 0x2c3aafec, - 0x2c3b2ffd, - 0x2c3bb01c, - 0x2c3c12cf, - 0x2c3c92e5, - 0x2c3d3030, - 0x2c3d92fe, - 0x2c3e304d, - 0x2c3eb05b, - 0x2c3f3073, - 0x2c3fb08b, - 0x2c4030b5, - 0x2c4091d0, - 0x2c4130c6, - 0x2c41b0d9, - 0x2c421196, - 0x2c42b0ea, + 0x2c372f9f, + 0x2c37afb1, + 0x2c382fd6, + 0x2c38afed, + 0x2c392ffb, + 0x2c39b00b, + 0x2c3a301d, + 0x2c3ab031, + 0x2c3b3042, + 0x2c3bb061, + 0x2c3c12fa, + 0x2c3c9310, + 0x2c3d3075, + 0x2c3d9329, + 0x2c3e3092, + 0x2c3eb0a0, + 0x2c3f30b8, + 0x2c3fb0d0, + 0x2c4030fa, + 0x2c4091fb, + 0x2c41310b, + 0x2c41b11e, + 0x2c4211c1, + 0x2c42b12f, 0x2c430722, - 0x2c43b00e, - 0x2c442f7f, - 0x2c44b098, + 0x2c43b053, + 0x2c442fc4, + 0x2c44b0dd, 0x30320000, 0x30328015, 0x3033001f, @@ -565,240 +574,241 @@ Pod::Spec.new do |s| 0x3c418d67, 0x3c420e73, 0x3c428dfd, - 0x40321946, - 0x4032995c, - 0x4033198a, - 0x40339994, - 0x403419ab, - 0x403499c9, - 0x403519d9, - 0x403599eb, - 0x403619f8, - 0x40369a04, - 0x40371a19, - 0x40379a2b, - 0x40381a36, - 0x40389a48, + 0x40321971, + 0x40329987, + 0x403319b5, + 0x403399bf, + 0x403419d6, + 0x403499f4, + 0x40351a04, + 0x40359a16, + 0x40361a23, + 0x40369a2f, + 0x40371a44, + 0x40379a56, + 0x40381a61, + 0x40389a73, 0x40390f27, - 0x40399a58, - 0x403a1a6b, - 0x403a9a8c, - 0x403b1a9d, - 0x403b9aad, + 0x40399a83, + 0x403a1a96, + 0x403a9ab7, + 0x403b1ac8, + 0x403b9ad8, 0x403c0064, 0x403c8083, - 0x403d1b31, - 0x403d9b47, - 0x403e1b56, - 0x403e9b8e, - 0x403f1ba8, - 0x403f9bd0, - 0x40401be5, - 0x40409bf9, - 0x40411c16, - 0x40419c31, - 0x40421c4a, - 0x40429c5d, - 0x40431c71, - 0x40439c89, - 0x40441ca0, + 0x403d1b5c, + 0x403d9b72, + 0x403e1b81, + 0x403e9bb9, + 0x403f1bd3, + 0x403f9bfb, + 0x40401c10, + 0x40409c24, + 0x40411c41, + 0x40419c5c, + 0x40421c75, + 0x40429c88, + 0x40431c9c, + 0x40439cb4, + 0x40441ccb, 0x404480ac, - 0x40451cb5, - 0x40459cc7, - 0x40461ceb, - 0x40469d0b, - 0x40471d19, - 0x40479d40, - 0x40481db1, - 0x40489de4, - 0x40491dfb, - 0x40499e15, - 0x404a1e2c, - 0x404a9e4a, - 0x404b1e62, - 0x404b9e79, - 0x404c1e8f, - 0x404c9ea1, - 0x404d1ec2, - 0x404d9efb, - 0x404e1f0f, - 0x404e9f1c, - 0x404f1f49, - 0x404f9f8f, - 0x40501fe6, - 0x40509ffa, - 0x4051202d, - 0x4052203d, - 0x4052a061, - 0x40532079, - 0x4053a08c, - 0x405420a1, - 0x4054a0c4, - 0x405520d2, - 0x4055a10f, - 0x4056211c, - 0x4056a135, - 0x4057214d, - 0x4057a160, - 0x40582175, - 0x4058a19c, - 0x405921cb, - 0x4059a1f8, - 0x405a220c, - 0x405aa21c, - 0x405b2234, - 0x405ba245, - 0x405c2258, - 0x405ca297, - 0x405d22a4, - 0x405da2c9, - 0x405e2307, + 0x40451ce0, + 0x40459cf2, + 0x40461d16, + 0x40469d36, + 0x40471d44, + 0x40479d6b, + 0x40481ddc, + 0x40489e0f, + 0x40491e26, + 0x40499e40, + 0x404a1e57, + 0x404a9e75, + 0x404b1e8d, + 0x404b9ea4, + 0x404c1eba, + 0x404c9ecc, + 0x404d1eed, + 0x404d9f26, + 0x404e1f3a, + 0x404e9f47, + 0x404f1f8e, + 0x404f9fd4, + 0x4050202b, + 0x4050a03f, + 0x40512072, + 0x40522082, + 0x4052a0a6, + 0x405320be, + 0x4053a0d1, + 0x405420e6, + 0x4054a109, + 0x40552117, + 0x4055a154, + 0x40562161, + 0x4056a17a, + 0x40572192, + 0x4057a1a5, + 0x405821ba, + 0x4058a1e1, + 0x40592210, + 0x4059a23d, + 0x405a2251, + 0x405aa261, + 0x405b2279, + 0x405ba28a, + 0x405c229d, + 0x405ca2dc, + 0x405d22e9, + 0x405da30e, + 0x405e234c, 0x405e8ab3, - 0x405f2328, - 0x405fa335, - 0x40602343, - 0x4060a365, - 0x406123c6, - 0x4061a3fe, - 0x40622415, - 0x4062a426, - 0x4063244b, - 0x4063a460, - 0x40642477, - 0x4064a4a3, - 0x406524be, - 0x4065a4d5, - 0x406624ed, - 0x4066a517, - 0x40672542, - 0x4067a587, - 0x406825cf, - 0x4068a5f0, - 0x40692622, - 0x4069a650, - 0x406a2671, - 0x406aa691, - 0x406b2819, - 0x406ba83c, - 0x406c2852, - 0x406caaf5, - 0x406d2b24, - 0x406dab4c, - 0x406e2b7a, - 0x406eabc7, - 0x406f2c02, - 0x406fac3a, - 0x40702c4d, - 0x4070ac6a, + 0x405f236d, + 0x405fa37a, + 0x40602388, + 0x4060a3aa, + 0x4061240b, + 0x4061a443, + 0x4062245a, + 0x4062a46b, + 0x40632490, + 0x4063a4a5, + 0x406424bc, + 0x4064a4e8, + 0x40652503, + 0x4065a51a, + 0x40662532, + 0x4066a55c, + 0x40672587, + 0x4067a5cc, + 0x40682614, + 0x4068a635, + 0x40692667, + 0x4069a695, + 0x406a26b6, + 0x406aa6d6, + 0x406b285e, + 0x406ba881, + 0x406c2897, + 0x406cab3a, + 0x406d2b69, + 0x406dab91, + 0x406e2bbf, + 0x406eac0c, + 0x406f2c47, + 0x406fac7f, + 0x40702c92, + 0x4070acaf, 0x40710802, - 0x4071ac7c, - 0x40722c8f, - 0x4072acc5, - 0x40732cdd, - 0x407394cf, - 0x40742cf1, - 0x4074ad0b, - 0x40752d1c, - 0x4075ad30, - 0x40762d3e, - 0x40769293, - 0x40772d63, - 0x4077ad85, - 0x40782da0, - 0x4078add9, - 0x40792df0, - 0x4079ae06, - 0x407a2e32, - 0x407aae45, - 0x407b2e5a, - 0x407bae6c, - 0x407c2e9d, - 0x407caea6, - 0x407d260b, - 0x407d9f9f, - 0x407e2db5, - 0x407ea1ac, - 0x407f1d2d, - 0x407f9ad3, - 0x40801f59, - 0x40809d55, - 0x4081204f, - 0x40819f33, - 0x40822b65, - 0x40829ab9, - 0x40832187, - 0x4083a488, - 0x40841d69, - 0x4084a1e4, - 0x40852269, - 0x4085a38d, - 0x408622e9, - 0x40869fb9, - 0x40872bab, - 0x4087a3db, - 0x40881b1a, - 0x4088a59a, - 0x40891b69, - 0x40899af6, - 0x408a288a, - 0x408a98e7, - 0x408b2e81, - 0x408bac17, - 0x408c2279, - 0x408c9903, - 0x408d1dca, - 0x408d9d9b, - 0x408e1ee4, - 0x408ea0ef, - 0x408f25ae, - 0x408fa3a9, - 0x40902563, - 0x4090a2bb, - 0x40912872, - 0x40919929, - 0x40921bb6, - 0x4092abe6, - 0x40932ca8, - 0x40939fca, - 0x40941d7d, - 0x4094a8a3, - 0x40952437, - 0x4095ae12, - 0x40962b92, - 0x40969f72, - 0x40972015, - 0x41f42744, - 0x41f927d6, - 0x41fe26c9, - 0x41fea8e6, - 0x41ff29d7, - 0x4203275d, - 0x4208277f, - 0x4208a7bb, - 0x420926ad, - 0x4209a7f5, - 0x420a2704, - 0x420aa6e4, - 0x420b2724, - 0x420ba79d, - 0x420c29f3, - 0x420ca8b3, - 0x420d28cd, - 0x420da904, - 0x4212291e, - 0x421729ba, - 0x4217a960, - 0x421c2982, - 0x421f293d, - 0x42212a0a, - 0x4226299d, - 0x422b2ad9, - 0x422baa87, - 0x422c2ac1, - 0x422caa46, - 0x422d2a25, - 0x422daaa6, - 0x422e2a6c, + 0x4071acc1, + 0x40722cd4, + 0x4072ad0a, + 0x40732d22, + 0x407394fa, + 0x40742d36, + 0x4074ad50, + 0x40752d61, + 0x4075ad75, + 0x40762d83, + 0x407692be, + 0x40772da8, + 0x4077adca, + 0x40782de5, + 0x4078ae1e, + 0x40792e35, + 0x4079ae4b, + 0x407a2e77, + 0x407aae8a, + 0x407b2e9f, + 0x407baeb1, + 0x407c2ee2, + 0x407caeeb, + 0x407d2650, + 0x407d9fe4, + 0x407e2dfa, + 0x407ea1f1, + 0x407f1d58, + 0x407f9afe, + 0x40801f9e, + 0x40809d80, + 0x40812094, + 0x40819f78, + 0x40822baa, + 0x40829ae4, + 0x408321cc, + 0x4083a4cd, + 0x40841d94, + 0x4084a229, + 0x408522ae, + 0x4085a3d2, + 0x4086232e, + 0x40869ffe, + 0x40872bf0, + 0x4087a420, + 0x40881b45, + 0x4088a5df, + 0x40891b94, + 0x40899b21, + 0x408a28cf, + 0x408a9912, + 0x408b2ec6, + 0x408bac5c, + 0x408c22be, + 0x408c992e, + 0x408d1df5, + 0x408d9dc6, + 0x408e1f0f, + 0x408ea134, + 0x408f25f3, + 0x408fa3ee, + 0x409025a8, + 0x4090a300, + 0x409128b7, + 0x40919954, + 0x40921be1, + 0x4092ac2b, + 0x40932ced, + 0x4093a00f, + 0x40941da8, + 0x4094a8e8, + 0x4095247c, + 0x4095ae57, + 0x40962bd7, + 0x40969fb7, + 0x4097205a, + 0x40979f5e, + 0x41f42789, + 0x41f9281b, + 0x41fe270e, + 0x41fea92b, + 0x41ff2a1c, + 0x420327a2, + 0x420827c4, + 0x4208a800, + 0x420926f2, + 0x4209a83a, + 0x420a2749, + 0x420aa729, + 0x420b2769, + 0x420ba7e2, + 0x420c2a38, + 0x420ca8f8, + 0x420d2912, + 0x420da949, + 0x42122963, + 0x421729ff, + 0x4217a9a5, + 0x421c29c7, + 0x421f2982, + 0x42212a4f, + 0x422629e2, + 0x422b2b1e, + 0x422baacc, + 0x422c2b06, + 0x422caa8b, + 0x422d2a6a, + 0x422daaeb, + 0x422e2ab1, 0x4432072d, 0x4432873c, 0x44330748, @@ -816,106 +826,106 @@ Pod::Spec.new do |s| 0x44390802, 0x44398810, 0x443a0823, - 0x483212bd, - 0x483292cf, - 0x483312e5, - 0x483392fe, - 0x4c321323, - 0x4c329333, - 0x4c331346, - 0x4c339366, + 0x483212e8, + 0x483292fa, + 0x48331310, + 0x48339329, + 0x4c32134e, + 0x4c32935e, + 0x4c331371, + 0x4c339391, 0x4c3400ac, 0x4c3480ea, - 0x4c351372, - 0x4c359380, - 0x4c36139c, - 0x4c3693c2, - 0x4c3713d1, - 0x4c3793df, - 0x4c3813f4, - 0x4c389400, - 0x4c391420, - 0x4c39944a, - 0x4c3a1463, - 0x4c3a947c, + 0x4c35139d, + 0x4c3593ab, + 0x4c3613c7, + 0x4c3693ed, + 0x4c3713fc, + 0x4c37940a, + 0x4c38141f, + 0x4c38942b, + 0x4c39144b, + 0x4c399475, + 0x4c3a148e, + 0x4c3a94a7, 0x4c3b05fd, - 0x4c3b9495, - 0x4c3c14a7, - 0x4c3c94b6, - 0x4c3d14cf, + 0x4c3b94c0, + 0x4c3c14d2, + 0x4c3c94e1, + 0x4c3d14fa, 0x4c3d8c47, - 0x4c3e153c, - 0x4c3e94de, - 0x4c3f155e, - 0x4c3f9293, - 0x4c4014f4, - 0x4c40930f, - 0x4c41152c, - 0x4c4193af, - 0x4c421518, - 0x503230fc, - 0x5032b10b, - 0x50333116, - 0x5033b126, - 0x5034313f, - 0x5034b159, - 0x50353167, - 0x5035b17d, - 0x5036318f, - 0x5036b1a5, - 0x503731be, - 0x5037b1d1, - 0x503831e9, - 0x5038b1fa, - 0x5039320f, - 0x5039b223, - 0x503a3243, - 0x503ab259, - 0x503b3271, - 0x503bb283, - 0x503c329f, - 0x503cb2b6, - 0x503d32cf, - 0x503db2e5, - 0x503e32f2, - 0x503eb308, - 0x503f331a, + 0x4c3e1567, + 0x4c3e9509, + 0x4c3f1589, + 0x4c3f92be, + 0x4c40151f, + 0x4c40933a, + 0x4c411557, + 0x4c4193da, + 0x4c421543, + 0x50323141, + 0x5032b150, + 0x5033315b, + 0x5033b16b, + 0x50343184, + 0x5034b19e, + 0x503531ac, + 0x5035b1c2, + 0x503631d4, + 0x5036b1ea, + 0x50373203, + 0x5037b216, + 0x5038322e, + 0x5038b23f, + 0x50393254, + 0x5039b268, + 0x503a3288, + 0x503ab29e, + 0x503b32b6, + 0x503bb2c8, + 0x503c32e4, + 0x503cb2fb, + 0x503d3314, + 0x503db32a, + 0x503e3337, + 0x503eb34d, + 0x503f335f, 0x503f837b, - 0x5040332d, - 0x5040b33d, - 0x50413357, - 0x5041b366, - 0x50423380, - 0x5042b39d, - 0x504333ad, - 0x5043b3bd, - 0x504433cc, + 0x50403372, + 0x5040b382, + 0x5041339c, + 0x5041b3ab, + 0x504233c5, + 0x5042b3e2, + 0x504333f2, + 0x5043b402, + 0x50443411, 0x50448431, - 0x504533e0, - 0x5045b3fe, - 0x50463411, - 0x5046b427, - 0x50473439, - 0x5047b44e, - 0x50483474, - 0x5048b482, - 0x50493495, - 0x5049b4aa, - 0x504a34c0, - 0x504ab4d0, - 0x504b34f0, - 0x504bb503, - 0x504c3526, - 0x504cb554, - 0x504d3566, - 0x504db583, - 0x504e359e, - 0x504eb5ba, - 0x504f35cc, - 0x504fb5e3, - 0x505035f2, + 0x50453425, + 0x5045b443, + 0x50463456, + 0x5046b46c, + 0x5047347e, + 0x5047b493, + 0x504834b9, + 0x5048b4c7, + 0x504934da, + 0x5049b4ef, + 0x504a3505, + 0x504ab515, + 0x504b3535, + 0x504bb548, + 0x504c356b, + 0x504cb599, + 0x504d35ab, + 0x504db5c8, + 0x504e35e3, + 0x504eb5ff, + 0x504f3611, + 0x504fb628, + 0x50503637, 0x505086f1, - 0x50513605, + 0x5051364a, 0x58320f65, 0x68320f27, 0x68328c7f, @@ -956,11 +966,11 @@ Pod::Spec.new do |s| 0x783d8b4c, 0x783e0aa2, 0x783e8a54, - 0x7c3211ac, + 0x7c3211d7, }; - + const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]); - + const char kOpenSSLReasonStringData[] = "ASN1_LENGTH_MISMATCH\\0" "AUX_ERROR\\0" @@ -1181,11 +1191,13 @@ Pod::Spec.new do |s| "INVALID_KEYBITS\\0" "INVALID_MGF1_MD\\0" "INVALID_PADDING_MODE\\0" + "INVALID_PEER_KEY\\0" "INVALID_PSS_SALTLEN\\0" "INVALID_SIGNATURE\\0" "KEYS_NOT_SET\\0" "MEMORY_LIMIT_EXCEEDED\\0" "NOT_A_PRIVATE_KEY\\0" + "NOT_XOF_OR_INVALID_LENGTH\\0" "NO_DEFAULT_DIGEST\\0" "NO_KEY_SET\\0" "NO_MDC2_SUPPORT\\0" @@ -1356,6 +1368,7 @@ Pod::Spec.new do |s| "HTTPS_PROXY_REQUEST\\0" "HTTP_REQUEST\\0" "INAPPROPRIATE_FALLBACK\\0" + "INCONSISTENT_CLIENT_HELLO\\0" "INVALID_ALPN_PROTOCOL\\0" "INVALID_COMMAND\\0" "INVALID_COMPRESSION_LIST\\0" @@ -1603,6 +1616,7 @@ Pod::Spec.new do |s| "UNSUPPORTED_OPTION\\0" "USER_TOO_LONG\\0" ""; + EOF # Remove lines of the format "#define SOME_MACRO SOME_MACRO" because they mess up the symbol prefix diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index f1584940a86..27d82947a86 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -20,6 +20,7 @@ import threading import time import grpc +import grpc.experimental from grpc import _compression from grpc import _common from grpc import _grpcio_metadata @@ -248,16 +249,47 @@ def _consume_request_iterator(request_iterator, state, call, request_serializer, consumption_thread.start() -class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too-many-ancestors +class _SingleThreadedRendezvous(grpc.RpcError, grpc.Call): # pylint: disable=too-many-ancestors + """An RPC iterator operating entirely on a single thread. + + The __next__ method of _SingleThreadedRendezvous does not depend on the + existence of any other thread, including the "channel spin thread". + However, this means that its interface is entirely synchronous. So this + class cannot fulfill the grpc.Future interface. + + Attributes: + _state: An instance of _RPCState. + _call: An instance of SegregatedCall or (for subclasses) IntegratedCall. + In either case, the _call object is expected to have operate, cancel, + and next_event methods. + _response_deserializer: A callable taking bytes and return a Python + object. + _deadline: A float representing the deadline of the RPC in seconds. Or + possibly None, to represent an RPC with no deadline at all. + """ def __init__(self, state, call, response_deserializer, deadline): - super(_Rendezvous, self).__init__() + super(_SingleThreadedRendezvous, self).__init__() self._state = state self._call = call self._response_deserializer = response_deserializer self._deadline = deadline + def is_active(self): + """See grpc.RpcContext.is_active""" + with self._state.condition: + return self._state.code is None + + def time_remaining(self): + """See grpc.RpcContext.time_remaining""" + with self._state.condition: + if self._deadline is None: + return None + else: + return max(self._deadline - time.time(), 0) + def cancel(self): + """See grpc.RpcContext.cancel""" with self._state.condition: if self._state.code is None: code = grpc.StatusCode.CANCELLED @@ -267,7 +299,154 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too self._state.cancelled = True _abort(self._state, code, details) self._state.condition.notify_all() - return False + return True + else: + return False + + def add_callback(self, callback): + """See grpc.RpcContext.add_callback""" + with self._state.condition: + if self._state.callbacks is None: + return False + else: + self._state.callbacks.append(callback) + return True + + def initial_metadata(self): + """See grpc.Call.initial_metadata""" + with self._state.condition: + + def _done(): + return self._state.initial_metadata is not None + + _common.wait(self._state.condition.wait, _done) + return self._state.initial_metadata + + def trailing_metadata(self): + """See grpc.Call.trailing_metadata""" + with self._state.condition: + + def _done(): + return self._state.trailing_metadata is not None + + _common.wait(self._state.condition.wait, _done) + return self._state.trailing_metadata + + # TODO(https://github.com/grpc/grpc/issues/20763): Drive RPC progress using + # the calling thread. + def code(self): + """See grpc.Call.code""" + with self._state.condition: + + def _done(): + return self._state.code is not None + + _common.wait(self._state.condition.wait, _done) + return self._state.code + + def details(self): + """See grpc.Call.details""" + with self._state.condition: + + def _done(): + return self._state.details is not None + + _common.wait(self._state.condition.wait, _done) + return _common.decode(self._state.details) + + def _next(self): + with self._state.condition: + if self._state.code is None: + operating = self._call.operate( + (cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS),), None) + if operating: + self._state.due.add(cygrpc.OperationType.receive_message) + elif self._state.code is grpc.StatusCode.OK: + raise StopIteration() + else: + raise self + while True: + event = self._call.next_event() + with self._state.condition: + callbacks = _handle_event(event, self._state, + self._response_deserializer) + for callback in callbacks: + try: + callback() + except Exception as e: # pylint: disable=broad-except + # NOTE(rbellevi): We suppress but log errors here so as not to + # kill the channel spin thread. + logging.error('Exception in callback %s: %s', + repr(callback.func), repr(e)) + if self._state.response is not None: + response = self._state.response + self._state.response = None + return response + elif cygrpc.OperationType.receive_message not in self._state.due: + if self._state.code is grpc.StatusCode.OK: + raise StopIteration() + elif self._state.code is not None: + raise self + + def __next__(self): + return self._next() + + def next(self): + return self._next() + + def __iter__(self): + return self + + def debug_error_string(self): + with self._state.condition: + + def _done(): + return self._state.debug_error_string is not None + + _common.wait(self._state.condition.wait, _done) + return _common.decode(self._state.debug_error_string) + + def _repr(self): + with self._state.condition: + if self._state.code is None: + return '<{} object of in-flight RPC>'.format( + self.__class__.__name__) + elif self._state.code is grpc.StatusCode.OK: + return _OK_RENDEZVOUS_REPR_FORMAT.format( + self._state.code, self._state.details) + else: + return _NON_OK_RENDEZVOUS_REPR_FORMAT.format( + self._state.code, self._state.details, + self._state.debug_error_string) + + def __repr__(self): + return self._repr() + + def __str__(self): + return self._repr() + + def __del__(self): + with self._state.condition: + if self._state.code is None: + self._state.code = grpc.StatusCode.CANCELLED + self._state.details = 'Cancelled upon garbage collection!' + self._state.cancelled = True + self._call.cancel( + _common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[self._state.code], + self._state.details) + self._state.condition.notify_all() + + +class _Rendezvous(_SingleThreadedRendezvous, grpc.Future): # pylint: disable=too-many-ancestors + """An RPC iterator that depends on a channel spin thread. + + This iterator relies upon a per-channel thread running in the background, + dequeueing events from the completion queue, and notifying threads waiting + on the threading.Condition object in the _RPCState object. + + This extra thread allows _Rendezvous to fulfill the grpc.Future interface + and to mediate a bidirection streaming RPC. + """ def cancelled(self): with self._state.condition: @@ -381,25 +560,6 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too elif self._state.code is not None: raise self - def __iter__(self): - return self - - def __next__(self): - return self._next() - - def next(self): - return self._next() - - def is_active(self): - with self._state.condition: - return self._state.code is None - - def time_remaining(self): - if self._deadline is None: - return None - else: - return max(self._deadline - time.time(), 0) - def add_callback(self, callback): with self._state.condition: if self._state.callbacks is None: @@ -408,80 +568,6 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too self._state.callbacks.append(callback) return True - def initial_metadata(self): - with self._state.condition: - - def _done(): - return self._state.initial_metadata is not None - - _common.wait(self._state.condition.wait, _done) - return self._state.initial_metadata - - def trailing_metadata(self): - with self._state.condition: - - def _done(): - return self._state.trailing_metadata is not None - - _common.wait(self._state.condition.wait, _done) - return self._state.trailing_metadata - - def code(self): - with self._state.condition: - - def _done(): - return self._state.code is not None - - _common.wait(self._state.condition.wait, _done) - return self._state.code - - def details(self): - with self._state.condition: - - def _done(): - return self._state.details is not None - - _common.wait(self._state.condition.wait, _done) - return _common.decode(self._state.details) - - def debug_error_string(self): - with self._state.condition: - - def _done(): - return self._state.debug_error_string is not None - - _common.wait(self._state.condition.wait, _done) - return _common.decode(self._state.debug_error_string) - - def _repr(self): - with self._state.condition: - if self._state.code is None: - return '<_Rendezvous object of in-flight RPC>' - elif self._state.code is grpc.StatusCode.OK: - return _OK_RENDEZVOUS_REPR_FORMAT.format( - self._state.code, self._state.details) - else: - return _NON_OK_RENDEZVOUS_REPR_FORMAT.format( - self._state.code, self._state.details, - self._state.debug_error_string) - - def __repr__(self): - return self._repr() - - def __str__(self): - return self._repr() - - def __del__(self): - with self._state.condition: - if self._state.code is None: - self._state.code = grpc.StatusCode.CANCELLED - self._state.details = 'Cancelled upon garbage collection!' - self._state.cancelled = True - self._call.cancel( - _common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[self._state.code], - self._state.details) - self._state.condition.notify_all() - def _start_unary_request(request, timeout, request_serializer): deadline = _deadline(timeout) @@ -636,6 +722,54 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable): deadline) +class _SingleThreadedUnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable): + + # pylint: disable=too-many-arguments + def __init__(self, channel, method, request_serializer, + response_deserializer): + self._channel = channel + self._method = method + self._request_serializer = request_serializer + self._response_deserializer = response_deserializer + self._context = cygrpc.build_census_context() + + def __call__( # pylint: disable=too-many-locals + self, + request, + timeout=None, + metadata=None, + credentials=None, + wait_for_ready=None, + compression=None): + deadline = _deadline(timeout) + serialized_request = _common.serialize(request, + self._request_serializer) + if serialized_request is None: + state = _RPCState((), (), (), grpc.StatusCode.INTERNAL, + 'Exception serializing request!') + raise _Rendezvous(state, None, None, deadline) + + state = _RPCState(_UNARY_STREAM_INITIAL_DUE, None, None, None, None) + call_credentials = None if credentials is None else credentials._credentials + initial_metadata_flags = _InitialMetadataFlags().with_wait_for_ready( + wait_for_ready) + augmented_metadata = _compression.augment_metadata( + metadata, compression) + operations_and_tags = (( + (cygrpc.SendInitialMetadataOperation(augmented_metadata, + initial_metadata_flags), + cygrpc.SendMessageOperation(serialized_request, _EMPTY_FLAGS), + cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), + cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS)), None),) + ((( + cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), None),) + call = self._channel.segregated_call( + cygrpc.PropagationConstants.GRPC_PROPAGATE_DEFAULTS, self._method, + None, _determine_deadline(deadline), metadata, call_credentials, + operations_and_tags, self._context) + return _SingleThreadedRendezvous(state, call, + self._response_deserializer, deadline) + + class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable): # pylint: disable=too-many-arguments @@ -1042,6 +1176,18 @@ def _augment_options(base_options, compression): ),) +def _separate_channel_options(options): + """Separates core channel options from Python channel options.""" + core_options = [] + python_options = [] + for pair in options: + if pair[0] == grpc.experimental.ChannelOptions.SingleThreadedUnaryStream: + python_options.append(pair) + else: + core_options.append(pair) + return python_options, core_options + + class Channel(grpc.Channel): """A cygrpc.Channel-backed implementation of grpc.Channel.""" @@ -1055,13 +1201,22 @@ class Channel(grpc.Channel): compression: An optional value indicating the compression method to be used over the lifetime of the channel. """ + python_options, core_options = _separate_channel_options(options) + self._single_threaded_unary_stream = False + self._process_python_options(python_options) self._channel = cygrpc.Channel( - _common.encode(target), _augment_options(options, compression), + _common.encode(target), _augment_options(core_options, compression), credentials) self._call_state = _ChannelCallState(self._channel) self._connectivity_state = _ChannelConnectivityState(self._channel) cygrpc.fork_register_channel(self) + def _process_python_options(self, python_options): + """Sets channel attributes according to python-only channel options.""" + for pair in python_options: + if pair[0] == grpc.experimental.ChannelOptions.SingleThreadedUnaryStream: + self._single_threaded_unary_stream = True + def subscribe(self, callback, try_to_connect=None): _subscribe(self._connectivity_state, callback, try_to_connect) @@ -1080,9 +1235,21 @@ class Channel(grpc.Channel): method, request_serializer=None, response_deserializer=None): - return _UnaryStreamMultiCallable( - self._channel, _channel_managed_call_management(self._call_state), - _common.encode(method), request_serializer, response_deserializer) + # NOTE(rbellevi): Benchmarks have shown that running a unary-stream RPC + # on a single Python thread results in an appreciable speed-up. However, + # due to slight differences in capability, the multi-threaded variant' + # remains the default. + if self._single_threaded_unary_stream: + return _SingleThreadedUnaryStreamMultiCallable( + self._channel, _common.encode(method), request_serializer, + response_deserializer) + else: + return _UnaryStreamMultiCallable(self._channel, + _channel_managed_call_management( + self._call_state), + _common.encode(method), + request_serializer, + response_deserializer) def stream_unary(self, method, diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi index 70bc8dbed7e..c31ca14fc89 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi @@ -420,8 +420,6 @@ cdef _close(Channel channel, grpc_status_code code, object details, else: while state.integrated_call_states: state.condition.wait() - while state.segregated_call_states: - state.condition.wait() while state.connectivity_due: state.condition.wait() diff --git a/src/python/grpcio/grpc/experimental/__init__.py b/src/python/grpcio/grpc/experimental/__init__.py index dcec322b69b..06adeb0d2a2 100644 --- a/src/python/grpcio/grpc/experimental/__init__.py +++ b/src/python/grpcio/grpc/experimental/__init__.py @@ -15,3 +15,14 @@ These APIs are subject to be removed during any minor version release. """ + + +class ChannelOptions(object): + """Indicates a channel option unique to gRPC Python. + + This enumeration is part of an EXPERIMENTAL API. + + Attributes: + SingleThreadedUnaryStream: Perform unary-stream RPCs on a single thread. + """ + SingleThreadedUnaryStream = "SingleThreadedUnaryStream" diff --git a/src/python/grpcio_tests/tests/stress/BUILD.bazel b/src/python/grpcio_tests/tests/stress/BUILD.bazel new file mode 100644 index 00000000000..922805d6619 --- /dev/null +++ b/src/python/grpcio_tests/tests/stress/BUILD.bazel @@ -0,0 +1,30 @@ +load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") + +proto_library( + name = "unary_stream_benchmark_proto", + srcs = ["unary_stream_benchmark.proto"], + deps = [], +) + +py_proto_library( + name = "unary_stream_benchmark_py_pb2", + deps = [":unary_stream_benchmark_proto"], +) + +py_grpc_library( + name = "unary_stream_benchmark_py_pb2_grpc", + srcs = [":unary_stream_benchmark_proto"], + deps = [":unary_stream_benchmark_py_pb2"], +) + +py_binary( + name = "unary_stream_benchmark", + srcs_version = "PY3", + python_version = "PY3", + srcs = ["unary_stream_benchmark.py"], + deps = [ + "//src/python/grpcio/grpc:grpcio", + ":unary_stream_benchmark_py_pb2", + ":unary_stream_benchmark_py_pb2_grpc", + ] +) diff --git a/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.proto b/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.proto new file mode 100644 index 00000000000..e7cb04ea060 --- /dev/null +++ b/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.proto @@ -0,0 +1,27 @@ +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. +syntax = "proto3"; + +message BenchmarkRequest { + int32 message_size = 1; + int32 response_count = 2; +} + +message BenchmarkResponse { + bytes response = 1; +} + +service UnaryStreamBenchmarkService { + rpc Benchmark(BenchmarkRequest) returns (stream BenchmarkResponse); +} diff --git a/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py b/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py new file mode 100644 index 00000000000..882e336b110 --- /dev/null +++ b/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py @@ -0,0 +1,104 @@ +# Copyright 2019 The gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +import datetime +import threading +import grpc +import grpc.experimental +import subprocess +import sys +import time +import contextlib + +_PORT = 5741 +_MESSAGE_SIZE = 4 +_RESPONSE_COUNT = 32 * 1024 + +_SERVER_CODE = """ +import datetime +import threading +import grpc +from concurrent import futures +from src.python.grpcio_tests.tests.stress import unary_stream_benchmark_pb2 +from src.python.grpcio_tests.tests.stress import unary_stream_benchmark_pb2_grpc + +class Handler(unary_stream_benchmark_pb2_grpc.UnaryStreamBenchmarkServiceServicer): + + def Benchmark(self, request, context): + payload = b'\\x00\\x01' * int(request.message_size / 2) + for _ in range(request.response_count): + yield unary_stream_benchmark_pb2.BenchmarkResponse(response=payload) + + +server = grpc.server(futures.ThreadPoolExecutor(max_workers=1)) +server.add_insecure_port('[::]:%d') +unary_stream_benchmark_pb2_grpc.add_UnaryStreamBenchmarkServiceServicer_to_server(Handler(), server) +server.start() +server.wait_for_termination() +""" % _PORT + +try: + from src.python.grpcio_tests.tests.stress import unary_stream_benchmark_pb2 + from src.python.grpcio_tests.tests.stress import unary_stream_benchmark_pb2_grpc + + _GRPC_CHANNEL_OPTIONS = [ + ('grpc.max_metadata_size', 16 * 1024 * 1024), + ('grpc.max_receive_message_length', 64 * 1024 * 1024), + (grpc.experimental.ChannelOptions.SingleThreadedUnaryStream, 1), + ] + + @contextlib.contextmanager + def _running_server(): + server_process = subprocess.Popen( + [sys.executable, '-c', _SERVER_CODE], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + try: + yield + finally: + server_process.terminate() + server_process.wait() + sys.stdout.write("stdout: {}".format(server_process.stdout.read())) + sys.stdout.flush() + sys.stdout.write("stderr: {}".format(server_process.stderr.read())) + sys.stdout.flush() + + def profile(message_size, response_count): + request = unary_stream_benchmark_pb2.BenchmarkRequest( + message_size=message_size, response_count=response_count) + with grpc.insecure_channel( + '[::]:{}'.format(_PORT), + options=_GRPC_CHANNEL_OPTIONS) as channel: + stub = unary_stream_benchmark_pb2_grpc.UnaryStreamBenchmarkServiceStub( + channel) + start = datetime.datetime.now() + call = stub.Benchmark(request, wait_for_ready=True) + for message in call: + pass + end = datetime.datetime.now() + return end - start + + def main(): + with _running_server(): + for i in range(1000): + latency = profile(_MESSAGE_SIZE, 1024) + sys.stdout.write("{}\n".format(latency.total_seconds())) + sys.stdout.flush() + + if __name__ == '__main__': + main() + +except ImportError: + # NOTE(rbellevi): The test runner should not load this module. + pass diff --git a/src/python/grpcio_tests/tests/unit/BUILD.bazel b/src/python/grpcio_tests/tests/unit/BUILD.bazel index 587d8cb246f..5fb7c1f74d0 100644 --- a/src/python/grpcio_tests/tests/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/BUILD.bazel @@ -23,6 +23,7 @@ GRPCIO_TESTS_UNIT = [ "_invocation_defects_test.py", "_local_credentials_test.py", "_logging_test.py", + "_metadata_flags_test.py", "_metadata_code_details_test.py", "_metadata_test.py", # TODO: Issue 16336 diff --git a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py index a63664ac5d0..8831862f35a 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py @@ -255,8 +255,8 @@ class MetadataCodeDetailsTest(unittest.TestCase): response_iterator_call = self._unary_stream( _SERIALIZED_REQUEST, metadata=_CLIENT_METADATA) - received_initial_metadata = response_iterator_call.initial_metadata() list(response_iterator_call) + received_initial_metadata = response_iterator_call.initial_metadata() self.assertTrue( test_common.metadata_transmitted( @@ -349,11 +349,14 @@ class MetadataCodeDetailsTest(unittest.TestCase): response_iterator_call = self._unary_stream( _SERIALIZED_REQUEST, metadata=_CLIENT_METADATA) - received_initial_metadata = \ - response_iterator_call.initial_metadata() + # NOTE: In the single-threaded case, we cannot grab the initial_metadata + # without running the RPC first (or concurrently, in another + # thread). with self.assertRaises(grpc.RpcError): self.assertEqual(len(list(response_iterator_call)), 0) + received_initial_metadata = \ + response_iterator_call.initial_metadata() self.assertTrue( test_common.metadata_transmitted( _CLIENT_METADATA, @@ -454,9 +457,9 @@ class MetadataCodeDetailsTest(unittest.TestCase): response_iterator_call = self._unary_stream( _SERIALIZED_REQUEST, metadata=_CLIENT_METADATA) - received_initial_metadata = response_iterator_call.initial_metadata() with self.assertRaises(grpc.RpcError): list(response_iterator_call) + received_initial_metadata = response_iterator_call.initial_metadata() self.assertTrue( test_common.metadata_transmitted( @@ -547,9 +550,9 @@ class MetadataCodeDetailsTest(unittest.TestCase): response_iterator_call = self._unary_stream( _SERIALIZED_REQUEST, metadata=_CLIENT_METADATA) - received_initial_metadata = response_iterator_call.initial_metadata() with self.assertRaises(grpc.RpcError): list(response_iterator_call) + received_initial_metadata = response_iterator_call.initial_metadata() self.assertTrue( test_common.metadata_transmitted( diff --git a/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py b/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py index 7b32b5b5f3e..5cded71d9b5 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py @@ -94,10 +94,10 @@ class _GenericHandler(grpc.GenericRpcHandler): def get_free_loopback_tcp_port(): - tcp = socket.socket(socket.AF_INET6) + tcp = socket.socket(socket.AF_INET) tcp.bind(('', 0)) address_tuple = tcp.getsockname() - return tcp, "[::1]:%s" % (address_tuple[1]) + return tcp, "localhost:%s" % (address_tuple[1]) def create_dummy_channel(): @@ -183,7 +183,7 @@ class MetadataFlagsTest(unittest.TestCase): fn(channel, wait_for_ready) self.fail("The Call should fail") except BaseException as e: # pylint: disable=broad-except - self.assertIn('StatusCode.UNAVAILABLE', str(e)) + self.assertIs(grpc.StatusCode.UNAVAILABLE, e.code()) def test_call_wait_for_ready_default(self): for perform_call in _ALL_CALL_CASES: diff --git a/src/python/grpcio_tests/tests/unit/_metadata_test.py b/src/python/grpcio_tests/tests/unit/_metadata_test.py index 892df3df08f..954ffe9154d 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_test.py @@ -202,6 +202,9 @@ class MetadataTest(unittest.TestCase): def testUnaryStream(self): multi_callable = self._channel.unary_stream(_UNARY_STREAM) call = multi_callable(_REQUEST, metadata=_INVOCATION_METADATA) + # TODO(https://github.com/grpc/grpc/issues/20762): Make the call to + # `next()` unnecessary. + next(call) self.assertTrue( test_common.metadata_transmitted(_EXPECTED_INITIAL_METADATA, call.initial_metadata())) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 6c9eec351e2..0eece244b08 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -71,12 +71,17 @@ cmake_minimum_required(VERSION 3.5.1) - set(PACKAGE_NAME "grpc") - set(PACKAGE_VERSION "${settings.cpp_version}") - set(gRPC_CORE_VERSION "${settings.core_version}") - set(PACKAGE_STRING "<%text>${PACKAGE_NAME} ${PACKAGE_VERSION}") - set(PACKAGE_TARNAME "<%text>${PACKAGE_NAME}-${PACKAGE_VERSION}") - set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") + set(PACKAGE_NAME "grpc") + set(PACKAGE_VERSION "${settings.cpp_version}") + set(gRPC_CORE_VERSION "${settings.core_version}") + set(gRPC_CORE_SOVERSION "${settings.core_version.major}") + set(gRPC_CPP_VERSION "${settings.cpp_version}") + set(gRPC_CPP_SOVERSION "${settings.cpp_version.major}") + set(gRPC_CSHARP_VERSION "${settings.csharp_version}") + set(gRPC_CSHARP_SOVERSION "${settings.csharp_version.major}") + set(PACKAGE_STRING "<%text>${PACKAGE_NAME} ${PACKAGE_VERSION}") + set(PACKAGE_TARNAME "<%text>${PACKAGE_NAME}-${PACKAGE_VERSION}") + set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") project(<%text>${PACKAGE_NAME} LANGUAGES C CXX) set(gRPC_INSTALL_BINDIR "bin" CACHE STRING "Installation directory for executables") @@ -400,6 +405,19 @@ % endfor ) + set_target_properties(${lib.name} PROPERTIES + % if lib.language == 'c++': + VERSION <%text>${gRPC_CPP_VERSION} + SOVERSION <%text>${gRPC_CPP_SOVERSION} + % elif lib.language == 'csharp': + VERSION <%text>${gRPC_CSHARP_VERSION} + SOVERSION <%text>${gRPC_CSHARP_SOVERSION} + % else: + VERSION <%text>${gRPC_CORE_VERSION} + SOVERSION <%text>${gRPC_CORE_SOVERSION} + % endif + ) + if(WIN32 AND MSVC) set_target_properties(${lib.name} PROPERTIES COMPILE_PDB_NAME "${lib.name}" COMPILE_PDB_OUTPUT_DIRECTORY <%text>"${CMAKE_BINARY_DIR}" diff --git a/templates/src/objective-c/BoringSSL-GRPC.podspec.template b/templates/src/objective-c/BoringSSL-GRPC.podspec.template index 5f1de90ce8e..8bdd255d2a0 100644 --- a/templates/src/objective-c/BoringSSL-GRPC.podspec.template +++ b/templates/src/objective-c/BoringSSL-GRPC.podspec.template @@ -9,7 +9,9 @@ # Please make modifications to # `templates/src/objective-c/BoringSSL-GRPC.podspec.template` instead. This # file can be regenerated from the template by running - # `tools/buildgen/generate_projects.sh`. + # `tools/buildgen/generate_projects.sh`. Because of some limitations of this + # template, you might actually need to run the same script twice in a row. + # (see err_data.c section) # BoringSSL CocoaPods podspec @@ -204,1410 +206,18 @@ } EOF - # This is a bit ridiculous, but requiring people to install Go in order to build is slightly - # more ridiculous IMO. - # TODO(jcanizales): Translate err_data_generate.go into a Bash or Ruby script. + # To build boringssl, we need the generated file err_data.c, which is normally generated + # by boringssl's err_data_generate.go, but we already have a copy of err_data.c checked into the + # grpc/grpc repository that gets regenerated whenever we update the third_party/boringssl submodule. + # To make the podspec independent of the grpc repository, the .podspec.template just copies + # the contents of err_data.c directly into the .podspec. + # TODO(jtattermusch): avoid needing to run tools/buildgen/generate_projects.sh twice on update + # TODO(jtattermusch): another pre-generated copy of err_data.c is under third_party/boringssl-with-bazel + # investigate if we could use it. cat > err_data.c < - #include - #include - - - OPENSSL_STATIC_ASSERT(ERR_LIB_NONE == 1, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_SYS == 2, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_BN == 3, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_RSA == 4, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_DH == 5, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_EVP == 6, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_BUF == 7, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_OBJ == 8, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_PEM == 9, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_DSA == 10, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_X509 == 11, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_ASN1 == 12, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_CONF == 13, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_CRYPTO == 14, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_EC == 15, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_SSL == 16, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_BIO == 17, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS7 == 18, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS8 == 19, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_X509V3 == 20, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_RAND == 21, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_ENGINE == 22, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_OCSP == 23, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_UI == 24, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_COMP == 25, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_ECDSA == 26, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_ECDH == 27, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_HMAC == 28, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_DIGEST == 29, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_CIPHER == 30, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_HKDF == 31, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_LIB_USER == 32, "library value changed"); - OPENSSL_STATIC_ASSERT(ERR_NUM_LIBS == 33, "number of libraries changed"); - - const uint32_t kOpenSSLReasonValues[] = { - 0xc32083a, - 0xc328854, - 0xc330863, - 0xc338873, - 0xc340882, - 0xc34889b, - 0xc3508a7, - 0xc3588c4, - 0xc3608e4, - 0xc3688f2, - 0xc370902, - 0xc37890f, - 0xc38091f, - 0xc38892a, - 0xc390940, - 0xc39894f, - 0xc3a0963, - 0xc3a8847, - 0xc3b00ea, - 0xc3b88d6, - 0x10320847, - 0x10329574, - 0x10331580, - 0x10339599, - 0x103415ac, - 0x10348f27, - 0x10350c60, - 0x103595bf, - 0x103615e9, - 0x103695fc, - 0x1037161b, - 0x10379634, - 0x10381649, - 0x10389667, - 0x10391676, - 0x10399692, - 0x103a16ad, - 0x103a96bc, - 0x103b16d8, - 0x103b96f3, - 0x103c1719, - 0x103c80ea, - 0x103d172a, - 0x103d973e, - 0x103e175d, - 0x103e976c, - 0x103f1783, - 0x103f9796, - 0x10400c24, - 0x104097a9, - 0x104117c7, - 0x104197da, - 0x104217f4, - 0x10429804, - 0x10431818, - 0x1043982e, - 0x10441846, - 0x1044985b, - 0x1045186f, - 0x10459881, - 0x104605fd, - 0x1046894f, - 0x10471896, - 0x104798ad, - 0x104818c2, - 0x104898d0, - 0x10490e73, - 0x1049970a, - 0x104a15d4, - 0x14320c07, - 0x14328c15, - 0x14330c24, - 0x14338c36, - 0x143400ac, - 0x143480ea, - 0x18320083, - 0x18328f7d, - 0x183300ac, - 0x18338f93, - 0x18340fa7, - 0x183480ea, - 0x18350fbc, - 0x18358fd4, - 0x18360fe9, - 0x18368ffd, - 0x18371021, - 0x18379037, - 0x1838104b, - 0x1838905b, - 0x18390a75, - 0x1839906b, - 0x183a1080, - 0x183a90a6, - 0x183b0c7f, - 0x183b90db, - 0x183c10ed, - 0x183c90f8, - 0x183d1108, - 0x183d9119, - 0x183e112a, - 0x183e913c, - 0x183f1165, - 0x183f917e, - 0x18401196, - 0x184086d5, - 0x184110c9, - 0x18419094, - 0x184210b3, - 0x18428c6c, - 0x203211d0, - 0x203291bd, - 0x243211dc, - 0x24328995, - 0x243311ee, - 0x243391fb, - 0x24341208, - 0x2434921a, - 0x24351229, - 0x24359246, - 0x24361253, - 0x24369261, - 0x2437126f, - 0x2437927d, - 0x24381286, - 0x24389293, - 0x243912a6, - 0x28320c54, - 0x28328c7f, - 0x28330c24, - 0x28338c92, - 0x28340c60, - 0x283480ac, - 0x283500ea, - 0x28358c6c, - 0x2c322ec7, - 0x2c3292bd, - 0x2c332ed5, - 0x2c33aee7, - 0x2c342efb, - 0x2c34af0d, - 0x2c352f28, - 0x2c35af3a, - 0x2c362f4d, - 0x2c36832d, - 0x2c372f5a, - 0x2c37af6c, - 0x2c382f91, - 0x2c38afa8, - 0x2c392fb6, - 0x2c39afc6, - 0x2c3a2fd8, - 0x2c3aafec, - 0x2c3b2ffd, - 0x2c3bb01c, - 0x2c3c12cf, - 0x2c3c92e5, - 0x2c3d3030, - 0x2c3d92fe, - 0x2c3e304d, - 0x2c3eb05b, - 0x2c3f3073, - 0x2c3fb08b, - 0x2c4030b5, - 0x2c4091d0, - 0x2c4130c6, - 0x2c41b0d9, - 0x2c421196, - 0x2c42b0ea, - 0x2c430722, - 0x2c43b00e, - 0x2c442f7f, - 0x2c44b098, - 0x30320000, - 0x30328015, - 0x3033001f, - 0x30338038, - 0x3034004a, - 0x30348064, - 0x3035006b, - 0x30358083, - 0x30360094, - 0x303680ac, - 0x303700b9, - 0x303780c8, - 0x303800ea, - 0x303880f7, - 0x3039010a, - 0x30398125, - 0x303a013a, - 0x303a814e, - 0x303b0162, - 0x303b8173, - 0x303c018c, - 0x303c81a9, - 0x303d01b7, - 0x303d81cb, - 0x303e01db, - 0x303e81f4, - 0x303f0204, - 0x303f8217, - 0x30400226, - 0x30408232, - 0x30410247, - 0x30418257, - 0x3042026e, - 0x3042827b, - 0x3043028e, - 0x3043829d, - 0x304402b2, - 0x304482d3, - 0x304502e6, - 0x304582f9, - 0x30460312, - 0x3046832d, - 0x3047034a, - 0x3047835c, - 0x3048036a, - 0x3048837b, - 0x3049038a, - 0x304983a2, - 0x304a03b4, - 0x304a83c8, - 0x304b03e0, - 0x304b83f3, - 0x304c03fe, - 0x304c840f, - 0x304d041b, - 0x304d8431, - 0x304e043f, - 0x304e8455, - 0x304f0467, - 0x304f8479, - 0x3050049c, - 0x305084af, - 0x305104c0, - 0x305184d0, - 0x305204e8, - 0x305284fd, - 0x30530515, - 0x30538529, - 0x30540541, - 0x3054855a, - 0x30550573, - 0x30558590, - 0x3056059b, - 0x305685b3, - 0x305705c3, - 0x305785d4, - 0x305805e7, - 0x305885fd, - 0x30590606, - 0x3059861b, - 0x305a062e, - 0x305a863d, - 0x305b065d, - 0x305b866c, - 0x305c068d, - 0x305c86a9, - 0x305d06b5, - 0x305d86d5, - 0x305e06f1, - 0x305e8702, - 0x305f0718, - 0x305f8722, - 0x3060048c, - 0x34320b65, - 0x34328b79, - 0x34330b96, - 0x34338ba9, - 0x34340bb8, - 0x34348bf1, - 0x34350bd5, - 0x3c320083, - 0x3c328cbc, - 0x3c330cd5, - 0x3c338cf0, - 0x3c340d0d, - 0x3c348d37, - 0x3c350d52, - 0x3c358d78, - 0x3c360d91, - 0x3c368da9, - 0x3c370dba, - 0x3c378dc8, - 0x3c380dd5, - 0x3c388de9, - 0x3c390c7f, - 0x3c398e0c, - 0x3c3a0e20, - 0x3c3a890f, - 0x3c3b0e30, - 0x3c3b8e4b, - 0x3c3c0e5d, - 0x3c3c8e90, - 0x3c3d0e9a, - 0x3c3d8eae, - 0x3c3e0ebc, - 0x3c3e8ee1, - 0x3c3f0ca8, - 0x3c3f8eca, - 0x3c4000ac, - 0x3c4080ea, - 0x3c410d28, - 0x3c418d67, - 0x3c420e73, - 0x3c428dfd, - 0x40321946, - 0x4032995c, - 0x4033198a, - 0x40339994, - 0x403419ab, - 0x403499c9, - 0x403519d9, - 0x403599eb, - 0x403619f8, - 0x40369a04, - 0x40371a19, - 0x40379a2b, - 0x40381a36, - 0x40389a48, - 0x40390f27, - 0x40399a58, - 0x403a1a6b, - 0x403a9a8c, - 0x403b1a9d, - 0x403b9aad, - 0x403c0064, - 0x403c8083, - 0x403d1b31, - 0x403d9b47, - 0x403e1b56, - 0x403e9b8e, - 0x403f1ba8, - 0x403f9bd0, - 0x40401be5, - 0x40409bf9, - 0x40411c16, - 0x40419c31, - 0x40421c4a, - 0x40429c5d, - 0x40431c71, - 0x40439c89, - 0x40441ca0, - 0x404480ac, - 0x40451cb5, - 0x40459cc7, - 0x40461ceb, - 0x40469d0b, - 0x40471d19, - 0x40479d40, - 0x40481db1, - 0x40489de4, - 0x40491dfb, - 0x40499e15, - 0x404a1e2c, - 0x404a9e4a, - 0x404b1e62, - 0x404b9e79, - 0x404c1e8f, - 0x404c9ea1, - 0x404d1ec2, - 0x404d9efb, - 0x404e1f0f, - 0x404e9f1c, - 0x404f1f49, - 0x404f9f8f, - 0x40501fe6, - 0x40509ffa, - 0x4051202d, - 0x4052203d, - 0x4052a061, - 0x40532079, - 0x4053a08c, - 0x405420a1, - 0x4054a0c4, - 0x405520d2, - 0x4055a10f, - 0x4056211c, - 0x4056a135, - 0x4057214d, - 0x4057a160, - 0x40582175, - 0x4058a19c, - 0x405921cb, - 0x4059a1f8, - 0x405a220c, - 0x405aa21c, - 0x405b2234, - 0x405ba245, - 0x405c2258, - 0x405ca297, - 0x405d22a4, - 0x405da2c9, - 0x405e2307, - 0x405e8ab3, - 0x405f2328, - 0x405fa335, - 0x40602343, - 0x4060a365, - 0x406123c6, - 0x4061a3fe, - 0x40622415, - 0x4062a426, - 0x4063244b, - 0x4063a460, - 0x40642477, - 0x4064a4a3, - 0x406524be, - 0x4065a4d5, - 0x406624ed, - 0x4066a517, - 0x40672542, - 0x4067a587, - 0x406825cf, - 0x4068a5f0, - 0x40692622, - 0x4069a650, - 0x406a2671, - 0x406aa691, - 0x406b2819, - 0x406ba83c, - 0x406c2852, - 0x406caaf5, - 0x406d2b24, - 0x406dab4c, - 0x406e2b7a, - 0x406eabc7, - 0x406f2c02, - 0x406fac3a, - 0x40702c4d, - 0x4070ac6a, - 0x40710802, - 0x4071ac7c, - 0x40722c8f, - 0x4072acc5, - 0x40732cdd, - 0x407394cf, - 0x40742cf1, - 0x4074ad0b, - 0x40752d1c, - 0x4075ad30, - 0x40762d3e, - 0x40769293, - 0x40772d63, - 0x4077ad85, - 0x40782da0, - 0x4078add9, - 0x40792df0, - 0x4079ae06, - 0x407a2e32, - 0x407aae45, - 0x407b2e5a, - 0x407bae6c, - 0x407c2e9d, - 0x407caea6, - 0x407d260b, - 0x407d9f9f, - 0x407e2db5, - 0x407ea1ac, - 0x407f1d2d, - 0x407f9ad3, - 0x40801f59, - 0x40809d55, - 0x4081204f, - 0x40819f33, - 0x40822b65, - 0x40829ab9, - 0x40832187, - 0x4083a488, - 0x40841d69, - 0x4084a1e4, - 0x40852269, - 0x4085a38d, - 0x408622e9, - 0x40869fb9, - 0x40872bab, - 0x4087a3db, - 0x40881b1a, - 0x4088a59a, - 0x40891b69, - 0x40899af6, - 0x408a288a, - 0x408a98e7, - 0x408b2e81, - 0x408bac17, - 0x408c2279, - 0x408c9903, - 0x408d1dca, - 0x408d9d9b, - 0x408e1ee4, - 0x408ea0ef, - 0x408f25ae, - 0x408fa3a9, - 0x40902563, - 0x4090a2bb, - 0x40912872, - 0x40919929, - 0x40921bb6, - 0x4092abe6, - 0x40932ca8, - 0x40939fca, - 0x40941d7d, - 0x4094a8a3, - 0x40952437, - 0x4095ae12, - 0x40962b92, - 0x40969f72, - 0x40972015, - 0x41f42744, - 0x41f927d6, - 0x41fe26c9, - 0x41fea8e6, - 0x41ff29d7, - 0x4203275d, - 0x4208277f, - 0x4208a7bb, - 0x420926ad, - 0x4209a7f5, - 0x420a2704, - 0x420aa6e4, - 0x420b2724, - 0x420ba79d, - 0x420c29f3, - 0x420ca8b3, - 0x420d28cd, - 0x420da904, - 0x4212291e, - 0x421729ba, - 0x4217a960, - 0x421c2982, - 0x421f293d, - 0x42212a0a, - 0x4226299d, - 0x422b2ad9, - 0x422baa87, - 0x422c2ac1, - 0x422caa46, - 0x422d2a25, - 0x422daaa6, - 0x422e2a6c, - 0x4432072d, - 0x4432873c, - 0x44330748, - 0x44338756, - 0x44340769, - 0x4434877a, - 0x44350781, - 0x4435878b, - 0x4436079e, - 0x443687b4, - 0x443707c6, - 0x443787d3, - 0x443807e2, - 0x443887ea, - 0x44390802, - 0x44398810, - 0x443a0823, - 0x483212bd, - 0x483292cf, - 0x483312e5, - 0x483392fe, - 0x4c321323, - 0x4c329333, - 0x4c331346, - 0x4c339366, - 0x4c3400ac, - 0x4c3480ea, - 0x4c351372, - 0x4c359380, - 0x4c36139c, - 0x4c3693c2, - 0x4c3713d1, - 0x4c3793df, - 0x4c3813f4, - 0x4c389400, - 0x4c391420, - 0x4c39944a, - 0x4c3a1463, - 0x4c3a947c, - 0x4c3b05fd, - 0x4c3b9495, - 0x4c3c14a7, - 0x4c3c94b6, - 0x4c3d14cf, - 0x4c3d8c47, - 0x4c3e153c, - 0x4c3e94de, - 0x4c3f155e, - 0x4c3f9293, - 0x4c4014f4, - 0x4c40930f, - 0x4c41152c, - 0x4c4193af, - 0x4c421518, - 0x503230fc, - 0x5032b10b, - 0x50333116, - 0x5033b126, - 0x5034313f, - 0x5034b159, - 0x50353167, - 0x5035b17d, - 0x5036318f, - 0x5036b1a5, - 0x503731be, - 0x5037b1d1, - 0x503831e9, - 0x5038b1fa, - 0x5039320f, - 0x5039b223, - 0x503a3243, - 0x503ab259, - 0x503b3271, - 0x503bb283, - 0x503c329f, - 0x503cb2b6, - 0x503d32cf, - 0x503db2e5, - 0x503e32f2, - 0x503eb308, - 0x503f331a, - 0x503f837b, - 0x5040332d, - 0x5040b33d, - 0x50413357, - 0x5041b366, - 0x50423380, - 0x5042b39d, - 0x504333ad, - 0x5043b3bd, - 0x504433cc, - 0x50448431, - 0x504533e0, - 0x5045b3fe, - 0x50463411, - 0x5046b427, - 0x50473439, - 0x5047b44e, - 0x50483474, - 0x5048b482, - 0x50493495, - 0x5049b4aa, - 0x504a34c0, - 0x504ab4d0, - 0x504b34f0, - 0x504bb503, - 0x504c3526, - 0x504cb554, - 0x504d3566, - 0x504db583, - 0x504e359e, - 0x504eb5ba, - 0x504f35cc, - 0x504fb5e3, - 0x505035f2, - 0x505086f1, - 0x50513605, - 0x58320f65, - 0x68320f27, - 0x68328c7f, - 0x68330c92, - 0x68338f35, - 0x68340f45, - 0x683480ea, - 0x6c320eed, - 0x6c328c36, - 0x6c330ef8, - 0x6c338f11, - 0x74320a1b, - 0x743280ac, - 0x74330c47, - 0x78320980, - 0x78328995, - 0x783309a1, - 0x78338083, - 0x783409b0, - 0x783489c5, - 0x783509e4, - 0x78358a06, - 0x78360a1b, - 0x78368a31, - 0x78370a41, - 0x78378a62, - 0x78380a75, - 0x78388a87, - 0x78390a94, - 0x78398ab3, - 0x783a0ac8, - 0x783a8ad6, - 0x783b0ae0, - 0x783b8af4, - 0x783c0b0b, - 0x783c8b20, - 0x783d0b37, - 0x783d8b4c, - 0x783e0aa2, - 0x783e8a54, - 0x7c3211ac, - }; - - const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]); - - const char kOpenSSLReasonStringData[] = - "ASN1_LENGTH_MISMATCH\\0" - "AUX_ERROR\\0" - "BAD_GET_ASN1_OBJECT_CALL\\0" - "BAD_OBJECT_HEADER\\0" - "BMPSTRING_IS_WRONG_LENGTH\\0" - "BN_LIB\\0" - "BOOLEAN_IS_WRONG_LENGTH\\0" - "BUFFER_TOO_SMALL\\0" - "CONTEXT_NOT_INITIALISED\\0" - "DECODE_ERROR\\0" - "DEPTH_EXCEEDED\\0" - "DIGEST_AND_KEY_TYPE_NOT_SUPPORTED\\0" - "ENCODE_ERROR\\0" - "ERROR_GETTING_TIME\\0" - "EXPECTING_AN_ASN1_SEQUENCE\\0" - "EXPECTING_AN_INTEGER\\0" - "EXPECTING_AN_OBJECT\\0" - "EXPECTING_A_BOOLEAN\\0" - "EXPECTING_A_TIME\\0" - "EXPLICIT_LENGTH_MISMATCH\\0" - "EXPLICIT_TAG_NOT_CONSTRUCTED\\0" - "FIELD_MISSING\\0" - "FIRST_NUM_TOO_LARGE\\0" - "HEADER_TOO_LONG\\0" - "ILLEGAL_BITSTRING_FORMAT\\0" - "ILLEGAL_BOOLEAN\\0" - "ILLEGAL_CHARACTERS\\0" - "ILLEGAL_FORMAT\\0" - "ILLEGAL_HEX\\0" - "ILLEGAL_IMPLICIT_TAG\\0" - "ILLEGAL_INTEGER\\0" - "ILLEGAL_NESTED_TAGGING\\0" - "ILLEGAL_NULL\\0" - "ILLEGAL_NULL_VALUE\\0" - "ILLEGAL_OBJECT\\0" - "ILLEGAL_OPTIONAL_ANY\\0" - "ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE\\0" - "ILLEGAL_TAGGED_ANY\\0" - "ILLEGAL_TIME_VALUE\\0" - "INTEGER_NOT_ASCII_FORMAT\\0" - "INTEGER_TOO_LARGE_FOR_LONG\\0" - "INVALID_BIT_STRING_BITS_LEFT\\0" - "INVALID_BMPSTRING\\0" - "INVALID_DIGIT\\0" - "INVALID_MODIFIER\\0" - "INVALID_NUMBER\\0" - "INVALID_OBJECT_ENCODING\\0" - "INVALID_SEPARATOR\\0" - "INVALID_TIME_FORMAT\\0" - "INVALID_UNIVERSALSTRING\\0" - "INVALID_UTF8STRING\\0" - "LIST_ERROR\\0" - "MISSING_ASN1_EOS\\0" - "MISSING_EOC\\0" - "MISSING_SECOND_NUMBER\\0" - "MISSING_VALUE\\0" - "MSTRING_NOT_UNIVERSAL\\0" - "MSTRING_WRONG_TAG\\0" - "NESTED_ASN1_ERROR\\0" - "NESTED_ASN1_STRING\\0" - "NESTED_TOO_DEEP\\0" - "NON_HEX_CHARACTERS\\0" - "NOT_ASCII_FORMAT\\0" - "NOT_ENOUGH_DATA\\0" - "NO_MATCHING_CHOICE_TYPE\\0" - "NULL_IS_WRONG_LENGTH\\0" - "OBJECT_NOT_ASCII_FORMAT\\0" - "ODD_NUMBER_OF_CHARS\\0" - "SECOND_NUMBER_TOO_LARGE\\0" - "SEQUENCE_LENGTH_MISMATCH\\0" - "SEQUENCE_NOT_CONSTRUCTED\\0" - "SEQUENCE_OR_SET_NEEDS_CONFIG\\0" - "SHORT_LINE\\0" - "STREAMING_NOT_SUPPORTED\\0" - "STRING_TOO_LONG\\0" - "STRING_TOO_SHORT\\0" - "TAG_VALUE_TOO_HIGH\\0" - "TIME_NOT_ASCII_FORMAT\\0" - "TOO_LONG\\0" - "TYPE_NOT_CONSTRUCTED\\0" - "TYPE_NOT_PRIMITIVE\\0" - "UNEXPECTED_EOC\\0" - "UNIVERSALSTRING_IS_WRONG_LENGTH\\0" - "UNKNOWN_FORMAT\\0" - "UNKNOWN_MESSAGE_DIGEST_ALGORITHM\\0" - "UNKNOWN_SIGNATURE_ALGORITHM\\0" - "UNKNOWN_TAG\\0" - "UNSUPPORTED_ANY_DEFINED_BY_TYPE\\0" - "UNSUPPORTED_PUBLIC_KEY_TYPE\\0" - "UNSUPPORTED_TYPE\\0" - "WRONG_PUBLIC_KEY_TYPE\\0" - "WRONG_TAG\\0" - "WRONG_TYPE\\0" - "BAD_FOPEN_MODE\\0" - "BROKEN_PIPE\\0" - "CONNECT_ERROR\\0" - "ERROR_SETTING_NBIO\\0" - "INVALID_ARGUMENT\\0" - "IN_USE\\0" - "KEEPALIVE\\0" - "NBIO_CONNECT_ERROR\\0" - "NO_HOSTNAME_SPECIFIED\\0" - "NO_PORT_SPECIFIED\\0" - "NO_SUCH_FILE\\0" - "NULL_PARAMETER\\0" - "SYS_LIB\\0" - "UNABLE_TO_CREATE_SOCKET\\0" - "UNINITIALIZED\\0" - "UNSUPPORTED_METHOD\\0" - "WRITE_TO_READ_ONLY_BIO\\0" - "ARG2_LT_ARG3\\0" - "BAD_ENCODING\\0" - "BAD_RECIPROCAL\\0" - "BIGNUM_TOO_LONG\\0" - "BITS_TOO_SMALL\\0" - "CALLED_WITH_EVEN_MODULUS\\0" - "DIV_BY_ZERO\\0" - "EXPAND_ON_STATIC_BIGNUM_DATA\\0" - "INPUT_NOT_REDUCED\\0" - "INVALID_INPUT\\0" - "INVALID_RANGE\\0" - "NEGATIVE_NUMBER\\0" - "NOT_A_SQUARE\\0" - "NOT_INITIALIZED\\0" - "NO_INVERSE\\0" - "PRIVATE_KEY_TOO_LARGE\\0" - "P_IS_NOT_PRIME\\0" - "TOO_MANY_ITERATIONS\\0" - "TOO_MANY_TEMPORARY_VARIABLES\\0" - "AES_KEY_SETUP_FAILED\\0" - "BAD_DECRYPT\\0" - "BAD_KEY_LENGTH\\0" - "CTRL_NOT_IMPLEMENTED\\0" - "CTRL_OPERATION_NOT_IMPLEMENTED\\0" - "DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH\\0" - "INITIALIZATION_ERROR\\0" - "INPUT_NOT_INITIALIZED\\0" - "INVALID_AD_SIZE\\0" - "INVALID_KEY_LENGTH\\0" - "INVALID_NONCE\\0" - "INVALID_NONCE_SIZE\\0" - "INVALID_OPERATION\\0" - "IV_TOO_LARGE\\0" - "NO_CIPHER_SET\\0" - "NO_DIRECTION_SET\\0" - "OUTPUT_ALIASES_INPUT\\0" - "TAG_TOO_LARGE\\0" - "TOO_LARGE\\0" - "UNSUPPORTED_AD_SIZE\\0" - "UNSUPPORTED_INPUT_SIZE\\0" - "UNSUPPORTED_KEY_SIZE\\0" - "UNSUPPORTED_NONCE_SIZE\\0" - "UNSUPPORTED_TAG_SIZE\\0" - "WRONG_FINAL_BLOCK_LENGTH\\0" - "LIST_CANNOT_BE_NULL\\0" - "MISSING_CLOSE_SQUARE_BRACKET\\0" - "MISSING_EQUAL_SIGN\\0" - "NO_CLOSE_BRACE\\0" - "UNABLE_TO_CREATE_NEW_SECTION\\0" - "VARIABLE_EXPANSION_TOO_LONG\\0" - "VARIABLE_HAS_NO_VALUE\\0" - "BAD_GENERATOR\\0" - "INVALID_PUBKEY\\0" - "MODULUS_TOO_LARGE\\0" - "NO_PRIVATE_VALUE\\0" - "UNKNOWN_HASH\\0" - "BAD_Q_VALUE\\0" - "BAD_VERSION\\0" - "INVALID_PARAMETERS\\0" - "MISSING_PARAMETERS\\0" - "NEED_NEW_SETUP_VALUES\\0" - "BIGNUM_OUT_OF_RANGE\\0" - "COORDINATES_OUT_OF_RANGE\\0" - "D2I_ECPKPARAMETERS_FAILURE\\0" - "EC_GROUP_NEW_BY_NAME_FAILURE\\0" - "GROUP2PKPARAMETERS_FAILURE\\0" - "GROUP_MISMATCH\\0" - "I2D_ECPKPARAMETERS_FAILURE\\0" - "INCOMPATIBLE_OBJECTS\\0" - "INVALID_COFACTOR\\0" - "INVALID_COMPRESSED_POINT\\0" - "INVALID_COMPRESSION_BIT\\0" - "INVALID_ENCODING\\0" - "INVALID_FIELD\\0" - "INVALID_FORM\\0" - "INVALID_GROUP_ORDER\\0" - "INVALID_PRIVATE_KEY\\0" - "INVALID_SCALAR\\0" - "MISSING_PRIVATE_KEY\\0" - "NON_NAMED_CURVE\\0" - "PKPARAMETERS2GROUP_FAILURE\\0" - "POINT_AT_INFINITY\\0" - "POINT_IS_NOT_ON_CURVE\\0" - "PUBLIC_KEY_VALIDATION_FAILED\\0" - "SLOT_FULL\\0" - "UNDEFINED_GENERATOR\\0" - "UNKNOWN_GROUP\\0" - "UNKNOWN_ORDER\\0" - "WRONG_CURVE_PARAMETERS\\0" - "WRONG_ORDER\\0" - "KDF_FAILED\\0" - "POINT_ARITHMETIC_FAILURE\\0" - "UNKNOWN_DIGEST_LENGTH\\0" - "BAD_SIGNATURE\\0" - "NOT_IMPLEMENTED\\0" - "RANDOM_NUMBER_GENERATION_FAILED\\0" - "OPERATION_NOT_SUPPORTED\\0" - "COMMAND_NOT_SUPPORTED\\0" - "DIFFERENT_KEY_TYPES\\0" - "DIFFERENT_PARAMETERS\\0" - "EXPECTING_AN_EC_KEY_KEY\\0" - "EXPECTING_AN_RSA_KEY\\0" - "EXPECTING_A_DSA_KEY\\0" - "ILLEGAL_OR_UNSUPPORTED_PADDING_MODE\\0" - "INVALID_DIGEST_LENGTH\\0" - "INVALID_DIGEST_TYPE\\0" - "INVALID_KEYBITS\\0" - "INVALID_MGF1_MD\\0" - "INVALID_PADDING_MODE\\0" - "INVALID_PSS_SALTLEN\\0" - "INVALID_SIGNATURE\\0" - "KEYS_NOT_SET\\0" - "MEMORY_LIMIT_EXCEEDED\\0" - "NOT_A_PRIVATE_KEY\\0" - "NO_DEFAULT_DIGEST\\0" - "NO_KEY_SET\\0" - "NO_MDC2_SUPPORT\\0" - "NO_NID_FOR_CURVE\\0" - "NO_OPERATION_SET\\0" - "NO_PARAMETERS_SET\\0" - "OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE\\0" - "OPERATON_NOT_INITIALIZED\\0" - "UNKNOWN_PUBLIC_KEY_TYPE\\0" - "UNSUPPORTED_ALGORITHM\\0" - "OUTPUT_TOO_LARGE\\0" - "INVALID_OID_STRING\\0" - "UNKNOWN_NID\\0" - "BAD_BASE64_DECODE\\0" - "BAD_END_LINE\\0" - "BAD_IV_CHARS\\0" - "BAD_PASSWORD_READ\\0" - "CIPHER_IS_NULL\\0" - "ERROR_CONVERTING_PRIVATE_KEY\\0" - "NOT_DEK_INFO\\0" - "NOT_ENCRYPTED\\0" - "NOT_PROC_TYPE\\0" - "NO_START_LINE\\0" - "READ_KEY\\0" - "SHORT_HEADER\\0" - "UNSUPPORTED_CIPHER\\0" - "UNSUPPORTED_ENCRYPTION\\0" - "BAD_PKCS7_VERSION\\0" - "NOT_PKCS7_SIGNED_DATA\\0" - "NO_CERTIFICATES_INCLUDED\\0" - "NO_CRLS_INCLUDED\\0" - "BAD_ITERATION_COUNT\\0" - "BAD_PKCS12_DATA\\0" - "BAD_PKCS12_VERSION\\0" - "CIPHER_HAS_NO_OBJECT_IDENTIFIER\\0" - "CRYPT_ERROR\\0" - "ENCRYPT_ERROR\\0" - "ERROR_SETTING_CIPHER_PARAMS\\0" - "INCORRECT_PASSWORD\\0" - "INVALID_CHARACTERS\\0" - "KEYGEN_FAILURE\\0" - "KEY_GEN_ERROR\\0" - "METHOD_NOT_SUPPORTED\\0" - "MISSING_MAC\\0" - "MULTIPLE_PRIVATE_KEYS_IN_PKCS12\\0" - "PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED\\0" - "PKCS12_TOO_DEEPLY_NESTED\\0" - "PRIVATE_KEY_DECODE_ERROR\\0" - "PRIVATE_KEY_ENCODE_ERROR\\0" - "UNKNOWN_ALGORITHM\\0" - "UNKNOWN_CIPHER\\0" - "UNKNOWN_CIPHER_ALGORITHM\\0" - "UNKNOWN_DIGEST\\0" - "UNSUPPORTED_KEYLENGTH\\0" - "UNSUPPORTED_KEY_DERIVATION_FUNCTION\\0" - "UNSUPPORTED_OPTIONS\\0" - "UNSUPPORTED_PRF\\0" - "UNSUPPORTED_PRIVATE_KEY_ALGORITHM\\0" - "UNSUPPORTED_SALT_TYPE\\0" - "BAD_E_VALUE\\0" - "BAD_FIXED_HEADER_DECRYPT\\0" - "BAD_PAD_BYTE_COUNT\\0" - "BAD_RSA_PARAMETERS\\0" - "BLOCK_TYPE_IS_NOT_01\\0" - "BLOCK_TYPE_IS_NOT_02\\0" - "BN_NOT_INITIALIZED\\0" - "CANNOT_RECOVER_MULTI_PRIME_KEY\\0" - "CRT_PARAMS_ALREADY_GIVEN\\0" - "CRT_VALUES_INCORRECT\\0" - "DATA_LEN_NOT_EQUAL_TO_MOD_LEN\\0" - "DATA_TOO_LARGE\\0" - "DATA_TOO_LARGE_FOR_KEY_SIZE\\0" - "DATA_TOO_LARGE_FOR_MODULUS\\0" - "DATA_TOO_SMALL\\0" - "DATA_TOO_SMALL_FOR_KEY_SIZE\\0" - "DIGEST_TOO_BIG_FOR_RSA_KEY\\0" - "D_E_NOT_CONGRUENT_TO_1\\0" - "D_OUT_OF_RANGE\\0" - "EMPTY_PUBLIC_KEY\\0" - "FIRST_OCTET_INVALID\\0" - "INCONSISTENT_SET_OF_CRT_VALUES\\0" - "INTERNAL_ERROR\\0" - "INVALID_MESSAGE_LENGTH\\0" - "KEY_SIZE_TOO_SMALL\\0" - "LAST_OCTET_INVALID\\0" - "MUST_HAVE_AT_LEAST_TWO_PRIMES\\0" - "NO_PUBLIC_EXPONENT\\0" - "NULL_BEFORE_BLOCK_MISSING\\0" - "N_NOT_EQUAL_P_Q\\0" - "OAEP_DECODING_ERROR\\0" - "ONLY_ONE_OF_P_Q_GIVEN\\0" - "OUTPUT_BUFFER_TOO_SMALL\\0" - "PADDING_CHECK_FAILED\\0" - "PKCS_DECODING_ERROR\\0" - "SLEN_CHECK_FAILED\\0" - "SLEN_RECOVERY_FAILED\\0" - "UNKNOWN_ALGORITHM_TYPE\\0" - "UNKNOWN_PADDING_TYPE\\0" - "VALUE_MISSING\\0" - "WRONG_SIGNATURE_LENGTH\\0" - "ALPN_MISMATCH_ON_EARLY_DATA\\0" - "APPLICATION_DATA_INSTEAD_OF_HANDSHAKE\\0" - "APPLICATION_DATA_ON_SHUTDOWN\\0" - "APP_DATA_IN_HANDSHAKE\\0" - "ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT\\0" - "BAD_ALERT\\0" - "BAD_CHANGE_CIPHER_SPEC\\0" - "BAD_DATA_RETURNED_BY_CALLBACK\\0" - "BAD_DH_P_LENGTH\\0" - "BAD_DIGEST_LENGTH\\0" - "BAD_ECC_CERT\\0" - "BAD_ECPOINT\\0" - "BAD_HANDSHAKE_RECORD\\0" - "BAD_HELLO_REQUEST\\0" - "BAD_LENGTH\\0" - "BAD_PACKET_LENGTH\\0" - "BAD_RSA_ENCRYPT\\0" - "BAD_SRTP_MKI_VALUE\\0" - "BAD_SRTP_PROTECTION_PROFILE_LIST\\0" - "BAD_SSL_FILETYPE\\0" - "BAD_WRITE_RETRY\\0" - "BIO_NOT_SET\\0" - "BLOCK_CIPHER_PAD_IS_WRONG\\0" - "BUFFERED_MESSAGES_ON_CIPHER_CHANGE\\0" - "CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD\\0" - "CANNOT_PARSE_LEAF_CERT\\0" - "CA_DN_LENGTH_MISMATCH\\0" - "CA_DN_TOO_LONG\\0" - "CCS_RECEIVED_EARLY\\0" - "CERTIFICATE_AND_PRIVATE_KEY_MISMATCH\\0" - "CERTIFICATE_VERIFY_FAILED\\0" - "CERT_CB_ERROR\\0" - "CERT_DECOMPRESSION_FAILED\\0" - "CERT_LENGTH_MISMATCH\\0" - "CHANNEL_ID_NOT_P256\\0" - "CHANNEL_ID_SIGNATURE_INVALID\\0" - "CIPHER_OR_HASH_UNAVAILABLE\\0" - "CLIENTHELLO_PARSE_FAILED\\0" - "CLIENTHELLO_TLSEXT\\0" - "CONNECTION_REJECTED\\0" - "CONNECTION_TYPE_NOT_SET\\0" - "CUSTOM_EXTENSION_ERROR\\0" - "DATA_LENGTH_TOO_LONG\\0" - "DECRYPTION_FAILED\\0" - "DECRYPTION_FAILED_OR_BAD_RECORD_MAC\\0" - "DH_PUBLIC_VALUE_LENGTH_IS_WRONG\\0" - "DH_P_TOO_LONG\\0" - "DIGEST_CHECK_FAILED\\0" - "DOWNGRADE_DETECTED\\0" - "DTLS_MESSAGE_TOO_BIG\\0" - "DUPLICATE_EXTENSION\\0" - "DUPLICATE_KEY_SHARE\\0" - "DUPLICATE_SIGNATURE_ALGORITHM\\0" - "EARLY_DATA_NOT_IN_USE\\0" - "ECC_CERT_NOT_FOR_SIGNING\\0" - "EMPTY_HELLO_RETRY_REQUEST\\0" - "EMS_STATE_INCONSISTENT\\0" - "ENCRYPTED_LENGTH_TOO_LONG\\0" - "ERROR_ADDING_EXTENSION\\0" - "ERROR_IN_RECEIVED_CIPHER_LIST\\0" - "ERROR_PARSING_EXTENSION\\0" - "EXCESSIVE_MESSAGE_SIZE\\0" - "EXTRA_DATA_IN_MESSAGE\\0" - "FRAGMENT_MISMATCH\\0" - "GOT_NEXT_PROTO_WITHOUT_EXTENSION\\0" - "HANDSHAKE_FAILURE_ON_CLIENT_HELLO\\0" - "HANDSHAKE_NOT_COMPLETE\\0" - "HTTPS_PROXY_REQUEST\\0" - "HTTP_REQUEST\\0" - "INAPPROPRIATE_FALLBACK\\0" - "INVALID_ALPN_PROTOCOL\\0" - "INVALID_COMMAND\\0" - "INVALID_COMPRESSION_LIST\\0" - "INVALID_DELEGATED_CREDENTIAL\\0" - "INVALID_MESSAGE\\0" - "INVALID_OUTER_RECORD_TYPE\\0" - "INVALID_SCT_LIST\\0" - "INVALID_SIGNATURE_ALGORITHM\\0" - "INVALID_SSL_SESSION\\0" - "INVALID_TICKET_KEYS_LENGTH\\0" - "KEY_USAGE_BIT_INCORRECT\\0" - "LENGTH_MISMATCH\\0" - "MISSING_EXTENSION\\0" - "MISSING_KEY_SHARE\\0" - "MISSING_RSA_CERTIFICATE\\0" - "MISSING_TMP_DH_KEY\\0" - "MISSING_TMP_ECDH_KEY\\0" - "MIXED_SPECIAL_OPERATOR_WITH_GROUPS\\0" - "MTU_TOO_SMALL\\0" - "NEGOTIATED_BOTH_NPN_AND_ALPN\\0" - "NEGOTIATED_TB_WITHOUT_EMS_OR_RI\\0" - "NESTED_GROUP\\0" - "NO_CERTIFICATES_RETURNED\\0" - "NO_CERTIFICATE_ASSIGNED\\0" - "NO_CERTIFICATE_SET\\0" - "NO_CIPHERS_AVAILABLE\\0" - "NO_CIPHERS_PASSED\\0" - "NO_CIPHERS_SPECIFIED\\0" - "NO_CIPHER_MATCH\\0" - "NO_COMMON_SIGNATURE_ALGORITHMS\\0" - "NO_COMPRESSION_SPECIFIED\\0" - "NO_GROUPS_SPECIFIED\\0" - "NO_METHOD_SPECIFIED\\0" - "NO_P256_SUPPORT\\0" - "NO_PRIVATE_KEY_ASSIGNED\\0" - "NO_RENEGOTIATION\\0" - "NO_REQUIRED_DIGEST\\0" - "NO_SHARED_CIPHER\\0" - "NO_SHARED_GROUP\\0" - "NO_SUPPORTED_VERSIONS_ENABLED\\0" - "NULL_SSL_CTX\\0" - "NULL_SSL_METHOD_PASSED\\0" - "OCSP_CB_ERROR\\0" - "OLD_SESSION_CIPHER_NOT_RETURNED\\0" - "OLD_SESSION_PRF_HASH_MISMATCH\\0" - "OLD_SESSION_VERSION_NOT_RETURNED\\0" - "PARSE_TLSEXT\\0" - "PATH_TOO_LONG\\0" - "PEER_DID_NOT_RETURN_A_CERTIFICATE\\0" - "PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE\\0" - "PRE_SHARED_KEY_MUST_BE_LAST\\0" - "PRIVATE_KEY_OPERATION_FAILED\\0" - "PROTOCOL_IS_SHUTDOWN\\0" - "PSK_IDENTITY_BINDER_COUNT_MISMATCH\\0" - "PSK_IDENTITY_NOT_FOUND\\0" - "PSK_NO_CLIENT_CB\\0" - "PSK_NO_SERVER_CB\\0" - "QUIC_INTERNAL_ERROR\\0" - "READ_TIMEOUT_EXPIRED\\0" - "RECORD_LENGTH_MISMATCH\\0" - "RECORD_TOO_LARGE\\0" - "RENEGOTIATION_EMS_MISMATCH\\0" - "RENEGOTIATION_ENCODING_ERR\\0" - "RENEGOTIATION_MISMATCH\\0" - "REQUIRED_CIPHER_MISSING\\0" - "RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION\\0" - "RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION\\0" - "SCSV_RECEIVED_WHEN_RENEGOTIATING\\0" - "SECOND_SERVERHELLO_VERSION_MISMATCH\\0" - "SERVERHELLO_TLSEXT\\0" - "SERVER_CERT_CHANGED\\0" - "SERVER_ECHOED_INVALID_SESSION_ID\\0" - "SESSION_ID_CONTEXT_UNINITIALIZED\\0" - "SESSION_MAY_NOT_BE_CREATED\\0" - "SHUTDOWN_WHILE_IN_INIT\\0" - "SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER\\0" - "SRTP_COULD_NOT_ALLOCATE_PROFILES\\0" - "SRTP_UNKNOWN_PROTECTION_PROFILE\\0" - "SSL3_EXT_INVALID_SERVERNAME\\0" - "SSLV3_ALERT_BAD_CERTIFICATE\\0" - "SSLV3_ALERT_BAD_RECORD_MAC\\0" - "SSLV3_ALERT_CERTIFICATE_EXPIRED\\0" - "SSLV3_ALERT_CERTIFICATE_REVOKED\\0" - "SSLV3_ALERT_CERTIFICATE_UNKNOWN\\0" - "SSLV3_ALERT_CLOSE_NOTIFY\\0" - "SSLV3_ALERT_DECOMPRESSION_FAILURE\\0" - "SSLV3_ALERT_HANDSHAKE_FAILURE\\0" - "SSLV3_ALERT_ILLEGAL_PARAMETER\\0" - "SSLV3_ALERT_NO_CERTIFICATE\\0" - "SSLV3_ALERT_UNEXPECTED_MESSAGE\\0" - "SSLV3_ALERT_UNSUPPORTED_CERTIFICATE\\0" - "SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION\\0" - "SSL_HANDSHAKE_FAILURE\\0" - "SSL_SESSION_ID_CONTEXT_TOO_LONG\\0" - "SSL_SESSION_ID_TOO_LONG\\0" - "TICKET_ENCRYPTION_FAILED\\0" - "TLS13_DOWNGRADE\\0" - "TLSV1_ALERT_ACCESS_DENIED\\0" - "TLSV1_ALERT_DECODE_ERROR\\0" - "TLSV1_ALERT_DECRYPTION_FAILED\\0" - "TLSV1_ALERT_DECRYPT_ERROR\\0" - "TLSV1_ALERT_EXPORT_RESTRICTION\\0" - "TLSV1_ALERT_INAPPROPRIATE_FALLBACK\\0" - "TLSV1_ALERT_INSUFFICIENT_SECURITY\\0" - "TLSV1_ALERT_INTERNAL_ERROR\\0" - "TLSV1_ALERT_NO_RENEGOTIATION\\0" - "TLSV1_ALERT_PROTOCOL_VERSION\\0" - "TLSV1_ALERT_RECORD_OVERFLOW\\0" - "TLSV1_ALERT_UNKNOWN_CA\\0" - "TLSV1_ALERT_USER_CANCELLED\\0" - "TLSV1_BAD_CERTIFICATE_HASH_VALUE\\0" - "TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\\0" - "TLSV1_CERTIFICATE_REQUIRED\\0" - "TLSV1_CERTIFICATE_UNOBTAINABLE\\0" - "TLSV1_UNKNOWN_PSK_IDENTITY\\0" - "TLSV1_UNRECOGNIZED_NAME\\0" - "TLSV1_UNSUPPORTED_EXTENSION\\0" - "TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\\0" - "TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\\0" - "TOO_MANY_EMPTY_FRAGMENTS\\0" - "TOO_MANY_KEY_UPDATES\\0" - "TOO_MANY_WARNING_ALERTS\\0" - "TOO_MUCH_READ_EARLY_DATA\\0" - "TOO_MUCH_SKIPPED_EARLY_DATA\\0" - "UNABLE_TO_FIND_ECDH_PARAMETERS\\0" - "UNCOMPRESSED_CERT_TOO_LARGE\\0" - "UNEXPECTED_EXTENSION\\0" - "UNEXPECTED_EXTENSION_ON_EARLY_DATA\\0" - "UNEXPECTED_MESSAGE\\0" - "UNEXPECTED_OPERATOR_IN_GROUP\\0" - "UNEXPECTED_RECORD\\0" - "UNKNOWN_ALERT_TYPE\\0" - "UNKNOWN_CERTIFICATE_TYPE\\0" - "UNKNOWN_CERT_COMPRESSION_ALG\\0" - "UNKNOWN_CIPHER_RETURNED\\0" - "UNKNOWN_CIPHER_TYPE\\0" - "UNKNOWN_KEY_EXCHANGE_TYPE\\0" - "UNKNOWN_PROTOCOL\\0" - "UNKNOWN_SSL_VERSION\\0" - "UNKNOWN_STATE\\0" - "UNSAFE_LEGACY_RENEGOTIATION_DISABLED\\0" - "UNSUPPORTED_COMPRESSION_ALGORITHM\\0" - "UNSUPPORTED_ELLIPTIC_CURVE\\0" - "UNSUPPORTED_PROTOCOL\\0" - "UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY\\0" - "WRONG_CERTIFICATE_TYPE\\0" - "WRONG_CIPHER_RETURNED\\0" - "WRONG_CURVE\\0" - "WRONG_ENCRYPTION_LEVEL_RECEIVED\\0" - "WRONG_MESSAGE_TYPE\\0" - "WRONG_SIGNATURE_TYPE\\0" - "WRONG_SSL_VERSION\\0" - "WRONG_VERSION_NUMBER\\0" - "WRONG_VERSION_ON_EARLY_DATA\\0" - "X509_LIB\\0" - "X509_VERIFICATION_SETUP_PROBLEMS\\0" - "AKID_MISMATCH\\0" - "BAD_X509_FILETYPE\\0" - "BASE64_DECODE_ERROR\\0" - "CANT_CHECK_DH_KEY\\0" - "CERT_ALREADY_IN_HASH_TABLE\\0" - "CRL_ALREADY_DELTA\\0" - "CRL_VERIFY_FAILURE\\0" - "IDP_MISMATCH\\0" - "INVALID_DIRECTORY\\0" - "INVALID_FIELD_NAME\\0" - "INVALID_PARAMETER\\0" - "INVALID_PSS_PARAMETERS\\0" - "INVALID_TRUST\\0" - "ISSUER_MISMATCH\\0" - "KEY_TYPE_MISMATCH\\0" - "KEY_VALUES_MISMATCH\\0" - "LOADING_CERT_DIR\\0" - "LOADING_DEFAULTS\\0" - "NAME_TOO_LONG\\0" - "NEWER_CRL_NOT_NEWER\\0" - "NO_CERT_SET_FOR_US_TO_VERIFY\\0" - "NO_CRL_NUMBER\\0" - "PUBLIC_KEY_DECODE_ERROR\\0" - "PUBLIC_KEY_ENCODE_ERROR\\0" - "SHOULD_RETRY\\0" - "SIGNATURE_ALGORITHM_MISMATCH\\0" - "UNKNOWN_KEY_TYPE\\0" - "UNKNOWN_PURPOSE_ID\\0" - "UNKNOWN_TRUST_ID\\0" - "WRONG_LOOKUP_TYPE\\0" - "BAD_IP_ADDRESS\\0" - "BAD_OBJECT\\0" - "BN_DEC2BN_ERROR\\0" - "BN_TO_ASN1_INTEGER_ERROR\\0" - "CANNOT_FIND_FREE_FUNCTION\\0" - "DIRNAME_ERROR\\0" - "DISTPOINT_ALREADY_SET\\0" - "DUPLICATE_ZONE_ID\\0" - "ERROR_CONVERTING_ZONE\\0" - "ERROR_CREATING_EXTENSION\\0" - "ERROR_IN_EXTENSION\\0" - "EXPECTED_A_SECTION_NAME\\0" - "EXTENSION_EXISTS\\0" - "EXTENSION_NAME_ERROR\\0" - "EXTENSION_NOT_FOUND\\0" - "EXTENSION_SETTING_NOT_SUPPORTED\\0" - "EXTENSION_VALUE_ERROR\\0" - "ILLEGAL_EMPTY_EXTENSION\\0" - "ILLEGAL_HEX_DIGIT\\0" - "INCORRECT_POLICY_SYNTAX_TAG\\0" - "INVALID_BOOLEAN_STRING\\0" - "INVALID_EXTENSION_STRING\\0" - "INVALID_MULTIPLE_RDNS\\0" - "INVALID_NAME\\0" - "INVALID_NULL_ARGUMENT\\0" - "INVALID_NULL_NAME\\0" - "INVALID_NULL_VALUE\\0" - "INVALID_NUMBERS\\0" - "INVALID_OBJECT_IDENTIFIER\\0" - "INVALID_OPTION\\0" - "INVALID_POLICY_IDENTIFIER\\0" - "INVALID_PROXY_POLICY_SETTING\\0" - "INVALID_PURPOSE\\0" - "INVALID_SECTION\\0" - "INVALID_SYNTAX\\0" - "ISSUER_DECODE_ERROR\\0" - "NEED_ORGANIZATION_AND_NUMBERS\\0" - "NO_CONFIG_DATABASE\\0" - "NO_ISSUER_CERTIFICATE\\0" - "NO_ISSUER_DETAILS\\0" - "NO_POLICY_IDENTIFIER\\0" - "NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED\\0" - "NO_PUBLIC_KEY\\0" - "NO_SUBJECT_DETAILS\\0" - "ODD_NUMBER_OF_DIGITS\\0" - "OPERATION_NOT_DEFINED\\0" - "OTHERNAME_ERROR\\0" - "POLICY_LANGUAGE_ALREADY_DEFINED\\0" - "POLICY_PATH_LENGTH\\0" - "POLICY_PATH_LENGTH_ALREADY_DEFINED\\0" - "POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY\\0" - "SECTION_NOT_FOUND\\0" - "UNABLE_TO_GET_ISSUER_DETAILS\\0" - "UNABLE_TO_GET_ISSUER_KEYID\\0" - "UNKNOWN_BIT_STRING_ARGUMENT\\0" - "UNKNOWN_EXTENSION\\0" - "UNKNOWN_EXTENSION_NAME\\0" - "UNKNOWN_OPTION\\0" - "UNSUPPORTED_OPTION\\0" - "USER_TOO_LONG\\0" - ""; + % for err_data in open("src/boringssl/err_data.c", "r").readlines(): + ${err_data.replace('\\0', '\\\\0')}\ + % endfor EOF # Remove lines of the format "#define SOME_MACRO SOME_MACRO" because they mess up the symbol prefix diff --git a/templates/test/core/surface/public_headers_must_be_c89.c.template b/templates/test/core/surface/public_headers_must_be_c89.c.template index dde5c81e1ce..2932d7a2dc2 100644 --- a/templates/test/core/surface/public_headers_must_be_c89.c.template +++ b/templates/test/core/surface/public_headers_must_be_c89.c.template @@ -50,6 +50,11 @@ #include int main(int argc, char **argv) { + /* Use the parameters to avoid unused-parameter warning. + (C89 parameters must be named.) */ + (void)argc; + (void)argv; + % for fn in fns: printf("%lx", (unsigned long) ${fn}); % endfor diff --git a/templates/tools/dockerfile/test/bazel/Dockerfile.template b/templates/tools/dockerfile/test/bazel/Dockerfile.template index 864c9893a14..b440cb49d90 100644 --- a/templates/tools/dockerfile/test/bazel/Dockerfile.template +++ b/templates/tools/dockerfile/test/bazel/Dockerfile.template @@ -29,6 +29,7 @@ autoconf ${'\\'} build-essential ${'\\'} curl ${'\\'} + wget ${'\\'} libtool ${'\\'} make ${'\\'} openjdk-8-jdk ${'\\'} @@ -36,6 +37,8 @@ <%include file="../../python_deps.include"/> + <%include file="../../compile_python_36.include"/> + <%include file="../../bazel.include"/> RUN mkdir -p /var/local/jenkins diff --git a/test/core/avl/avl_test.cc b/test/core/avl/avl_test.cc index 769e67563dc..9af857818b6 100644 --- a/test/core/avl/avl_test.cc +++ b/test/core/avl/avl_test.cc @@ -33,14 +33,14 @@ static int* box(int x) { return b; } -static long int_compare(void* int1, void* int2, void* unused) { +static long int_compare(void* int1, void* int2, void* /*unused*/) { return (*static_cast(int1)) - (*static_cast(int2)); } -static void* int_copy(void* p, void* unused) { +static void* int_copy(void* p, void* /*unused*/) { return box(*static_cast(p)); } -static void destroy(void* p, void* unused) { gpr_free(p); } +static void destroy(void* p, void* /*unused*/) { gpr_free(p); } static const grpc_avl_vtable int_int_vtable = {destroy, int_copy, int_compare, destroy, int_copy}; diff --git a/test/core/bad_ssl/server_common.cc b/test/core/bad_ssl/server_common.cc index 809539aff3f..ebbe2b60a5a 100644 --- a/test/core/bad_ssl/server_common.cc +++ b/test/core/bad_ssl/server_common.cc @@ -30,7 +30,7 @@ static int got_sigint = 0; -static void sigint_handler(int x) { got_sigint = 1; } +static void sigint_handler(int /*x*/) { got_sigint = 1; } const char* bad_ssl_addr(int argc, char** argv) { gpr_cmdline* cl; diff --git a/test/core/debug/stats_test.cc b/test/core/debug/stats_test.cc index 8e13898e2c3..f28133d1274 100644 --- a/test/core/debug/stats_test.cc +++ b/test/core/debug/stats_test.cc @@ -151,5 +151,9 @@ int main(int argc, char** argv) { int ret = RUN_ALL_TESTS(); grpc_shutdown(); return ret; +#else + // Avoid unused parameter warning for conditional parameters. + (void)argc; + (void)argv; #endif } diff --git a/test/core/end2end/fixtures/http_proxy_fixture.cc b/test/core/end2end/fixtures/http_proxy_fixture.cc index 8f8ddcc8a49..90e16dc43c8 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.cc +++ b/test/core/end2end/fixtures/http_proxy_fixture.cc @@ -119,12 +119,14 @@ typedef struct proxy_connection { grpc_http_request http_request; } proxy_connection; -static void proxy_connection_ref(proxy_connection* conn, const char* reason) { +static void proxy_connection_ref(proxy_connection* conn, + const char* /*reason*/) { gpr_ref(&conn->refcount); } // Helper function to destroy the proxy connection. -static void proxy_connection_unref(proxy_connection* conn, const char* reason) { +static void proxy_connection_unref(proxy_connection* conn, + const char* /*reason*/) { if (gpr_unref(&conn->refcount)) { gpr_log(GPR_DEBUG, "endpoints: %p %p", conn->client_endpoint, conn->server_endpoint); @@ -554,7 +556,7 @@ static void on_read_request_done(void* arg, grpc_error* error) { } static void on_accept(void* arg, grpc_endpoint* endpoint, - grpc_pollset* accepting_pollset, + grpc_pollset* /*accepting_pollset*/, grpc_tcp_server_acceptor* acceptor) { gpr_free(acceptor); grpc_end2end_http_proxy* proxy = static_cast(arg); @@ -639,7 +641,7 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create( return proxy; } -static void destroy_pollset(void* arg, grpc_error* error) { +static void destroy_pollset(void* arg, grpc_error* /*error*/) { grpc_pollset* pollset = static_cast(arg); grpc_pollset_destroy(pollset); gpr_free(pollset); diff --git a/test/core/end2end/fixtures/local_util.cc b/test/core/end2end/fixtures/local_util.cc index 767f3a28ef8..c1fd88b67b0 100644 --- a/test/core/end2end/fixtures/local_util.cc +++ b/test/core/end2end/fixtures/local_util.cc @@ -73,8 +73,9 @@ static bool fail_server_auth_check(grpc_channel_args* server_args) { return false; } -static void process_auth_failure(void* state, grpc_auth_context* ctx, - const grpc_metadata* md, size_t md_count, +static void process_auth_failure(void* state, grpc_auth_context* /*ctx*/, + const grpc_metadata* /*md*/, + size_t /*md_count*/, grpc_process_auth_metadata_done_cb cb, void* user_data) { GPR_ASSERT(state == nullptr); diff --git a/test/core/end2end/fixtures/proxy.cc b/test/core/end2end/fixtures/proxy.cc index 4ae7450b0df..3351eab2f3c 100644 --- a/test/core/end2end/fixtures/proxy.cc +++ b/test/core/end2end/fixtures/proxy.cc @@ -120,7 +120,7 @@ static closure* new_closure(void (*func)(void* arg, int success), void* arg) { return cl; } -static void shutdown_complete(void* arg, int success) { +static void shutdown_complete(void* arg, int /*success*/) { grpc_end2end_proxy* proxy = static_cast(arg); proxy->shutdown = 1; grpc_completion_queue_shutdown(proxy->cq); @@ -137,7 +137,7 @@ void grpc_end2end_proxy_destroy(grpc_end2end_proxy* proxy) { grpc_core::Delete(proxy); } -static void unrefpc(proxy_call* pc, const char* reason) { +static void unrefpc(proxy_call* pc, const char* /*reason*/) { if (gpr_unref(&pc->refs)) { grpc_call_unref(pc->c2p); grpc_call_unref(pc->p2s); @@ -149,14 +149,16 @@ static void unrefpc(proxy_call* pc, const char* reason) { } } -static void refpc(proxy_call* pc, const char* reason) { gpr_ref(&pc->refs); } +static void refpc(proxy_call* pc, const char* /*reason*/) { + gpr_ref(&pc->refs); +} -static void on_c2p_sent_initial_metadata(void* arg, int success) { +static void on_c2p_sent_initial_metadata(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_c2p_sent_initial_metadata"); } -static void on_p2s_recv_initial_metadata(void* arg, int success) { +static void on_p2s_recv_initial_metadata(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); grpc_op op; grpc_call_error err; @@ -178,7 +180,7 @@ static void on_p2s_recv_initial_metadata(void* arg, int success) { unrefpc(pc, "on_p2s_recv_initial_metadata"); } -static void on_p2s_sent_initial_metadata(void* arg, int success) { +static void on_p2s_sent_initial_metadata(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_p2s_sent_initial_metadata"); } @@ -205,7 +207,7 @@ static void on_p2s_sent_message(void* arg, int success) { unrefpc(pc, "on_p2s_sent_message"); } -static void on_p2s_sent_close(void* arg, int success) { +static void on_p2s_sent_close(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_p2s_sent_close"); } @@ -285,7 +287,7 @@ static void on_p2s_recv_msg(void* arg, int success) { unrefpc(pc, "on_p2s_recv_msg"); } -static void on_c2p_sent_status(void* arg, int success) { +static void on_c2p_sent_status(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_c2p_sent_status"); } @@ -315,7 +317,7 @@ static void on_p2s_status(void* arg, int success) { unrefpc(pc, "on_p2s_status"); } -static void on_c2p_closed(void* arg, int success) { +static void on_c2p_closed(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_c2p_closed"); } diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc index 2fc9d2ff271..2d6ad771fcc 100644 --- a/test/core/end2end/tests/cancel_with_status.cc +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -89,7 +89,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f, size_t num_ops) { grpc_call* c; cq_verifier* cqv = cq_verifier_create(f.cq); diff --git a/test/core/end2end/tests/disappearing_server.cc b/test/core/end2end/tests/disappearing_server.cc index fdd780f117e..0858ce39597 100644 --- a/test/core/end2end/tests/disappearing_server.cc +++ b/test/core/end2end/tests/disappearing_server.cc @@ -68,7 +68,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void do_request_and_shutdown_server(grpc_end2end_test_config config, +static void do_request_and_shutdown_server(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture* f, cq_verifier* cqv) { grpc_call* c; diff --git a/test/core/end2end/tests/empty_batch.cc b/test/core/end2end/tests/empty_batch.cc index 317bb7aeb07..1144ebf1759 100644 --- a/test/core/end2end/tests/empty_batch.cc +++ b/test/core/end2end/tests/empty_batch.cc @@ -85,7 +85,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void empty_batch_body(grpc_end2end_test_config config, +static void empty_batch_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f) { grpc_call* c; cq_verifier* cqv = cq_verifier_create(f.cq); diff --git a/test/core/end2end/tests/high_initial_seqno.cc b/test/core/end2end/tests/high_initial_seqno.cc index 18e6ee90ef5..ca6e883ee4d 100644 --- a/test/core/end2end/tests/high_initial_seqno.cc +++ b/test/core/end2end/tests/high_initial_seqno.cc @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f) { grpc_call* c; grpc_call* s; diff --git a/test/core/end2end/tests/hpack_size.cc b/test/core/end2end/tests/hpack_size.cc index 7c51294e1cc..8f36868d98a 100644 --- a/test/core/end2end/tests/hpack_size.cc +++ b/test/core/end2end/tests/hpack_size.cc @@ -228,7 +228,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f, size_t index) { grpc_call* c; grpc_call* s; diff --git a/test/core/end2end/tests/idempotent_request.cc b/test/core/end2end/tests/idempotent_request.cc index 80908d5210c..5fc087c9e64 100644 --- a/test/core/end2end/tests/idempotent_request.cc +++ b/test/core/end2end/tests/idempotent_request.cc @@ -86,7 +86,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f) { grpc_call* c; grpc_call* s; diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index f1f3c7a2745..c7656d083d2 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -61,6 +61,11 @@ #include int main(int argc, char **argv) { + /* Use the parameters to avoid unused-parameter warning. + (C89 parameters must be named.) */ + (void)argc; + (void)argv; + printf("%lx", (unsigned long) grpc_compression_algorithm_is_message); printf("%lx", (unsigned long) grpc_compression_algorithm_is_stream); printf("%lx", (unsigned long) grpc_compression_algorithm_parse); diff --git a/test/core/tsi/alts/crypt/aes_gcm_test.cc b/test/core/tsi/alts/crypt/aes_gcm_test.cc index 576dd8f27b8..9ba6861414a 100644 --- a/test/core/tsi/alts/crypt/aes_gcm_test.cc +++ b/test/core/tsi/alts/crypt/aes_gcm_test.cc @@ -2093,7 +2093,7 @@ static void gsec_test_do_vector_tests_ieee() { gsec_aead_free_test_vector(test_vector_20); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { grpc_init(); gsec_test_do_generic_crypter_tests(); gsec_test_do_vector_tests_nist(); diff --git a/test/core/tsi/alts/frame_protector/alts_counter_test.cc b/test/core/tsi/alts/frame_protector/alts_counter_test.cc index 49ff82108bf..9c5b790fa12 100644 --- a/test/core/tsi/alts/frame_protector/alts_counter_test.cc +++ b/test/core/tsi/alts/frame_protector/alts_counter_test.cc @@ -27,8 +27,8 @@ const size_t kSmallOverflowSize = 1; const size_t kGcmCounterSize = 12; const size_t kGcmOverflowSize = 5; -static bool do_bytes_represent_client(alts_counter* ctr, unsigned char* counter, - size_t size) { +static bool do_bytes_represent_client(alts_counter* ctr, + unsigned char* /*counter*/, size_t size) { return (ctr->counter[size - 1] & 0x80) == 0x80; } @@ -165,7 +165,7 @@ static void alts_counter_test_overflow_single_increment(bool is_client, alts_counter_destroy(ctr); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { alts_counter_test_input_sanity_check(kGcmCounterSize, kGcmOverflowSize); alts_counter_test_overflow_full_range(true, kSmallCounterSize, kSmallOverflowSize); diff --git a/test/core/tsi/alts/frame_protector/alts_crypter_test.cc b/test/core/tsi/alts/frame_protector/alts_crypter_test.cc index 0ad616bcd63..02b7ebd77c1 100644 --- a/test/core/tsi/alts/frame_protector/alts_crypter_test.cc +++ b/test/core/tsi/alts/frame_protector/alts_crypter_test.cc @@ -128,10 +128,9 @@ static void alts_crypter_test_multiple_random_seal_unseal( gpr_free(duplicate_buffer2); } -static void alts_crypter_test_corrupted_unseal(alts_crypter* server_seal, - alts_crypter* server_unseal, - alts_crypter* client_seal, - alts_crypter* client_unseal) { +static void alts_crypter_test_corrupted_unseal( + alts_crypter* server_seal, alts_crypter* server_unseal, + alts_crypter* client_seal, alts_crypter* /*client_unseal*/) { size_t data_size = gsec_test_bias_random_uint32(1024) + 1; size_t num_overhead_bytes = alts_crypter_num_overhead_bytes(server_seal); size_t protected_data_size = data_size + num_overhead_bytes; @@ -487,7 +486,7 @@ static void alts_crypter_do_generic_tests() { client_unseal); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { alts_crypter_do_generic_tests(); return 0; } diff --git a/test/core/tsi/alts/frame_protector/frame_handler_test.cc b/test/core/tsi/alts/frame_protector/frame_handler_test.cc index 6434ea1d313..6780eb7127e 100644 --- a/test/core/tsi/alts/frame_protector/frame_handler_test.cc +++ b/test/core/tsi/alts/frame_protector/frame_handler_test.cc @@ -228,7 +228,7 @@ static void frame_handler_test_null_reader_bytes() { destroy_frame_handler(handler); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { frame_handler_test_frame_deframe(); frame_handler_test_small_buffer(); frame_handler_test_null_input_stream(); diff --git a/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc b/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc index a2c3d48ca53..bc147d24ebd 100644 --- a/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc +++ b/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc @@ -155,7 +155,7 @@ static void test_check_failure() { &highest_common_version) == 0); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { /* Run tests. */ test_success(); test_failure(); diff --git a/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc b/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc index db1934bbae9..8b0e39cbb34 100644 --- a/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc +++ b/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc @@ -917,7 +917,7 @@ static void alts_iovec_record_protocol_mix_operations_tests() { alts_iovec_record_protocol_test_fixture_destroy(fixture_2); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { alts_iovec_record_protocol_random_seal_unseal_tests(); alts_iovec_record_protocol_empty_seal_unseal_tests(); alts_iovec_record_protocol_unsync_seal_unseal_tests(); diff --git a/test/core/util/mock_endpoint.cc b/test/core/util/mock_endpoint.cc index 2f78a7f8a97..01d90b49f41 100644 --- a/test/core/util/mock_endpoint.cc +++ b/test/core/util/mock_endpoint.cc @@ -41,7 +41,7 @@ typedef struct mock_endpoint { } mock_endpoint; static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices, - grpc_closure* cb, bool urgent) { + grpc_closure* cb, bool /*urgent*/) { mock_endpoint* m = reinterpret_cast(ep); gpr_mu_lock(&m->mu); if (m->read_buffer.count > 0) { @@ -55,7 +55,7 @@ static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices, } static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices, - grpc_closure* cb, void* arg) { + grpc_closure* cb, void* /*arg*/) { mock_endpoint* m = reinterpret_cast(ep); for (size_t i = 0; i < slices->count; i++) { m->on_write(slices->slices[i]); @@ -63,13 +63,14 @@ static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices, GRPC_CLOSURE_SCHED(cb, GRPC_ERROR_NONE); } -static void me_add_to_pollset(grpc_endpoint* ep, grpc_pollset* pollset) {} +static void me_add_to_pollset(grpc_endpoint* /*ep*/, + grpc_pollset* /*pollset*/) {} -static void me_add_to_pollset_set(grpc_endpoint* ep, - grpc_pollset_set* pollset) {} +static void me_add_to_pollset_set(grpc_endpoint* /*ep*/, + grpc_pollset_set* /*pollset*/) {} -static void me_delete_from_pollset_set(grpc_endpoint* ep, - grpc_pollset_set* pollset) {} +static void me_delete_from_pollset_set(grpc_endpoint* /*ep*/, + grpc_pollset_set* /*pollset*/) {} static void me_shutdown(grpc_endpoint* ep, grpc_error* why) { mock_endpoint* m = reinterpret_cast(ep); @@ -93,7 +94,7 @@ static void me_destroy(grpc_endpoint* ep) { gpr_free(m); } -static char* me_get_peer(grpc_endpoint* ep) { +static char* me_get_peer(grpc_endpoint* /*ep*/) { return gpr_strdup("fake:mock_endpoint"); } @@ -102,9 +103,9 @@ static grpc_resource_user* me_get_resource_user(grpc_endpoint* ep) { return m->resource_user; } -static int me_get_fd(grpc_endpoint* ep) { return -1; } +static int me_get_fd(grpc_endpoint* /*ep*/) { return -1; } -static bool me_can_track_err(grpc_endpoint* ep) { return false; } +static bool me_can_track_err(grpc_endpoint* /*ep*/) { return false; } static const grpc_endpoint_vtable vtable = {me_read, me_write, diff --git a/test/core/util/passthru_endpoint.cc b/test/core/util/passthru_endpoint.cc index 2d26902fc44..021a94421c2 100644 --- a/test/core/util/passthru_endpoint.cc +++ b/test/core/util/passthru_endpoint.cc @@ -54,7 +54,7 @@ struct passthru_endpoint { }; static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices, - grpc_closure* cb, bool urgent) { + grpc_closure* cb, bool /*urgent*/) { half* m = reinterpret_cast(ep); gpr_mu_lock(&m->parent->mu); if (m->parent->shutdown) { @@ -76,7 +76,7 @@ static half* other_half(half* h) { } static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices, - grpc_closure* cb, void* arg) { + grpc_closure* cb, void* /*arg*/) { half* m = other_half(reinterpret_cast(ep)); gpr_mu_lock(&m->parent->mu); grpc_error* error = GRPC_ERROR_NONE; @@ -99,13 +99,14 @@ static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices, GRPC_CLOSURE_SCHED(cb, error); } -static void me_add_to_pollset(grpc_endpoint* ep, grpc_pollset* pollset) {} +static void me_add_to_pollset(grpc_endpoint* /*ep*/, + grpc_pollset* /*pollset*/) {} -static void me_add_to_pollset_set(grpc_endpoint* ep, - grpc_pollset_set* pollset) {} +static void me_add_to_pollset_set(grpc_endpoint* /*ep*/, + grpc_pollset_set* /*pollset*/) {} -static void me_delete_from_pollset_set(grpc_endpoint* ep, - grpc_pollset_set* pollset) {} +static void me_delete_from_pollset_set(grpc_endpoint* /*ep*/, + grpc_pollset_set* /*pollset*/) {} static void me_shutdown(grpc_endpoint* ep, grpc_error* why) { half* m = reinterpret_cast(ep); @@ -153,9 +154,9 @@ static char* me_get_peer(grpc_endpoint* ep) { : gpr_strdup("fake:mock_server_endpoint"); } -static int me_get_fd(grpc_endpoint* ep) { return -1; } +static int me_get_fd(grpc_endpoint* /*ep*/) { return -1; } -static bool me_can_track_err(grpc_endpoint* ep) { return false; } +static bool me_can_track_err(grpc_endpoint* /*ep*/) { return false; } static grpc_resource_user* me_get_resource_user(grpc_endpoint* ep) { half* m = reinterpret_cast(ep); diff --git a/test/core/util/port_server_client.cc b/test/core/util/port_server_client.cc index 8c48a5467c1..e55e9276da3 100644 --- a/test/core/util/port_server_client.cc +++ b/test/core/util/port_server_client.cc @@ -40,14 +40,14 @@ typedef struct freereq { int done = 0; } freereq; -static void destroy_pops_and_shutdown(void* p, grpc_error* error) { +static void destroy_pops_and_shutdown(void* p, grpc_error* /*error*/) { grpc_pollset* pollset = grpc_polling_entity_pollset(static_cast(p)); grpc_pollset_destroy(pollset); gpr_free(pollset); } -static void freed_port_from_server(void* arg, grpc_error* error) { +static void freed_port_from_server(void* arg, grpc_error* /*error*/) { freereq* pr = static_cast(arg); gpr_mu_lock(pr->mu); pr->done = 1; diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index b21c02db24c..a450361b85f 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -231,7 +231,7 @@ static void output_num(long num) { output_string(buf); } -static void crash_handler(int signum, siginfo_t* info, void* data) { +static void crash_handler(int signum, siginfo_t* /*info*/, void* /*data*/) { void* addrlist[MAX_FRAMES + 1]; int addrlen; @@ -379,7 +379,7 @@ gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms) { GPR_TIMESPAN)); } -void grpc_test_init(int argc, char** argv) { +void grpc_test_init(int /*argc*/, char** /*argv*/) { install_crash_handler(); gpr_log(GPR_DEBUG, "test slowdown factor: sanitizer=%" PRId64 ", fixture=%" PRId64 diff --git a/test/core/util/test_lb_policies.cc b/test/core/util/test_lb_policies.cc index 684ee656b75..d70bf42e1ee 100644 --- a/test/core/util/test_lb_policies.cc +++ b/test/core/util/test_lb_policies.cc @@ -185,7 +185,7 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy } private: - void RecordRecvTrailingMetadata(grpc_error* error, + void RecordRecvTrailingMetadata(grpc_error* /*error*/, MetadataInterface* recv_trailing_metadata, CallState* call_state) { GPR_ASSERT(recv_trailing_metadata != nullptr); @@ -226,7 +226,7 @@ class InterceptTrailingFactory : public LoadBalancingPolicyFactory { } RefCountedPtr ParseLoadBalancingConfig( - const grpc_json* json, grpc_error** error) const override { + const grpc_json* /*json*/, grpc_error** /*error*/) const override { return nullptr; } diff --git a/test/core/util/trickle_endpoint.cc b/test/core/util/trickle_endpoint.cc index bdac1334f48..ccafa3e6d79 100644 --- a/test/core/util/trickle_endpoint.cc +++ b/test/core/util/trickle_endpoint.cc @@ -62,7 +62,7 @@ static void maybe_call_write_cb_locked(trickle_endpoint* te) { } static void te_write(grpc_endpoint* ep, grpc_slice_buffer* slices, - grpc_closure* cb, void* arg) { + grpc_closure* cb, void* /*arg*/) { trickle_endpoint* te = reinterpret_cast(ep); gpr_mu_lock(&te->mu); GPR_ASSERT(te->write_cb == nullptr); @@ -131,9 +131,9 @@ static int te_get_fd(grpc_endpoint* ep) { return grpc_endpoint_get_fd(te->wrapped); } -static bool te_can_track_err(grpc_endpoint* ep) { return false; } +static bool te_can_track_err(grpc_endpoint* /*ep*/) { return false; } -static void te_finish_write(void* arg, grpc_error* error) { +static void te_finish_write(void* arg, grpc_error* /*error*/) { trickle_endpoint* te = static_cast(arg); gpr_mu_lock(&te->mu); te->writing = false; diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD index 0e4f5467da6..98679361579 100644 --- a/test/cpp/end2end/BUILD +++ b/test/cpp/end2end/BUILD @@ -508,7 +508,7 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], - tags = ["no_windows"], # TODO(jtattermusch): fix test on windows + tags = ["no_windows", "no_test_ios"], # TODO(jtattermusch): fix test on windows ) grpc_cc_test( diff --git a/test/cpp/end2end/test_health_check_service_impl.cc b/test/cpp/end2end/test_health_check_service_impl.cc index 5898527a6cd..6a31e0ee9a6 100644 --- a/test/cpp/end2end/test_health_check_service_impl.cc +++ b/test/cpp/end2end/test_health_check_service_impl.cc @@ -26,7 +26,7 @@ using grpc::health::v1::HealthCheckResponse; namespace grpc { namespace testing { -Status HealthCheckServiceImpl::Check(ServerContext* context, +Status HealthCheckServiceImpl::Check(ServerContext* /*context*/, const HealthCheckRequest* request, HealthCheckResponse* response) { std::lock_guard lock(mu_); diff --git a/test/cpp/end2end/test_service_impl.cc b/test/cpp/end2end/test_service_impl.cc index 4078cdfb257..20e4d2d4e93 100644 --- a/test/cpp/end2end/test_service_impl.cc +++ b/test/cpp/end2end/test_service_impl.cc @@ -246,9 +246,9 @@ Status TestServiceImpl::Echo(ServerContext* context, const EchoRequest* request, return Status::OK; } -Status TestServiceImpl::CheckClientInitialMetadata(ServerContext* context, - const SimpleRequest* request, - SimpleResponse* response) { +Status TestServiceImpl::CheckClientInitialMetadata( + ServerContext* context, const SimpleRequest* /*request*/, + SimpleResponse* /*response*/) { EXPECT_EQ(MetadataMatchCount(context->client_metadata(), kCheckClientInitialMetadataKey, kCheckClientInitialMetadataVal), @@ -296,8 +296,8 @@ void CallbackTestServiceImpl::Echo( } void CallbackTestServiceImpl::CheckClientInitialMetadata( - ServerContext* context, const SimpleRequest* request, - SimpleResponse* response, + ServerContext* context, const SimpleRequest* /*request*/, + SimpleResponse* /*response*/, experimental::ServerCallbackRpcController* controller) { EXPECT_EQ(MetadataMatchCount(context->client_metadata(), kCheckClientInitialMetadataKey, @@ -741,7 +741,7 @@ CallbackTestServiceImpl::ResponseStream() { EXPECT_TRUE(ctx_->IsCancelled()); FinishOnce(Status::CANCELLED); } - void OnWriteDone(bool ok) override { + void OnWriteDone(bool /*ok*/) override { if (num_msgs_sent_ < server_responses_to_send_) { NextWrite(); } else if (server_coalescing_api_ != 0) { @@ -854,7 +854,7 @@ CallbackTestServiceImpl::BidiStream() { FinishOnce(Status::OK); } } - void OnWriteDone(bool ok) override { + void OnWriteDone(bool /*ok*/) override { std::lock_guard l(finish_mu_); if (!finished_) { StartRead(&request_); diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 69685c9c5e8..98e915a1ab2 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -320,19 +320,16 @@ class AdsServiceImpl : public AdsService { struct Locality { Locality(const grpc::string& sub_zone, std::vector ports, int lb_weight = kDefaultLocalityWeight, - int priority = kDefaultLocalityPriority, - std::vector health_statuses = {}) + int priority = kDefaultLocalityPriority) : sub_zone(std::move(sub_zone)), ports(std::move(ports)), lb_weight(lb_weight), - priority(priority), - health_statuses(std::move(health_statuses)) {} + priority(priority) {} const grpc::string sub_zone; std::vector ports; int lb_weight; int priority; - std::vector health_statuses; }; ResponseArgs() = default; @@ -413,14 +410,8 @@ class AdsServiceImpl : public AdsService { endpoints->mutable_locality()->set_region(kDefaultLocalityRegion); endpoints->mutable_locality()->set_zone(kDefaultLocalityZone); endpoints->mutable_locality()->set_sub_zone(locality.sub_zone); - for (size_t i = 0; i < locality.ports.size(); ++i) { - const int& port = locality.ports[i]; + for (const int& port : locality.ports) { auto* lb_endpoints = endpoints->add_lb_endpoints(); - if (locality.health_statuses.size() > i && - locality.health_statuses[i] != - envoy::api::v2::HealthStatus::UNKNOWN) { - lb_endpoints->set_health_status(locality.health_statuses[i]); - } auto* endpoint = lb_endpoints->mutable_endpoint(); auto* address = endpoint->mutable_address(); auto* socket_address = address->mutable_socket_address(); @@ -575,27 +566,7 @@ class LrsServiceImpl : public LrsService { bool load_report_ready_ = false; }; -class TestType { - public: - TestType(bool use_xds_resolver, bool enable_load_reporting) - : use_xds_resolver_(use_xds_resolver), - enable_load_reporting_(enable_load_reporting) {} - - bool use_xds_resolver() const { return use_xds_resolver_; } - bool enable_load_reporting() const { return enable_load_reporting_; } - - grpc::string AsString() const { - grpc::string retval = (use_xds_resolver_ ? "XdsResolver" : "FakeResolver"); - if (enable_load_reporting_) retval += "WithLoadReporting"; - return retval; - } - - private: - const bool use_xds_resolver_; - const bool enable_load_reporting_; -}; - -class XdsEnd2endTest : public ::testing::TestWithParam { +class XdsEnd2endTest : public ::testing::TestWithParam { protected: XdsEnd2endTest(size_t num_backends, size_t num_balancers, int client_load_reporting_interval_seconds) @@ -674,14 +645,12 @@ class XdsEnd2endTest : public ::testing::TestWithParam { // channel never uses a response generator, and we inject the xds // channel's response generator here. args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR, - GetParam().use_xds_resolver() - ? lb_channel_response_generator_.get() - : response_generator_.get()); + GetParam() ? lb_channel_response_generator_.get() + : response_generator_.get()); if (!expected_targets.empty()) { args.SetString(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_targets); } - grpc::string scheme = - GetParam().use_xds_resolver() ? "xds-experimental" : "fake"; + grpc::string scheme = GetParam() ? "xds-experimental" : "fake"; std::ostringstream uri; uri << scheme << ":///" << kApplicationTargetName_; // TODO(dgq): templatize tests to run everything using both secure and @@ -771,20 +740,19 @@ class XdsEnd2endTest : public ::testing::TestWithParam { } void SetNextResolution(const std::vector& ports, + const char* service_config_json = nullptr, grpc_core::FakeResolverResponseGenerator* lb_channel_response_generator = nullptr) { - if (GetParam().use_xds_resolver()) return; // Not used with xds resolver. + if (GetParam()) return; // Not used with xds resolver. grpc_core::ExecCtx exec_ctx; grpc_core::Resolver::Result result; result.addresses = CreateAddressListFromPortList(ports); - grpc_error* error = GRPC_ERROR_NONE; - const char* service_config_json = - GetParam().enable_load_reporting() - ? kDefaultServiceConfig_ - : kDefaultServiceConfigWithoutLoadReporting_; - result.service_config = - grpc_core::ServiceConfig::Create(service_config_json, &error); - GRPC_ERROR_UNREF(error); + if (service_config_json != nullptr) { + grpc_error* error = GRPC_ERROR_NONE; + result.service_config = + grpc_core::ServiceConfig::Create(service_config_json, &error); + GRPC_ERROR_UNREF(error); + } grpc_arg arg = grpc_core::FakeResolverResponseGenerator::MakeChannelArg( lb_channel_response_generator == nullptr ? lb_channel_response_generator_.get() @@ -1000,21 +968,11 @@ class XdsEnd2endTest : public ::testing::TestWithParam { lb_channel_response_generator_; const grpc::string kRequestMessage_ = "Live long and prosper."; const grpc::string kApplicationTargetName_ = "application_target_name"; - const char* kDefaultServiceConfig_ = + const grpc::string kDefaultServiceConfig_ = "{\n" " \"loadBalancingConfig\":[\n" " { \"does_not_exist\":{} },\n" - " { \"xds_experimental\":{\n" - " \"lrsLoadReportingServerName\": \"\"\n" - " } }\n" - " ]\n" - "}"; - const char* kDefaultServiceConfigWithoutLoadReporting_ = - "{\n" - " \"loadBalancingConfig\":[\n" - " { \"does_not_exist\":{} },\n" - " { \"xds_experimental\":{\n" - " } }\n" + " { \"xds_experimental\":{} }\n" " ]\n" "}"; }; @@ -1027,7 +985,7 @@ class BasicTest : public XdsEnd2endTest { // Tests that the balancer sends the correct response to the client, and the // client sends RPCs to the backends using the default child policy. TEST_P(BasicTest, Vanilla) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcsPerAddress = 100; AdsServiceImpl::ResponseArgs args({ @@ -1052,40 +1010,10 @@ TEST_P(BasicTest, Vanilla) { EXPECT_EQ("xds_experimental", channel_->GetLoadBalancingPolicyName()); } -TEST_P(BasicTest, IgnoresUnhealthyEndpoints) { - SetNextResolution({}); - SetNextResolutionForLbChannelAllBalancers(); - const size_t kNumRpcsPerAddress = 100; - AdsServiceImpl::ResponseArgs args({ - {"locality0", - GetBackendPorts(), - kDefaultLocalityWeight, - kDefaultLocalityPriority, - {envoy::api::v2::HealthStatus::DRAINING}}, - }); - ScheduleResponseForBalancer(0, AdsServiceImpl::BuildResponse(args), 0); - // Make sure that trying to connect works without a call. - channel_->GetState(true /* try_to_connect */); - // We need to wait for all backends to come online. - WaitForAllBackends(/*start_index=*/1); - // Send kNumRpcsPerAddress RPCs per server. - CheckRpcSendOk(kNumRpcsPerAddress * (num_backends_ - 1)); - // Each backend should have gotten 100 requests. - for (size_t i = 1; i < backends_.size(); ++i) { - EXPECT_EQ(kNumRpcsPerAddress, - backends_[i]->backend_service()->request_count()); - } - // The ADS service got a single request, and sent a single response. - EXPECT_EQ(1U, balancers_[0]->ads_service()->request_count()); - EXPECT_EQ(1U, balancers_[0]->ads_service()->response_count()); - // Check LB policy name for the channel. - EXPECT_EQ("xds_experimental", channel_->GetLoadBalancingPolicyName()); -} - // Tests that subchannel sharing works when the same backend is listed multiple // times. TEST_P(BasicTest, SameBackendListedMultipleTimes) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Same backend listed twice. std::vector ports(2, backends_[0]->port()); @@ -1108,7 +1036,7 @@ TEST_P(BasicTest, SameBackendListedMultipleTimes) { // Tests that RPCs will be blocked until a non-empty serverlist is received. TEST_P(BasicTest, InitiallyEmptyServerlist) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const int kServerlistDelayMs = 500 * grpc_test_slowdown_factor(); const int kCallDeadlineMs = kServerlistDelayMs * 2; @@ -1144,7 +1072,7 @@ TEST_P(BasicTest, InitiallyEmptyServerlist) { // Tests that RPCs will fail with UNAVAILABLE instead of DEADLINE_EXCEEDED if // all the servers are unreachable. TEST_P(BasicTest, AllServersUnreachableFailFast) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumUnreachableServers = 5; std::vector ports; @@ -1166,7 +1094,7 @@ TEST_P(BasicTest, AllServersUnreachableFailFast) { // Tests that RPCs fail when the backends are down, and will succeed again after // the backends are restarted. TEST_P(BasicTest, BackendsRestart) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); AdsServiceImpl::ResponseArgs args({ {"locality0", GetBackendPorts()}, @@ -1188,7 +1116,7 @@ using SecureNamingTest = BasicTest; TEST_P(SecureNamingTest, TargetNameIsExpected) { // TODO(juanlishen): Use separate fake creds for the balancer channel. ResetStub(0, 0, kApplicationTargetName_ + ";lb"); - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({balancers_[0]->port()}); const size_t kNumRpcsPerAddress = 100; AdsServiceImpl::ResponseArgs args({ @@ -1220,7 +1148,7 @@ TEST_P(SecureNamingTest, TargetNameIsUnexpected) { ASSERT_DEATH_IF_SUPPORTED( { ResetStub(0, 0, kApplicationTargetName_ + ";lb"); - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({balancers_[0]->port()}); channel_->WaitForConnected(grpc_timeout_seconds_to_deadline(1)); }, @@ -1232,7 +1160,7 @@ using LocalityMapTest = BasicTest; // Tests that the localities in a locality map are picked according to their // weights. TEST_P(LocalityMapTest, WeightedRoundRobin) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 5000; const int kLocalityWeight0 = 2; @@ -1276,7 +1204,7 @@ TEST_P(LocalityMapTest, WeightedRoundRobin) { // Tests that the locality map can work properly even when it contains a large // number of localities. TEST_P(LocalityMapTest, StressTest) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumLocalities = 100; // The first ADS response contains kNumLocalities localities, each of which @@ -1311,7 +1239,7 @@ TEST_P(LocalityMapTest, StressTest) { // Tests that the localities in a locality map are picked correctly after update // (addition, modification, deletion). TEST_P(LocalityMapTest, UpdateMap) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 1000; // The locality weight for the first 3 localities. @@ -1408,7 +1336,7 @@ class FailoverTest : public BasicTest { // Localities with the highest priority are used when multiple priority exist. TEST_P(FailoverTest, ChooseHighestPriority) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); AdsServiceImpl::ResponseArgs args({ {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 1}, @@ -1429,7 +1357,7 @@ TEST_P(FailoverTest, ChooseHighestPriority) { // If the higher priority localities are not reachable, failover to the highest // priority among the rest. TEST_P(FailoverTest, Failover) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); AdsServiceImpl::ResponseArgs args({ {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 1}, @@ -1453,7 +1381,7 @@ TEST_P(FailoverTest, Failover) { // If a locality with higher priority than the current one becomes ready, // switch to it. TEST_P(FailoverTest, SwitchBackToHigherPriority) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 100; AdsServiceImpl::ResponseArgs args({ @@ -1482,7 +1410,7 @@ TEST_P(FailoverTest, SwitchBackToHigherPriority) { // The first update only contains unavailable priorities. The second update // contains available priorities. TEST_P(FailoverTest, UpdateInitialUnavailable) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); AdsServiceImpl::ResponseArgs args({ {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 0}, @@ -1517,7 +1445,7 @@ TEST_P(FailoverTest, UpdateInitialUnavailable) { // Tests that after the localities' priorities are updated, we still choose the // highest READY priority with the updated localities. TEST_P(FailoverTest, UpdatePriority) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 100; AdsServiceImpl::ResponseArgs args({ @@ -1550,7 +1478,7 @@ using DropTest = BasicTest; // Tests that RPCs are dropped according to the drop config. TEST_P(DropTest, Vanilla) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 5000; const uint32_t kDropPerMillionForLb = 100000; @@ -1596,7 +1524,7 @@ TEST_P(DropTest, Vanilla) { // Tests that drop config is converted correctly from per hundred. TEST_P(DropTest, DropPerHundred) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 5000; const uint32_t kDropPerHundredForLb = 10; @@ -1637,7 +1565,7 @@ TEST_P(DropTest, DropPerHundred) { // Tests that drop config is converted correctly from per ten thousand. TEST_P(DropTest, DropPerTenThousand) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 5000; const uint32_t kDropPerTenThousandForLb = 1000; @@ -1678,7 +1606,7 @@ TEST_P(DropTest, DropPerTenThousand) { // Tests that drop is working correctly after update. TEST_P(DropTest, Update) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 1000; const uint32_t kDropPerMillionForLb = 100000; @@ -1774,7 +1702,7 @@ TEST_P(DropTest, Update) { // Tests that all the RPCs are dropped if any drop category drops 100%. TEST_P(DropTest, DropAll) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 1000; const uint32_t kDropPerMillionForLb = 100000; @@ -1807,7 +1735,8 @@ TEST_P(FallbackTest, Vanilla) { const int kServerlistDelayMs = 500 * grpc_test_slowdown_factor(); const size_t kNumBackendsInResolution = backends_.size() / 2; ResetStub(kFallbackTimeoutMs); - SetNextResolution(GetBackendPorts(0, kNumBackendsInResolution)); + SetNextResolution(GetBackendPorts(0, kNumBackendsInResolution), + kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Send non-empty serverlist only after kServerlistDelayMs. AdsServiceImpl::ResponseArgs args({ @@ -1856,7 +1785,8 @@ TEST_P(FallbackTest, Update) { const size_t kNumBackendsInResolution = backends_.size() / 3; const size_t kNumBackendsInResolutionUpdate = backends_.size() / 3; ResetStub(kFallbackTimeoutMs); - SetNextResolution(GetBackendPorts(0, kNumBackendsInResolution)); + SetNextResolution(GetBackendPorts(0, kNumBackendsInResolution), + kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Send non-empty serverlist only after kServerlistDelayMs. AdsServiceImpl::ResponseArgs args({ @@ -1879,9 +1809,10 @@ TEST_P(FallbackTest, Update) { for (size_t i = kNumBackendsInResolution; i < backends_.size(); ++i) { EXPECT_EQ(0U, backends_[i]->backend_service()->request_count()); } - SetNextResolution(GetBackendPorts( - kNumBackendsInResolution, - kNumBackendsInResolution + kNumBackendsInResolutionUpdate)); + SetNextResolution(GetBackendPorts(kNumBackendsInResolution, + kNumBackendsInResolution + + kNumBackendsInResolutionUpdate), + kDefaultServiceConfig_.c_str()); // Wait until the resolution update has been processed and all the new // fallback backends are reachable. WaitForAllBackends(kNumBackendsInResolution /* start_index */, @@ -1931,7 +1862,7 @@ TEST_P(FallbackTest, FallbackEarlyWhenBalancerChannelFails) { const int kFallbackTimeoutMs = 10000 * grpc_test_slowdown_factor(); ResetStub(kFallbackTimeoutMs); // Return an unreachable balancer and one fallback backend. - SetNextResolution({backends_[0]->port()}); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({grpc_pick_unused_port_or_die()}); // Send RPC with deadline less than the fallback timeout and make sure it // succeeds. @@ -1944,7 +1875,7 @@ TEST_P(FallbackTest, FallbackEarlyWhenBalancerCallFails) { const int kFallbackTimeoutMs = 10000 * grpc_test_slowdown_factor(); ResetStub(kFallbackTimeoutMs); // Return one balancer and one fallback backend. - SetNextResolution({backends_[0]->port()}); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Balancer drops call without sending a serverlist. balancers_[0]->ads_service()->NotifyDoneWithAdsCall(); @@ -1959,7 +1890,7 @@ TEST_P(FallbackTest, FallbackEarlyWhenBalancerCallFails) { TEST_P(FallbackTest, FallbackIfResponseReceivedButChildNotReady) { const int kFallbackTimeoutMs = 500 * grpc_test_slowdown_factor(); ResetStub(kFallbackTimeoutMs); - SetNextResolution({backends_[0]->port()}); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Send a serverlist that only contains an unreachable backend before fallback // timeout. @@ -1976,7 +1907,7 @@ TEST_P(FallbackTest, FallbackIfResponseReceivedButChildNotReady) { // all the calls. TEST_P(FallbackTest, FallbackModeIsExitedWhenBalancerSaysToDropAllCalls) { // Return an unreachable balancer and one fallback backend. - SetNextResolution({backends_[0]->port()}); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({grpc_pick_unused_port_or_die()}); // Enter fallback mode because the LB channel fails to connect. WaitForBackend(0); @@ -2000,7 +1931,7 @@ TEST_P(FallbackTest, FallbackModeIsExitedWhenBalancerSaysToDropAllCalls) { // Tests that fallback mode is exited if the child policy becomes ready. TEST_P(FallbackTest, FallbackModeIsExitedAfterChildRready) { // Return an unreachable balancer and one fallback backend. - SetNextResolution({backends_[0]->port()}); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({grpc_pick_unused_port_or_die()}); // Enter fallback mode because the LB channel fails to connect. WaitForBackend(0); @@ -2038,7 +1969,7 @@ class BalancerUpdateTest : public XdsEnd2endTest { // Tests that the old LB call is still used after the balancer address update as // long as that call is still alive. TEST_P(BalancerUpdateTest, UpdateBalancersButKeepUsingOriginalBalancer) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); AdsServiceImpl::ResponseArgs args({ {"locality0", {backends_[0]->port()}}, @@ -2091,7 +2022,7 @@ TEST_P(BalancerUpdateTest, UpdateBalancersButKeepUsingOriginalBalancer) { // xds keeps the initial connection (which by definition is also present in the // update). TEST_P(BalancerUpdateTest, Repeated) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); AdsServiceImpl::ResponseArgs args({ {"locality0", {backends_[0]->port()}}, @@ -2156,7 +2087,7 @@ TEST_P(BalancerUpdateTest, Repeated) { // backends according to the last balancer response, until a new balancer is // reachable. TEST_P(BalancerUpdateTest, DeadUpdate) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({balancers_[0]->port()}); AdsServiceImpl::ResponseArgs args({ {"locality0", {backends_[0]->port()}}, @@ -2235,7 +2166,7 @@ class ClientLoadReportingTest : public XdsEnd2endTest { // Tests that the load report received at the balancer is correct. TEST_P(ClientLoadReportingTest, Vanilla) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({balancers_[0]->port()}); const size_t kNumRpcsPerAddress = 100; // TODO(juanlishen): Partition the backends after multiple localities is @@ -2276,7 +2207,7 @@ TEST_P(ClientLoadReportingTest, Vanilla) { // Tests that if the balancer restarts, the client load report contains the // stats before and after the restart correctly. TEST_P(ClientLoadReportingTest, BalancerRestart) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({balancers_[0]->port()}); const size_t kNumBackendsFirstPass = backends_.size() / 2; const size_t kNumBackendsSecondPass = @@ -2342,7 +2273,7 @@ class ClientLoadReportingWithDropTest : public XdsEnd2endTest { // Tests that the drop stats are correctly reported by client load reporting. TEST_P(ClientLoadReportingWithDropTest, Vanilla) { - SetNextResolution({}); + SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcs = 3000; const uint32_t kDropPerMillionForLb = 100000; @@ -2404,66 +2335,35 @@ TEST_P(ClientLoadReportingWithDropTest, Vanilla) { EXPECT_EQ(1U, balancers_[0]->ads_service()->response_count()); } -grpc::string TestTypeName(const ::testing::TestParamInfo& info) { - return info.param.AsString(); -} +INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, BasicTest, ::testing::Bool()); + +INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, SecureNamingTest, ::testing::Bool()); + +INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, LocalityMapTest, ::testing::Bool()); + +INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, FailoverTest, ::testing::Bool()); -// TODO(juanlishen): Load reporting disabled is currently tested only with DNS -// resolver. Once we implement CDS, test it via the xds resolver too. - -INSTANTIATE_TEST_SUITE_P(XdsTest, BasicTest, - ::testing::Values(TestType(false, true), - TestType(false, false), - TestType(true, true)), - &TestTypeName); - -INSTANTIATE_TEST_SUITE_P(XdsTest, SecureNamingTest, - ::testing::Values(TestType(false, true), - TestType(false, false), - TestType(true, true)), - &TestTypeName); - -INSTANTIATE_TEST_SUITE_P(XdsTest, LocalityMapTest, - ::testing::Values(TestType(false, true), - TestType(false, false), - TestType(true, true)), - &TestTypeName); - -INSTANTIATE_TEST_SUITE_P(XdsTest, FailoverTest, - ::testing::Values(TestType(false, true), - TestType(false, false), - TestType(true, true)), - &TestTypeName); - -INSTANTIATE_TEST_SUITE_P(XdsTest, DropTest, - ::testing::Values(TestType(false, true), - TestType(false, false), - TestType(true, true)), - &TestTypeName); +// Comment out this test suite because the ports size too large, should be less +// than 200. +// INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, DropTest, ::testing::Bool()); // Fallback does not work with xds resolver. -INSTANTIATE_TEST_SUITE_P(XdsTest, FallbackTest, - ::testing::Values(TestType(false, true), - TestType(false, false)), - &TestTypeName); - -INSTANTIATE_TEST_SUITE_P(XdsTest, BalancerUpdateTest, - ::testing::Values(TestType(false, true), - TestType(false, false), - TestType(true, true)), - &TestTypeName); - -// Load reporting tests are not run with load reporting disabled. -INSTANTIATE_TEST_SUITE_P(XdsTest, ClientLoadReportingTest, - ::testing::Values(TestType(false, true), - TestType(true, true)), - &TestTypeName); - -// Load reporting tests are not run with load reporting disabled. -INSTANTIATE_TEST_SUITE_P(XdsTest, ClientLoadReportingWithDropTest, - ::testing::Values(TestType(false, true), - TestType(true, true)), - &TestTypeName); +INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, FallbackTest, + ::testing::Values(false)); +// Comment out this test suite because the ports size too large, should be less +// than 200. +// INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, BalancerUpdateTest, +// ::testing::Bool()); + +// Comment out this test suite because the ports size too large, should be less +// than 200. +// INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, ClientLoadReportingTest, +// ::testing::Bool()); + +// Comment out this test suite because the ports size too large, should be less +// than 200. +// INSTANTIATE_TEST_SUITE_P(UsesXdsResolver, ClientLoadReportingWithDropTest, +// ::testing::Bool()); } // namespace } // namespace testing diff --git a/test/cpp/interop/client_helper.h b/test/cpp/interop/client_helper.h index 4afce27470b..e0bb6eacd90 100644 --- a/test/cpp/interop/client_helper.h +++ b/test/cpp/interop/client_helper.h @@ -92,7 +92,7 @@ class AdditionalMetadataInterceptorFactory : additional_metadata_(std::move(additional_metadata)) {} experimental::Interceptor* CreateClientInterceptor( - experimental::ClientRpcInfo* info) override { + experimental::ClientRpcInfo* /*info*/) override { return new AdditionalMetadataInterceptor(additional_metadata_); } diff --git a/test/cpp/microbenchmarks/callback_test_service.cc b/test/cpp/microbenchmarks/callback_test_service.cc index 321a5b39184..a8829914bc6 100644 --- a/test/cpp/microbenchmarks/callback_test_service.cc +++ b/test/cpp/microbenchmarks/callback_test_service.cc @@ -47,7 +47,8 @@ int GetIntValueFromMetadata( } // namespace void CallbackStreamingTestService::Echo( - ServerContext* context, const EchoRequest* request, EchoResponse* response, + ServerContext* context, const EchoRequest* /*request*/, + EchoResponse* response, experimental::ServerCallbackRpcController* controller) { int response_msgs_size = GetIntValueFromMetadata( kServerMessageSize, context->client_metadata(), 0); diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc index 7d78e21aef7..98c6c73338d 100644 --- a/test/cpp/microbenchmarks/helpers.cc +++ b/test/cpp/microbenchmarks/helpers.cc @@ -64,6 +64,10 @@ void TrackCounters::AddLabel(const grpc::string& label) { } void TrackCounters::AddToLabel(std::ostream& out, benchmark::State& state) { + // Use the parameters to avoid unused-parameter warnings depending on the + // #define's present + (void)out; + (void)state; #ifdef GRPC_COLLECT_STATS grpc_stats_data stats_end; grpc_stats_collect(&stats_end); diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index ceb5cdd710d..7518a8b028d 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -54,7 +54,7 @@ namespace testing { template class ClientRequestCreator { public: - ClientRequestCreator(RequestType* req, const PayloadConfig&) { + ClientRequestCreator(RequestType* /*req*/, const PayloadConfig&) { // this template must be specialized // fail with an assertion rather than a compile-time // check since these only happen at the beginning anyway diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc index bb0992e3fd8..78dae6207e0 100644 --- a/test/cpp/qps/qps_worker.cc +++ b/test/cpp/qps/qps_worker.cc @@ -191,7 +191,7 @@ class WorkerServiceImpl final : public WorkerService::Service { return Status(StatusCode::INVALID_ARGUMENT, "Invalid setup arg"); } gpr_log(GPR_INFO, "RunClientBody: about to create client"); - auto client = CreateClient(args.setup()); + std::unique_ptr client = CreateClient(args.setup()); if (!client) { return Status(StatusCode::INVALID_ARGUMENT, "Couldn't create client"); } @@ -234,7 +234,7 @@ class WorkerServiceImpl final : public WorkerService::Service { args.mutable_setup()->set_port(server_port_); } gpr_log(GPR_INFO, "RunServerBody: about to create server"); - auto server = CreateServer(args.setup()); + std::unique_ptr server = CreateServer(args.setup()); if (g_inproc_servers != nullptr) { g_inproc_servers->push_back(server.get()); } diff --git a/test/cpp/qps/usage_timer.cc b/test/cpp/qps/usage_timer.cc index f0d15a70af8..29a6aaabd33 100644 --- a/test/cpp/qps/usage_timer.cc +++ b/test/cpp/qps/usage_timer.cc @@ -69,6 +69,9 @@ static void get_cpu_usage(unsigned long long* total_cpu_time, } } #else + // Use the parameters to avoid unused-parameter warning + (void)total_cpu_time; + (void)idle_cpu_time; gpr_log(GPR_INFO, "get_cpu_usage(): Non-linux platform is not supported."); #endif } diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc index 5c32198bc3a..a46a39c87c1 100644 --- a/test/cpp/util/create_test_channel.cc +++ b/test/cpp/util/create_test_channel.cc @@ -33,7 +33,7 @@ const char kProdTlsCredentialsType[] = "prod_ssl"; class SslCredentialProvider : public testing::CredentialTypeProvider { public: std::shared_ptr GetChannelCredentials( - grpc::ChannelArguments* args) override { + grpc::ChannelArguments* /*args*/) override { return grpc::SslCredentials(SslCredentialsOptions()); } std::shared_ptr GetServerCredentials() override { diff --git a/test/distrib/cpp/run_distrib_test_cmake.sh b/test/distrib/cpp/run_distrib_test_cmake.sh index f3362f1cee7..a73cbdf1f0b 100755 --- a/test/distrib/cpp/run_distrib_test_cmake.sh +++ b/test/distrib/cpp/run_distrib_test_cmake.sh @@ -52,6 +52,11 @@ make -j4 install cd ../../../.. rm -rf third_party/protobuf # wipe out to prevent influencing the grpc build +# Just before installing gRPC, wipe out contents of all the submodules to simulate +# a standalone build from an archive +# shellcheck disable=SC2016 +git submodule foreach 'cd $toplevel; rm -rf $name' + # Install gRPC mkdir -p cmake/build cd cmake/build diff --git a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh index cf3b4dc7291..e78b1997cf7 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh @@ -52,6 +52,11 @@ make -j4 install cd ../../../.. rm -rf third_party/protobuf # wipe out to prevent influencing the grpc build +# Just before installing gRPC, wipe out contents of all the submodules to simulate +# a standalone build from an archive +# shellcheck disable=SC2016 +git submodule foreach 'cd $toplevel; rm -rf $name' + # Install gRPC mkdir -p cmake/build cd cmake/build diff --git a/third_party/rake-compiler-dock/Dockerfile b/third_party/rake-compiler-dock/Dockerfile index 44eddc82e80..e2a721c7362 100644 --- a/third_party/rake-compiler-dock/Dockerfile +++ b/third_party/rake-compiler-dock/Dockerfile @@ -1,4 +1,4 @@ -FROM larskanis/rake-compiler-dock-mri:0.7.0 +FROM larskanis/rake-compiler-dock-mri:0.7.2 RUN find / -name rbconfig.rb | while read f ; do sed -i 's/0x0501/0x0600/' $f ; done RUN find / -name win32.h | while read f ; do sed -i 's/gettimeofday/rb_gettimeofday/' $f ; done @@ -7,4 +7,8 @@ RUN find / -name libwinpthread-1.dll | xargs rm RUN find / -name *msvcrt-ruby*.dll.a | while read f ; do n=`echo $f | sed s/.dll//` ; mv $f $n ; done RUN apt-get install -y g++-multilib +# Make the system to have GLIBC 2.12 instead of 2.23 so that +# generated ruby package can run on CentOS 6 with GLIBC 2.12 +RUN sed -i 's/__GLIBC_MINOR__\t23/__GLIBC_MINOR__\t12/' /usr/include/features.h + CMD bash diff --git a/third_party/toolchains/bazel_0.23.2_rbe_windows/BUILD b/third_party/toolchains/bazel_0.23.2_rbe_windows/BUILD deleted file mode 100644 index 5ce4e00c866..00000000000 --- a/third_party/toolchains/bazel_0.23.2_rbe_windows/BUILD +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -# This becomes the BUILD file for @local_config_cc// under Windows. -licenses(["notice"]) # Apache v2 - -package(default_visibility = ["//visibility:public"]) - -load(":cc_toolchain_config.bzl", "cc_toolchain_config") - -cc_library( - name = "malloc", -) - -filegroup( - name = "empty", - srcs = [], -) - -# Hardcoded toolchain, legacy behaviour. -cc_toolchain_suite( - name = "toolchain", - toolchains = { - "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a", - "x64_windows|msvc-cl": ":cc-compiler-x64_windows", - "x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys", - "x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw", - "x64_windows_msys": ":cc-compiler-x64_windows_msys", - "x64_windows": ":cc-compiler-x64_windows", - "armeabi-v7a": ":cc-compiler-armeabi-v7a", - }, -) - -cc_toolchain( - name = "cc-compiler-x64_windows_msys", - all_files = ":empty", - ar_files = ":empty", - as_files = ":empty", - compiler_files = ":empty", - dwp_files = ":empty", - linker_files = ":empty", - objcopy_files = ":empty", - strip_files = ":empty", - supports_param_files = 1, - toolchain_config = ":msys_x64", - toolchain_identifier = "msys_x64", -) - -cc_toolchain_config( - name = "msys_x64", - compiler = "msys-gcc", - cpu = "x64_windows", -) - -toolchain( - name = "cc-toolchain-x64_windows_msys", - exec_compatible_with = [ - "@bazel_tools//platforms:x86_64", - "@bazel_tools//platforms:windows", - "@bazel_tools//tools/cpp:msys", - ], - target_compatible_with = [ - "@bazel_tools//platforms:x86_64", - "@bazel_tools//platforms:windows", - ], - toolchain = ":cc-compiler-x64_windows_msys", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", -) - -cc_toolchain( - name = "cc-compiler-x64_windows_mingw", - all_files = ":empty", - ar_files = ":empty", - as_files = ":empty", - compiler_files = ":empty", - dwp_files = ":empty", - linker_files = ":empty", - objcopy_files = ":empty", - strip_files = ":empty", - supports_param_files = 0, - toolchain_config = ":msys_x64_mingw", - toolchain_identifier = "msys_x64_mingw", -) - -cc_toolchain_config( - name = "msys_x64_mingw", - compiler = "mingw-gcc", - cpu = "x64_windows", -) - -toolchain( - name = "cc-toolchain-x64_windows_mingw", - exec_compatible_with = [ - "@bazel_tools//platforms:x86_64", - "@bazel_tools//platforms:windows", - "@bazel_tools//tools/cpp:mingw", - ], - target_compatible_with = [ - "@bazel_tools//platforms:x86_64", - "@bazel_tools//platforms:windows", - ], - toolchain = ":cc-compiler-x64_windows_mingw", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", -) - -cc_toolchain( - name = "cc-compiler-x64_windows", - all_files = ":empty", - ar_files = ":empty", - as_files = ":empty", - compiler_files = ":empty", - dwp_files = ":empty", - linker_files = ":empty", - objcopy_files = ":empty", - strip_files = ":empty", - supports_param_files = 1, - toolchain_config = ":msvc_x64", - toolchain_identifier = "msvc_x64", -) - -cc_toolchain_config( - name = "msvc_x64", - compiler = "msvc-cl", - cpu = "x64_windows", -) - -toolchain( - name = "cc-toolchain-x64_windows", - exec_compatible_with = [ - "@bazel_tools//platforms:x86_64", - "@bazel_tools//platforms:windows", - ], - target_compatible_with = [ - "@bazel_tools//platforms:x86_64", - "@bazel_tools//platforms:windows", - ], - toolchain = ":cc-compiler-x64_windows", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", -) - -cc_toolchain( - name = "cc-compiler-armeabi-v7a", - all_files = ":empty", - ar_files = ":empty", - as_files = ":empty", - compiler_files = ":empty", - dwp_files = ":empty", - linker_files = ":empty", - objcopy_files = ":empty", - strip_files = ":empty", - supports_param_files = 1, - toolchain_config = ":stub_armeabi-v7a", - toolchain_identifier = "stub_armeabi-v7a", -) - -cc_toolchain_config( - name = "stub_armeabi-v7a", - compiler = "compiler", - cpu = "armeabi-v7a", -) - -toolchain( - name = "cc-toolchain-armeabi-v7a", - exec_compatible_with = [ - ], - target_compatible_with = [ - "@bazel_tools//platforms:arm", - "@bazel_tools//platforms:android", - ], - toolchain = ":cc-compiler-armeabi-v7a", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", -) - -filegroup( - name = "link_dynamic_library", - srcs = ["link_dynamic_library.sh"], -) diff --git a/third_party/toolchains/bazel_0.23.2_rbe_windows/cc_toolchain_config.bzl b/third_party/toolchains/bazel_0.23.2_rbe_windows/cc_toolchain_config.bzl deleted file mode 100644 index 790ddcb0947..00000000000 --- a/third_party/toolchains/bazel_0.23.2_rbe_windows/cc_toolchain_config.bzl +++ /dev/null @@ -1,1704 +0,0 @@ -# Copyright 2019 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -"""A Starlark cc_toolchain configuration rule""" - -load( - "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", - "action_config", - "artifact_name_pattern", - "env_entry", - "env_set", - "feature", - "feature_set", - "flag_group", - "flag_set", - "make_variable", - "tool", - "tool_path", - "variable_with_value", - "with_feature_set", -) -load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES") - -all_compile_actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.clif_match, - ACTION_NAMES.lto_backend, -] - -all_cpp_compile_actions = [ - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.clif_match, -] - -preprocessor_compile_actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.clif_match, -] - -codegen_compile_actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, -] - -all_link_actions = [ - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, -] - -def _windows_msvc_impl(ctx): - toolchain_identifier = "msvc_x64" - host_system_name = "local" - target_system_name = "local" - target_cpu = "x64_windows" - target_libc = "msvcrt" - compiler = "msvc-cl" - abi_version = "local" - abi_libc_version = "local" - cc_target_os = None - builtin_sysroot = None - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - "c:/tools/msys64/usr/", - "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt", - ] - - cpp_link_nodeps_dynamic_library_action = action_config( - action_name = ACTION_NAMES.cpp_link_nodeps_dynamic_library, - implies = [ - "nologo", - "shared_flag", - "linkstamps", - "output_execpath_flags", - "input_param_flags", - "user_link_flags", - "default_link_flags", - "linker_subsystem_flag", - "linker_param_file", - "msvc_env", - "no_stripping", - "has_configured_linker_path", - "def_file", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe")], - ) - - cpp_link_static_library_action = action_config( - action_name = ACTION_NAMES.cpp_link_static_library, - implies = [ - "nologo", - "archiver_flags", - "input_param_flags", - "linker_param_file", - "msvc_env", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/lib.exe")], - ) - - assemble_action = action_config( - action_name = ACTION_NAMES.assemble, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "nologo", - "msvc_env", - "sysroot", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/ml64.exe")], - ) - - preprocess_assemble_action = action_config( - action_name = ACTION_NAMES.preprocess_assemble, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "nologo", - "msvc_env", - "sysroot", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/ml64.exe")], - ) - - c_compile_action = action_config( - action_name = ACTION_NAMES.c_compile, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "default_compile_flags", - "nologo", - "msvc_env", - "parse_showincludes", - "user_compile_flags", - "sysroot", - "unfiltered_compile_flags", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe")], - ) - - cpp_compile_action = action_config( - action_name = ACTION_NAMES.cpp_compile, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "default_compile_flags", - "nologo", - "msvc_env", - "parse_showincludes", - "user_compile_flags", - "sysroot", - "unfiltered_compile_flags", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe")], - ) - - cpp_link_executable_action = action_config( - action_name = ACTION_NAMES.cpp_link_executable, - implies = [ - "nologo", - "linkstamps", - "output_execpath_flags", - "input_param_flags", - "user_link_flags", - "default_link_flags", - "linker_subsystem_flag", - "linker_param_file", - "msvc_env", - "no_stripping", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe")], - ) - - cpp_link_dynamic_library_action = action_config( - action_name = ACTION_NAMES.cpp_link_dynamic_library, - implies = [ - "nologo", - "shared_flag", - "linkstamps", - "output_execpath_flags", - "input_param_flags", - "user_link_flags", - "default_link_flags", - "linker_subsystem_flag", - "linker_param_file", - "msvc_env", - "no_stripping", - "has_configured_linker_path", - "def_file", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe")], - ) - - action_configs = [ - assemble_action, - preprocess_assemble_action, - c_compile_action, - cpp_compile_action, - cpp_link_executable_action, - cpp_link_dynamic_library_action, - cpp_link_nodeps_dynamic_library_action, - cpp_link_static_library_action, - ] - - msvc_link_env_feature = feature( - name = "msvc_link_env", - env_sets = [ - env_set( - actions = all_link_actions + - [ACTION_NAMES.cpp_link_static_library], - env_entries = [env_entry(key = "LIB", value = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\LIB\\amd64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.10240.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x64;")], - ), - ], - ) - - shared_flag_feature = feature( - name = "shared_flag", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [flag_group(flags = ["/DLL"])], - ), - ], - ) - - determinism_feature = feature( - name = "determinism", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [ - flag_group( - flags = [ - "/wd4117", - "-D__DATE__=\"redacted\"", - "-D__TIMESTAMP__=\"redacted\"", - "-D__TIME__=\"redacted\"", - ], - ), - ], - ), - ], - ) - - sysroot_feature = feature( - name = "sysroot", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [ - flag_group( - flags = ["--sysroot=%{sysroot}"], - iterate_over = "sysroot", - expand_if_available = "sysroot", - ), - ], - ), - ], - ) - - unfiltered_compile_flags_feature = feature( - name = "unfiltered_compile_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flags = ["%{unfiltered_compile_flags}"], - iterate_over = "unfiltered_compile_flags", - expand_if_available = "unfiltered_compile_flags", - ), - ], - ), - ], - ) - - copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary") - - input_param_flags_feature = feature( - name = "input_param_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [ - flag_group( - flags = ["/IMPLIB:%{interface_library_output_path}"], - expand_if_available = "interface_library_output_path", - ), - ], - ), - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["%{libopts}"], - iterate_over = "libopts", - expand_if_available = "libopts", - ), - ], - ), - flag_set( - actions = all_link_actions + - [ACTION_NAMES.cpp_link_static_library], - flag_groups = [ - flag_group( - iterate_over = "libraries_to_link", - flag_groups = [ - flag_group( - iterate_over = "libraries_to_link.object_files", - flag_groups = [flag_group(flags = ["%{libraries_to_link.object_files}"])], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "object_file_group", - ), - ), - flag_group( - flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "object_file", - ), - ), - flag_group( - flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "interface_library", - ), - ), - flag_group( - flag_groups = [ - flag_group( - flags = ["%{libraries_to_link.name}"], - expand_if_false = "libraries_to_link.is_whole_archive", - ), - flag_group( - flags = ["/WHOLEARCHIVE:%{libraries_to_link.name}"], - expand_if_true = "libraries_to_link.is_whole_archive", - ), - ], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "static_library", - ), - ), - ], - expand_if_available = "libraries_to_link", - ), - ], - ), - ], - ) - - fastbuild_feature = feature( - name = "fastbuild", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Od", "/Z7"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/DEBUG:FASTLINK", "/INCREMENTAL:NO"], - ), - ], - ), - ], - implies = ["generate_pdb_file"], - ) - - user_compile_flags_feature = feature( - name = "user_compile_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flags = ["%{user_compile_flags}"], - iterate_over = "user_compile_flags", - expand_if_available = "user_compile_flags", - ), - ], - ), - ], - ) - - archiver_flags_feature = feature( - name = "archiver_flags", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.cpp_link_static_library], - flag_groups = [ - flag_group( - flags = ["/OUT:%{output_execpath}"], - expand_if_available = "output_execpath", - ), - ], - ), - ], - ) - - default_link_flags_feature = feature( - name = "default_link_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/MACHINE:X64"])], - ), - ], - ) - - static_link_msvcrt_feature = feature(name = "static_link_msvcrt") - - dynamic_link_msvcrt_debug_feature = feature( - name = "dynamic_link_msvcrt_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MDd"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrtd.lib"])], - ), - ], - requires = [feature_set(features = ["dbg"])], - ) - - dbg_feature = feature( - name = "dbg", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Od", "/Z7"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/DEBUG:FULL", "/INCREMENTAL:NO"], - ), - ], - ), - ], - implies = ["generate_pdb_file"], - ) - - opt_feature = feature( - name = "opt", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/O2"])], - ), - ], - implies = ["frame_pointer"], - ) - - supports_interface_shared_libraries_feature = feature( - name = "supports_interface_shared_libraries", - enabled = True, - ) - - user_link_flags_feature = feature( - name = "user_link_flags", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["%{user_link_flags}"], - iterate_over = "user_link_flags", - expand_if_available = "user_link_flags", - ), - ], - ), - ], - ) - - default_compile_flags_feature = feature( - name = "default_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = [ - flag_group( - flags = [ - "/DCOMPILER_MSVC", - "/DNOMINMAX", - "/D_WIN32_WINNT=0x0601", - "/D_CRT_SECURE_NO_DEPRECATE", - "/D_CRT_SECURE_NO_WARNINGS", - "/bigobj", - "/Zm500", - "/EHsc", - "/wd4351", - "/wd4291", - "/wd4250", - "/wd4996", - ], - ), - ], - ), - ], - ) - - msvc_compile_env_feature = feature( - name = "msvc_compile_env", - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ], - env_entries = [env_entry(key = "INCLUDE", value = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt;")], - ), - ], - ) - - preprocessor_defines_feature = feature( - name = "preprocessor_defines", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ], - flag_groups = [ - flag_group( - flags = ["/D%{preprocessor_defines}"], - iterate_over = "preprocessor_defines", - ), - ], - ), - ], - ) - - generate_pdb_file_feature = feature( - name = "generate_pdb_file", - requires = [ - feature_set(features = ["dbg"]), - feature_set(features = ["fastbuild"]), - ], - ) - - output_execpath_flags_feature = feature( - name = "output_execpath_flags", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/OUT:%{output_execpath}"], - expand_if_available = "output_execpath", - ), - ], - ), - ], - ) - - dynamic_link_msvcrt_no_debug_feature = feature( - name = "dynamic_link_msvcrt_no_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MD"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrt.lib"])], - ), - ], - requires = [ - feature_set(features = ["fastbuild"]), - feature_set(features = ["opt"]), - ], - ) - - disable_assertions_feature = feature( - name = "disable_assertions", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/DNDEBUG"])], - with_features = [with_feature_set(features = ["opt"])], - ), - ], - ) - - has_configured_linker_path_feature = feature(name = "has_configured_linker_path") - - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - - no_stripping_feature = feature(name = "no_stripping") - - linker_param_file_feature = feature( - name = "linker_param_file", - flag_sets = [ - flag_set( - actions = all_link_actions + - [ACTION_NAMES.cpp_link_static_library], - flag_groups = [ - flag_group( - flags = ["@%{linker_param_file}"], - expand_if_available = "linker_param_file", - ), - ], - ), - ], - ) - - ignore_noisy_warnings_feature = feature( - name = "ignore_noisy_warnings", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.cpp_link_static_library], - flag_groups = [flag_group(flags = ["/ignore:4221"])], - ), - ], - ) - - no_legacy_features_feature = feature(name = "no_legacy_features") - - parse_showincludes_feature = feature( - name = "parse_showincludes", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_header_parsing, - ], - flag_groups = [flag_group(flags = ["/showIncludes"])], - ), - ], - ) - - static_link_msvcrt_no_debug_feature = feature( - name = "static_link_msvcrt_no_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MT"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmt.lib"])], - ), - ], - requires = [ - feature_set(features = ["fastbuild"]), - feature_set(features = ["opt"]), - ], - ) - - treat_warnings_as_errors_feature = feature( - name = "treat_warnings_as_errors", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/WX"])], - ), - ], - ) - - windows_export_all_symbols_feature = feature(name = "windows_export_all_symbols") - - no_windows_export_all_symbols_feature = feature(name = "no_windows_export_all_symbols") - - include_paths_feature = feature( - name = "include_paths", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ], - flag_groups = [ - flag_group( - flags = ["/I%{quote_include_paths}"], - iterate_over = "quote_include_paths", - ), - flag_group( - flags = ["/I%{include_paths}"], - iterate_over = "include_paths", - ), - flag_group( - flags = ["/I%{system_include_paths}"], - iterate_over = "system_include_paths", - ), - ], - ), - ], - ) - - linkstamps_feature = feature( - name = "linkstamps", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["%{linkstamp_paths}"], - iterate_over = "linkstamp_paths", - expand_if_available = "linkstamp_paths", - ), - ], - ), - ], - ) - - targets_windows_feature = feature( - name = "targets_windows", - enabled = True, - implies = ["copy_dynamic_libraries_to_binary"], - ) - - linker_subsystem_flag_feature = feature( - name = "linker_subsystem_flag", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/SUBSYSTEM:CONSOLE"])], - ), - ], - ) - - static_link_msvcrt_debug_feature = feature( - name = "static_link_msvcrt_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MTd"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmtd.lib"])], - ), - ], - requires = [feature_set(features = ["dbg"])], - ) - - frame_pointer_feature = feature( - name = "frame_pointer", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Oy-"])], - ), - ], - ) - - compiler_output_flags_feature = feature( - name = "compiler_output_flags", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.assemble], - flag_groups = [ - flag_group( - flag_groups = [ - flag_group( - flags = ["/Fo%{output_file}", "/Zi"], - expand_if_available = "output_file", - expand_if_not_available = "output_assembly_file", - ), - ], - expand_if_not_available = "output_preprocess_file", - ), - ], - ), - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flag_groups = [ - flag_group( - flags = ["/Fo%{output_file}"], - expand_if_not_available = "output_preprocess_file", - ), - ], - expand_if_available = "output_file", - expand_if_not_available = "output_assembly_file", - ), - flag_group( - flag_groups = [ - flag_group( - flags = ["/Fa%{output_file}"], - expand_if_available = "output_assembly_file", - ), - ], - expand_if_available = "output_file", - ), - flag_group( - flag_groups = [ - flag_group( - flags = ["/P", "/Fi%{output_file}"], - expand_if_available = "output_preprocess_file", - ), - ], - expand_if_available = "output_file", - ), - ], - ), - ], - ) - - nologo_feature = feature( - name = "nologo", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - flag_groups = [flag_group(flags = ["/nologo"])], - ), - ], - ) - - smaller_binary_feature = feature( - name = "smaller_binary", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Gy", "/Gw"])], - with_features = [with_feature_set(features = ["opt"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/OPT:ICF", "/OPT:REF"])], - with_features = [with_feature_set(features = ["opt"])], - ), - ], - ) - - compiler_input_flags_feature = feature( - name = "compiler_input_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flags = ["/c", "%{source_file}"], - expand_if_available = "source_file", - ), - ], - ), - ], - ) - - def_file_feature = feature( - name = "def_file", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/DEF:%{def_file_path}", "/ignore:4070"], - expand_if_available = "def_file_path", - ), - ], - ), - ], - ) - - msvc_env_feature = feature( - name = "msvc_env", - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - env_entries = [ - env_entry(key = "PATH", value = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework64\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x64;C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x86;;C:\\Windows\\system32"), - env_entry(key = "TMP", value = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp"), - env_entry(key = "TEMP", value = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp"), - ], - ), - ], - implies = ["msvc_compile_env", "msvc_link_env"], - ) - - features = [ - no_legacy_features_feature, - nologo_feature, - has_configured_linker_path_feature, - no_stripping_feature, - targets_windows_feature, - copy_dynamic_libraries_to_binary_feature, - default_compile_flags_feature, - msvc_env_feature, - msvc_compile_env_feature, - msvc_link_env_feature, - include_paths_feature, - preprocessor_defines_feature, - parse_showincludes_feature, - generate_pdb_file_feature, - shared_flag_feature, - linkstamps_feature, - output_execpath_flags_feature, - archiver_flags_feature, - input_param_flags_feature, - linker_subsystem_flag_feature, - user_link_flags_feature, - default_link_flags_feature, - linker_param_file_feature, - static_link_msvcrt_feature, - static_link_msvcrt_no_debug_feature, - dynamic_link_msvcrt_no_debug_feature, - static_link_msvcrt_debug_feature, - dynamic_link_msvcrt_debug_feature, - dbg_feature, - fastbuild_feature, - opt_feature, - frame_pointer_feature, - disable_assertions_feature, - determinism_feature, - treat_warnings_as_errors_feature, - smaller_binary_feature, - ignore_noisy_warnings_feature, - user_compile_flags_feature, - sysroot_feature, - unfiltered_compile_flags_feature, - compiler_output_flags_feature, - compiler_input_flags_feature, - def_file_feature, - windows_export_all_symbols_feature, - no_windows_export_all_symbols_feature, - supports_dynamic_linker_feature, - supports_interface_shared_libraries_feature, - ] - - artifact_name_patterns = [ - artifact_name_pattern( - category_name = "object_file", - prefix = "", - extension = ".obj", - ), - artifact_name_pattern( - category_name = "static_library", - prefix = "", - extension = ".lib", - ), - artifact_name_pattern( - category_name = "alwayslink_static_library", - prefix = "", - extension = ".lo.lib", - ), - artifact_name_pattern( - category_name = "executable", - prefix = "", - extension = ".exe", - ), - artifact_name_pattern( - category_name = "dynamic_library", - prefix = "", - extension = ".dll", - ), - artifact_name_pattern( - category_name = "interface_library", - prefix = "", - extension = ".if.lib", - ), - ] - - make_variables = [] - - tool_paths = [ - tool_path(name = "ar", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/lib.exe"), - tool_path(name = "ml", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/ml64.exe"), - tool_path(name = "cpp", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe"), - tool_path(name = "gcc", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe"), - tool_path(name = "gcov", path = "wrapper/bin/msvc_nop.bat"), - tool_path(name = "ld", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe"), - tool_path(name = "nm", path = "wrapper/bin/msvc_nop.bat"), - tool_path( - name = "objcopy", - path = "wrapper/bin/msvc_nop.bat", - ), - tool_path( - name = "objdump", - path = "wrapper/bin/msvc_nop.bat", - ), - tool_path( - name = "strip", - path = "wrapper/bin/msvc_nop.bat", - ), - ] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = toolchain_identifier, - host_system_name = host_system_name, - target_system_name = target_system_name, - target_cpu = target_cpu, - target_libc = target_libc, - compiler = compiler, - abi_version = abi_version, - abi_libc_version = abi_libc_version, - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = builtin_sysroot, - cc_target_os = None, - ) - -def _windows_msys_mingw_impl(ctx): - toolchain_identifier = "msys_x64_mingw" - host_system_name = "local" - target_system_name = "local" - target_cpu = "x64_windows" - target_libc = "mingw" - compiler = "mingw-gcc" - abi_version = "local" - abi_libc_version = "local" - cc_target_os = None - builtin_sysroot = None - action_configs = [] - - targets_windows_feature = feature( - name = "targets_windows", - implies = ["copy_dynamic_libraries_to_binary"], - enabled = True, - ) - - copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary") - - gcc_env_feature = feature( - name = "gcc_env", - enabled = True, - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - env_entries = [ - env_entry(key = "PATH", value = "c:/tools/msys64/mingw64/bin"), - ], - ), - ], - ) - - msys_mingw_flags = [ - "-std=gnu++0x", - ] - msys_mingw_link_flags = [ - "-lstdc++", - ] - - default_compile_flags_feature = feature( - name = "default_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - ), - flag_set( - actions = [ - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = msys_mingw_flags)] if msys_mingw_flags else []), - ), - ], - ) - - default_link_flags_feature = feature( - name = "default_link_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = ([flag_group(flags = msys_mingw_link_flags)] if msys_mingw_link_flags else []), - ), - ], - ) - - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - - features = [ - targets_windows_feature, - copy_dynamic_libraries_to_binary_feature, - gcc_env_feature, - default_compile_flags_feature, - default_link_flags_feature, - supports_dynamic_linker_feature, - ] - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - "c:/tools/msys64/mingw64/", - "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt", - ] - - artifact_name_patterns = [ - artifact_name_pattern( - category_name = "executable", - prefix = "", - extension = ".exe", - ), - ] - - make_variables = [] - tool_paths = [ - tool_path(name = "ar", path = "c:/tools/msys64/mingw64/bin/ar"), - tool_path(name = "compat-ld", path = "c:/tools/msys64/mingw64/bin/ld"), - tool_path(name = "cpp", path = "c:/tools/msys64/mingw64/bin/cpp"), - tool_path(name = "dwp", path = "c:/tools/msys64/mingw64/bin/dwp"), - tool_path(name = "gcc", path = "c:/tools/msys64/mingw64/bin/gcc"), - tool_path(name = "gcov", path = "c:/tools/msys64/mingw64/bin/gcov"), - tool_path(name = "ld", path = "c:/tools/msys64/mingw64/bin/ld"), - tool_path(name = "nm", path = "c:/tools/msys64/mingw64/bin/nm"), - tool_path(name = "objcopy", path = "c:/tools/msys64/mingw64/bin/objcopy"), - tool_path(name = "objdump", path = "c:/tools/msys64/mingw64/bin/objdump"), - tool_path(name = "strip", path = "c:/tools/msys64/mingw64/bin/strip"), - ] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = toolchain_identifier, - host_system_name = host_system_name, - target_system_name = target_system_name, - target_cpu = target_cpu, - target_libc = target_libc, - compiler = compiler, - abi_version = abi_version, - abi_libc_version = abi_libc_version, - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = builtin_sysroot, - cc_target_os = cc_target_os, - ) - -def _armeabi_impl(ctx): - toolchain_identifier = "stub_armeabi-v7a" - host_system_name = "armeabi-v7a" - target_system_name = "armeabi-v7a" - target_cpu = "armeabi-v7a" - target_libc = "armeabi-v7a" - compiler = "compiler" - abi_version = "armeabi-v7a" - abi_libc_version = "armeabi-v7a" - cc_target_os = None - builtin_sysroot = None - action_configs = [] - - supports_pic_feature = feature(name = "supports_pic", enabled = True) - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - features = [supports_dynamic_linker_feature, supports_pic_feature] - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - ] - artifact_name_patterns = [] - make_variables = [] - - tool_paths = [ - tool_path(name = "ar", path = "/bin/false"), - tool_path(name = "compat-ld", path = "/bin/false"), - tool_path(name = "cpp", path = "/bin/false"), - tool_path(name = "dwp", path = "/bin/false"), - tool_path(name = "gcc", path = "/bin/false"), - tool_path(name = "gcov", path = "/bin/false"), - tool_path(name = "ld", path = "/bin/false"), - tool_path(name = "nm", path = "/bin/false"), - tool_path(name = "objcopy", path = "/bin/false"), - tool_path(name = "objdump", path = "/bin/false"), - tool_path(name = "strip", path = "/bin/false"), - ] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = toolchain_identifier, - host_system_name = host_system_name, - target_system_name = target_system_name, - target_cpu = target_cpu, - target_libc = target_libc, - compiler = compiler, - abi_version = abi_version, - abi_libc_version = abi_libc_version, - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = builtin_sysroot, - cc_target_os = cc_target_os, - ) - -def _impl(ctx): - if ctx.attr.cpu == "armeabi-v7a": - return _armeabi_impl(ctx) - elif ctx.attr.cpu == "x64_windows" and ctx.attr.compiler == "msvc-cl": - return _windows_msvc_impl(ctx) - elif ctx.attr.cpu == "x64_windows" and ctx.attr.compiler == "mingw-gcc": - return _windows_msys_mingw_impl(ctx) - - tool_paths = [ - tool_path(name = "ar", path = "c:/tools/msys64/usr/bin/ar"), - tool_path(name = "compat-ld", path = "c:/tools/msys64/usr/bin/ld"), - tool_path(name = "cpp", path = "c:/tools/msys64/usr/bin/cpp"), - tool_path(name = "dwp", path = "c:/tools/msys64/usr/bin/dwp"), - tool_path(name = "gcc", path = "c:/tools/msys64/usr/bin/gcc"), - tool_path(name = "gcov", path = "c:/tools/msys64/usr/bin/gcov"), - tool_path(name = "ld", path = "c:/tools/msys64/usr/bin/ld"), - tool_path(name = "nm", path = "c:/tools/msys64/usr/bin/nm"), - tool_path(name = "objcopy", path = "c:/tools/msys64/usr/bin/objcopy"), - tool_path(name = "objdump", path = "c:/tools/msys64/usr/bin/objdump"), - tool_path(name = "strip", path = "c:/tools/msys64/usr/bin/strip"), - ] - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - "c:/tools/msys64/usr/", - "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt", - ] - - action_configs = [] - - compile_flags = [ - ] - - dbg_compile_flags = [ - ] - - opt_compile_flags = [ - ] - - cxx_flags = [ - "-std=gnu++0x", - ] - - link_flags = [ - "-lstdc++", - ] - - opt_link_flags = [ - ] - - unfiltered_compile_flags = [ - ] - - targets_windows_feature = feature( - name = "targets_windows", - implies = ["copy_dynamic_libraries_to_binary"], - enabled = True, - ) - - copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary") - - gcc_env_feature = feature( - name = "gcc_env", - enabled = True, - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - env_entries = [ - env_entry(key = "PATH", value = "c:/tools/msys64/usr/bin"), - ], - ), - ], - ) - - windows_features = [ - targets_windows_feature, - copy_dynamic_libraries_to_binary_feature, - gcc_env_feature, - ] - - supports_pic_feature = feature( - name = "supports_pic", - enabled = True, - ) - supports_start_end_lib_feature = feature( - name = "supports_start_end_lib", - enabled = True, - ) - - default_compile_flags_feature = feature( - name = "default_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = compile_flags)] if compile_flags else []), - ), - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = dbg_compile_flags)] if dbg_compile_flags else []), - with_features = [with_feature_set(features = ["dbg"])], - ), - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = opt_compile_flags)] if opt_compile_flags else []), - with_features = [with_feature_set(features = ["opt"])], - ), - flag_set( - actions = [ - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = cxx_flags)] if cxx_flags else []), - ), - ], - ) - - default_link_flags_feature = feature( - name = "default_link_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = ([flag_group(flags = link_flags)] if link_flags else []), - ), - flag_set( - actions = all_link_actions, - flag_groups = ([flag_group(flags = opt_link_flags)] if opt_link_flags else []), - with_features = [with_feature_set(features = ["opt"])], - ), - ], - ) - - dbg_feature = feature(name = "dbg") - - opt_feature = feature(name = "opt") - - sysroot_feature = feature( - name = "sysroot", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [ - flag_group( - flags = ["--sysroot=%{sysroot}"], - expand_if_available = "sysroot", - ), - ], - ), - ], - ) - - fdo_optimize_feature = feature( - name = "fdo_optimize", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [ - flag_group( - flags = [ - "-fprofile-use=%{fdo_profile_path}", - "-fprofile-correction", - ], - expand_if_available = "fdo_profile_path", - ), - ], - ), - ], - provides = ["profile"], - ) - - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - - user_compile_flags_feature = feature( - name = "user_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = [ - flag_group( - flags = ["%{user_compile_flags}"], - iterate_over = "user_compile_flags", - expand_if_available = "user_compile_flags", - ), - ], - ), - ], - ) - - unfiltered_compile_flags_feature = feature( - name = "unfiltered_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = unfiltered_compile_flags)] if unfiltered_compile_flags else []), - ), - ], - ) - - features = windows_features + [ - supports_pic_feature, - default_compile_flags_feature, - default_link_flags_feature, - fdo_optimize_feature, - supports_dynamic_linker_feature, - dbg_feature, - opt_feature, - user_compile_flags_feature, - sysroot_feature, - unfiltered_compile_flags_feature, - ] - - artifact_name_patterns = [ - artifact_name_pattern(category_name = "executable", prefix = "", extension = ".exe"), - ] - - make_variables = [] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = "msys_x64", - host_system_name = "local", - target_system_name = "local", - target_cpu = "x64_windows", - target_libc = "msys", - compiler = "msys-gcc", - abi_version = "local", - abi_libc_version = "local", - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = "", - cc_target_os = None, - ) - -cc_toolchain_config = rule( - implementation = _impl, - attrs = { - "cpu": attr.string(mandatory = True), - "compiler": attr.string(), - }, - provides = [CcToolchainConfigInfo], -) diff --git a/third_party/toolchains/bazel_0.23.2_rbe_windows/dummy_toolchain.bzl b/third_party/toolchains/bazel_0.23.2_rbe_windows/dummy_toolchain.bzl deleted file mode 100644 index 45c0285d232..00000000000 --- a/third_party/toolchains/bazel_0.23.2_rbe_windows/dummy_toolchain.bzl +++ /dev/null @@ -1,23 +0,0 @@ -# pylint: disable=g-bad-file-header -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -"""Skylark rule that stubs a toolchain.""" - -def _dummy_toolchain_impl(ctx): - ctx = ctx # unused argument - toolchain = platform_common.ToolchainInfo() - return [toolchain] - -dummy_toolchain = rule(_dummy_toolchain_impl, attrs = {}) diff --git a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile deleted file mode 100644 index da16fe246c9..00000000000 --- a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM ubuntu:12.04 - -RUN apt-get update && apt-get install -y curl - -# Install nvm -RUN touch .profile -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash \ No newline at end of file diff --git a/tools/dockerfile/distribtest/node_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/node_wheezy_x64/Dockerfile deleted file mode 100644 index 4be05039b00..00000000000 --- a/tools/dockerfile/distribtest/node_wheezy_x64/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM debian:wheezy - -RUN apt-get update && apt-get install -y curl - -# Install nvm -RUN touch .profile -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash \ No newline at end of file diff --git a/tools/dockerfile/distribtest/python_dev_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_fedora22_x64/Dockerfile deleted file mode 100644 index d86ad378c33..00000000000 --- a/tools/dockerfile/distribtest/python_dev_fedora22_x64/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM fedora:22 - -RUN yum clean all && yum update -y && yum install -y python python-pip -RUN pip install virtualenv - -RUN yum groupinstall -y "Development Tools" -RUN yum install -y redhat-rpm-config -RUN yum install -y gcc-c++ -RUN yum install -y python2-devel diff --git a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile deleted file mode 100644 index c1f0973166c..00000000000 --- a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM fedora:20 - -RUN yum clean all && yum update -y && yum install -y python python-pip - -# Upgrading six would fail because of docker issue when using overlay. -# Trying twice makes it work fine. -# https://github.com/docker/docker/issues/10180 -RUN pip install --upgrade six || pip install --upgrade six - -RUN pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile deleted file mode 100644 index 66acccb64f6..00000000000 --- a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM fedora:21 - -# Make yum work properly under docker when using overlay storage driver. -# https://bugzilla.redhat.com/show_bug.cgi?id=1213602#c9 -# https://github.com/docker/docker/issues/10180 -RUN yum install -y yum-plugin-ovl - -RUN yum clean all && yum update -y && yum install -y python python-pip - -# Upgrading six would fail because of docker issue when using overlay. -# Trying twice makes it work fine. -# https://github.com/docker/docker/issues/10180 -RUN pip2 install --upgrade six || pip2 install --upgrade six - -RUN pip2 install virtualenv diff --git a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile deleted file mode 100644 index 41ac0b3fecf..00000000000 --- a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM fedora:22 - -RUN yum clean all && yum update -y && yum install -y python python-pip -RUN pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile deleted file mode 100644 index 7dd499f8a0a..00000000000 --- a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM ubuntu:12.04 - -RUN apt-get update -y && apt-get install -y python python-pip - -# Use --index-url to workaround -# https://stackoverflow.com/questions/21294997/pip-connection-failure-cannot-fetch-index-base-url-http-pypi-python-org-simpl -RUN pip install --index-url=https://pypi.python.org/simple/ virtualenv diff --git a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile deleted file mode 100644 index c17d7bcba22..00000000000 --- a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM debian:wheezy - -RUN apt-get update -y && apt-get install -y python python-pip - -# Use --index-url to workaround -# https://stackoverflow.com/questions/21294997/pip-connection-failure-cannot-fetch-index-base-url-http-pypi-python-org-simpl -RUN pip install --index-url=https://pypi.python.org/simple/ virtualenv diff --git a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile deleted file mode 100644 index 73a4bd76c88..00000000000 --- a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM fedora:20 - -# distro-sync and install openssl, per https://github.com/fedora-cloud/docker-brew-fedora/issues/19 -RUN yum clean all && yum update -y && yum distro-sync -y && yum install -y openssl gnupg which findutils - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -RUN curl -sSL https://get.rvm.io | bash -s stable - -# Install Ruby 2.3 -# Running the installation twice to work around docker issue when using overlay. -# https://github.com/docker/docker/issues/10180 -RUN (/bin/bash -l -c "rvm install ruby-2.3.8") || (/bin/bash -l -c "rvm install ruby-2.3.8") -RUN /bin/bash -l -c "rvm use --default ruby-2.3.8" -RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" -RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" -RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.3.8' >> ~/.bashrc" -RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document" - -RUN mkdir /var/local/jenkins - -RUN /bin/bash -l -c "echo '. /etc/profile.d/rvm.sh' >> ~/.bashrc" diff --git a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile deleted file mode 100644 index 43c0ae5d8d6..00000000000 --- a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM fedora:21 - -# Make yum work properly under docker when using overlay storage driver. -# https://bugzilla.redhat.com/show_bug.cgi?id=1213602#c9 -# https://github.com/docker/docker/issues/10180 -RUN yum install -y yum-plugin-ovl - -# distro-sync and install openssl, per https://github.com/fedora-cloud/docker-brew-fedora/issues/19 -RUN yum clean all && yum update -y && yum distro-sync -y && yum install -y openssl gnupg which findutils tar - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -RUN curl -sSL https://get.rvm.io | bash -s stable - -# Install Ruby 2.3 -RUN /bin/bash -l -c "rvm install ruby-2.3.8" -RUN /bin/bash -l -c "rvm use --default ruby-2.3.8" -RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" -RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" -RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.3.8' >> ~/.bashrc" -RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document" - -RUN mkdir /var/local/jenkins - -RUN /bin/bash -l -c "echo '. /etc/profile.d/rvm.sh' >> ~/.bashrc" diff --git a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile deleted file mode 100644 index e077f68a38d..00000000000 --- a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM fedora:22 - -# Make yum work properly under docker when using overlay storage driver. -# https://bugzilla.redhat.com/show_bug.cgi?id=1213602#c9 -# https://github.com/docker/docker/issues/10180 -RUN yum install -y yum-plugin-ovl - -# distro-sync and install openssl, per https://github.com/fedora-cloud/docker-brew-fedora/issues/19 -RUN yum clean all && yum update -y && yum distro-sync -y && yum install -y openssl gnupg which findutils tar procps - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -RUN curl -sSL https://get.rvm.io | bash -s stable - -# Install Ruby 2.3 -RUN /bin/bash -l -c "rvm install ruby-2.3.8" -RUN /bin/bash -l -c "rvm use --default ruby-2.3.8" -RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" -RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" -RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.3.8' >> ~/.bashrc" -RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document" - -RUN mkdir /var/local/jenkins - -RUN /bin/bash -l -c "echo '. /etc/profile.d/rvm.sh' >> ~/.bashrc" diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile deleted file mode 100644 index 0b0478c6da1..00000000000 --- a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM ubuntu:12.04 - -RUN apt-get update -y && apt-get install -y curl - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -RUN \curl -sSL https://get.rvm.io | bash -s stable --ruby - -RUN /bin/bash -l -c "echo '. /etc/profile.d/rvm.sh' >> ~/.bashrc" -RUN /bin/bash -l -c "gem install --update bundler" diff --git a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile deleted file mode 100644 index ad608496b1d..00000000000 --- a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -FROM debian:wheezy - -RUN apt-get update && apt-get install -y curl - -RUN apt-get update && apt-get install -y procps - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -RUN \curl -sSL https://get.rvm.io | bash -s stable --ruby - -RUN /bin/bash -l -c "echo '. /etc/profile.d/rvm.sh' >> ~/.bashrc" -RUN /bin/bash -l -c "gem install --update bundler" diff --git a/tools/dockerfile/test/bazel/Dockerfile b/tools/dockerfile/test/bazel/Dockerfile index 25fcf3e6f28..e671ad62227 100644 --- a/tools/dockerfile/test/bazel/Dockerfile +++ b/tools/dockerfile/test/bazel/Dockerfile @@ -27,6 +27,7 @@ RUN apt-get update && apt-get -y install \ autoconf \ build-essential \ curl \ + wget \ libtool \ make \ openjdk-8-jdk \ @@ -48,6 +49,27 @@ RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 +#================= +# Compile CPython 3.6.9 from source + +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev +RUN apt-get update && apt-get install -y jq build-essential libffi-dev + +RUN cd /tmp && \ + wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \ + tar xzvf Python-3.6.9.tgz && \ + cd Python-3.6.9 && \ + ./configure && \ + make install + +RUN cd /tmp && \ + echo "ff7cdaef4846c89c1ec0d7b709bbd54d Python-3.6.9.tgz" > checksum.md5 && \ + md5sum -c checksum.md5 + +RUN python3.6 -m ensurepip && \ + python3.6 -m pip install coverage + + #======================== # Bazel installation diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 6ac313ad135..344a705137e 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -786,6 +786,7 @@ doc/interop-test-descriptions.md \ doc/keepalive.md \ doc/load-balancing.md \ doc/naming.md \ +doc/security_audit.md \ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 80ed64984b6..71cdff42584 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -786,6 +786,7 @@ doc/interop-test-descriptions.md \ doc/keepalive.md \ doc/load-balancing.md \ doc/naming.md \ +doc/security_audit.md \ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index f4533f240bd..26a9e925e22 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -793,6 +793,7 @@ doc/interop-test-descriptions.md \ doc/keepalive.md \ doc/load-balancing.md \ doc/naming.md \ +doc/security_audit.md \ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index de3f8640e9a..b91da524fa2 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -793,6 +793,7 @@ doc/interop-test-descriptions.md \ doc/keepalive.md \ doc/load-balancing.md \ doc/naming.md \ +doc/security_audit.md \ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg index 21afbd04ee3..abfc486629e 100644 --- a/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg +++ b/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_asan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg index e80321b9a8a..607b2e53081 100644 --- a/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg +++ b/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg index ee883392f4b..fdd7324ffc8 100644 --- a/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg +++ b/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg index be939bbff55..98036473a0c 100644 --- a/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg +++ b/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_msan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg index 48a6d91f123..e34e04111dd 100644 --- a/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg +++ b/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg index f45a4c2da2d..4877981093a 100644 --- a/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg +++ b/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_tsan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg index f0cf94ad142..1c72b91a00a 100644 --- a/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg +++ b/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg index f978c730b7c..b8aada2cdec 100644 --- a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_asan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg index ab47a30b247..38efccf7780 100644 --- a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg index 24b19f23e62..14b97b642cf 100644 --- a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_msan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg index 65395f0bf6f..f352113d946 100644 --- a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg index cf65606f3cd..993024fb111 100644 --- a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_tsan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg index a943b89509d..282aa55e950 100644 --- a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_ubsan_on_foundry.sh" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg b/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg index b720e10f0db..6e7fdc8e6f7 100644 --- a/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg +++ b/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg @@ -17,7 +17,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg b/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg index 7f6bd4f7b3f..b1a1de06666 100644 --- a/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg +++ b/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg @@ -17,7 +17,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg b/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg index 71470d48544..7735f764237 100644 --- a/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg +++ b/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg @@ -17,7 +17,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg b/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg index 120e1496808..df171480449 100644 --- a/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg +++ b/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg @@ -17,7 +17,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat" -timeout_mins: 60 +timeout_mins: 90 gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" diff --git a/tools/remote_build/rbe_common.bazelrc b/tools/remote_build/rbe_common.bazelrc index 568e7aec5fa..6a95d90a41e 100644 --- a/tools/remote_build/rbe_common.bazelrc +++ b/tools/remote_build/rbe_common.bazelrc @@ -30,7 +30,7 @@ build --spawn_strategy=remote build --strategy=Javac=remote build --strategy=Closure=remote build --genrule_strategy=remote -build --remote_timeout=3600 +build --remote_timeout=7200 # very large value to avoid problems like https://github.com/grpc/grpc/issues/20777 build --remote_instance_name=projects/grpc-testing/instances/default_instance diff --git a/tools/remote_build/windows.bazelrc b/tools/remote_build/windows.bazelrc index 196f99fe68e..cba45b5aa5e 100644 --- a/tools/remote_build/windows.bazelrc +++ b/tools/remote_build/windows.bazelrc @@ -24,7 +24,7 @@ build --spawn_strategy=remote build --strategy=Javac=remote build --strategy=Closure=remote build --genrule_strategy=remote -build --remote_timeout=3600 +build --remote_timeout=7200 # very large value to avoid problems like https://github.com/grpc/grpc/issues/20777 build --remote_instance_name=projects/grpc-testing/instances/grpc-windows-rbe-test diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index c85a4b71386..403a858c5f4 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -315,42 +315,31 @@ def targets(): CSharpDistribTest('macos', 'x86'), CSharpDistribTest('windows', 'x86'), CSharpDistribTest('windows', 'x64'), - PythonDistribTest('linux', 'x64', 'wheezy'), PythonDistribTest('linux', 'x64', 'jessie'), PythonDistribTest('linux', 'x86', 'jessie'), PythonDistribTest('linux', 'x64', 'centos6'), PythonDistribTest('linux', 'x64', 'centos7'), - PythonDistribTest('linux', 'x64', 'fedora20'), - PythonDistribTest('linux', 'x64', 'fedora21'), - PythonDistribTest('linux', 'x64', 'fedora22'), PythonDistribTest('linux', 'x64', 'fedora23'), PythonDistribTest('linux', 'x64', 'opensuse'), PythonDistribTest('linux', 'x64', 'arch'), - PythonDistribTest('linux', 'x64', 'ubuntu1204'), PythonDistribTest('linux', 'x64', 'ubuntu1404'), PythonDistribTest('linux', 'x64', 'ubuntu1604'), PythonDistribTest('linux', 'x64', 'alpine3.7', source=True), PythonDistribTest('linux', 'x64', 'jessie', source=True), PythonDistribTest('linux', 'x86', 'jessie', source=True), PythonDistribTest('linux', 'x64', 'centos7', source=True), - PythonDistribTest('linux', 'x64', 'fedora22', source=True), PythonDistribTest('linux', 'x64', 'fedora23', source=True), PythonDistribTest('linux', 'x64', 'arch', source=True), PythonDistribTest('linux', 'x64', 'ubuntu1404', source=True), PythonDistribTest('linux', 'x64', 'ubuntu1604', source=True), - RubyDistribTest('linux', 'x64', 'wheezy'), RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_3'), RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_4'), RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_5'), RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_6'), RubyDistribTest('linux', 'x64', 'centos6'), RubyDistribTest('linux', 'x64', 'centos7'), - RubyDistribTest('linux', 'x64', 'fedora20'), - RubyDistribTest('linux', 'x64', 'fedora21'), - RubyDistribTest('linux', 'x64', 'fedora22'), RubyDistribTest('linux', 'x64', 'fedora23'), RubyDistribTest('linux', 'x64', 'opensuse'), - RubyDistribTest('linux', 'x64', 'ubuntu1204'), RubyDistribTest('linux', 'x64', 'ubuntu1404'), RubyDistribTest('linux', 'x64', 'ubuntu1604'), PHPDistribTest('linux', 'x64', 'jessie'),