From 8ced27a3641d3818b6324254e197141c57a37cee Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Mon, 15 May 2017 21:56:44 +0100 Subject: [PATCH 01/51] Fix finding c-ares in package mode with CMake The next release of c-ares will install a CMake package (when built using CMake), but it will be called "c-ares", not "CARES". --- CMakeLists.txt | 8 ++++---- templates/CMakeLists.txt.template | 8 ++++---- tools/cmake/gRPCConfig.cmake.in | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93f83939b9c..a65ce567a6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,11 +150,11 @@ if("${gRPC_CARES_PROVIDER}" STREQUAL "module") message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong") endif() elseif("${gRPC_CARES_PROVIDER}" STREQUAL "package") - find_package(CARES) - if(TARGET CARES::CARES) - set(_gRPC_CARES_LIBRARIES CARES::CARES) + find_package(c-ares CONFIG) + if(TARGET c-ares::cares) + set(_gRPC_CARES_LIBRARIES c-ares::cares) endif() - set(_gRPC_FIND_CARES "if(NOT CARES_FOUND)\n find_package(CARES)\nendif()") + set(_gRPC_FIND_CARES "if(NOT c-ares_FOUND)\n find_package(c-ares CONFIG)\nendif()") endif() if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module") diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 2252a7ea80a..3e03afdf579 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -195,11 +195,11 @@ message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong") endif() elseif("<%text>${gRPC_CARES_PROVIDER}" STREQUAL "package") - find_package(CARES) - if(TARGET CARES::CARES) - set(_gRPC_CARES_LIBRARIES CARES::CARES) + find_package(c-ares CONFIG) + if(TARGET c-ares::cares) + set(_gRPC_CARES_LIBRARIES c-ares::cares) endif() - set(_gRPC_FIND_CARES "if(NOT CARES_FOUND)\n find_package(CARES)\nendif()") + set(_gRPC_FIND_CARES "if(NOT c-ares_FOUND)\n find_package(c-ares CONFIG)\nendif()") endif() if("<%text>${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module") diff --git a/tools/cmake/gRPCConfig.cmake.in b/tools/cmake/gRPCConfig.cmake.in index 48f06745798..1a0fa6a4624 100644 --- a/tools/cmake/gRPCConfig.cmake.in +++ b/tools/cmake/gRPCConfig.cmake.in @@ -2,6 +2,7 @@ @_gRPC_FIND_ZLIB@ @_gRPC_FIND_PROTOBUF@ @_gRPC_FIND_SSL@ +@_gRPC_FIND_CARES@ # Targets include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) From b5984fa8d765c251a8ad2a0717c50be2710fa4b4 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Mon, 15 May 2017 21:04:16 +0100 Subject: [PATCH 02/51] Revert "cmake: fix #8729" This reverts commit c019e057c20db0b9c9a2f76fb0b9cd6f44addf92. --- CMakeLists.txt | 7 +++++++ templates/CMakeLists.txt.template | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a65ce567a6c..c4e0e0162d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14326,6 +14326,13 @@ endif (gRPC_BUILD_TESTS) +if (gRPC_INSTALL) + install(EXPORT gRPCTargets + DESTINATION ${CMAKE_INSTALL_CMAKEDIR} + NAMESPACE gRPC:: + ) +endif() + foreach(_config gRPCConfig gRPCConfigVersion) configure_file(tools/cmake/${_config}.cmake.in ${_config}.cmake @ONLY) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 3e03afdf579..acf39305fad 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -618,6 +618,13 @@ endif() + if (gRPC_INSTALL) + install(EXPORT gRPCTargets + DESTINATION <%text>${CMAKE_INSTALL_CMAKEDIR} + NAMESPACE gRPC:: + ) + endif() + foreach(_config gRPCConfig gRPCConfigVersion) configure_file(tools/cmake/<%text>${_config}.cmake.in <%text>${_config}.cmake @ONLY) From c17eb5c37e1c2ab44bb1e001769379e5c6f58f64 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Mon, 15 May 2017 21:17:29 +0100 Subject: [PATCH 03/51] CMake: Disable installation when using bundled third party libraries If gRPC is not getting its (link-time) dependencies from the system, it should not be attempting installation. --- CMakeLists.txt | 25 +++++++++++++++++++++---- templates/CMakeLists.txt.template | 25 +++++++++++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4e0e0162d5..a97b7a59ee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,11 +48,12 @@ project(${PACKAGE_NAME} C CXX) # Options option(gRPC_BUILD_TESTS "Build tests" OFF) -if (NOT MSVC) - set(gRPC_INSTALL ON CACHE BOOL "Generate installation target") -else() - set(gRPC_INSTALL OFF CACHE BOOL "Generate installation target") +set(gRPC_INSTALL_default ON) +if (MSVC) + set(gRPC_INSTALL_default OFF) endif() +set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL + "Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"") set(gRPC_ZLIB_PROVIDER "module" CACHE STRING "Provider of zlib library") set_property(CACHE gRPC_ZLIB_PROVIDER PROPERTY STRINGS "module" "package") @@ -118,6 +119,10 @@ if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_ZLIB_PROVIDER is \"module\" but ZLIB_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_ZLIB_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_ZLIB_PROVIDER}" STREQUAL "package") find_package(ZLIB) if(TARGET ZLIB::ZLIB) @@ -149,6 +154,10 @@ if("${gRPC_CARES_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_CARES_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_CARES_PROVIDER}" STREQUAL "package") find_package(c-ares CONFIG) if(TARGET c-ares::cares) @@ -183,6 +192,10 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_PROTOBUF_PROVIDER is \"module\" but PROTOBUF_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_PROTOBUF_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package") find_package(protobuf CONFIG) if(protobuf_FOUND) @@ -216,6 +229,10 @@ if("${gRPC_SSL_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_SSL_PROVIDER is \"module\" but BORINGSSL_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_SSL_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_SSL_PROVIDER}" STREQUAL "package") find_package(OpenSSL) if(TARGET OpenSSL::SSL) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index acf39305fad..c792877b049 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -92,11 +92,12 @@ # Options option(gRPC_BUILD_TESTS "Build tests" OFF) - if (NOT MSVC) - set(gRPC_INSTALL ON CACHE BOOL "Generate installation target") - else() - set(gRPC_INSTALL OFF CACHE BOOL "Generate installation target") + set(gRPC_INSTALL_default ON) + if (MSVC) + set(gRPC_INSTALL_default OFF) endif() + set(gRPC_INSTALL <%text>${gRPC_INSTALL_default} CACHE BOOL + "Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"") set(gRPC_ZLIB_PROVIDER "module" CACHE STRING "Provider of zlib library") set_property(CACHE gRPC_ZLIB_PROVIDER PROPERTY STRINGS "module" "package") @@ -163,6 +164,10 @@ else() message(WARNING "gRPC_ZLIB_PROVIDER is \"module\" but ZLIB_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_ZLIB_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_ZLIB_PROVIDER}" STREQUAL "package") find_package(ZLIB) if(TARGET ZLIB::ZLIB) @@ -194,6 +199,10 @@ else() message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_CARES_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_CARES_PROVIDER}" STREQUAL "package") find_package(c-ares CONFIG) if(TARGET c-ares::cares) @@ -228,6 +237,10 @@ else() message(WARNING "gRPC_PROTOBUF_PROVIDER is \"module\" but PROTOBUF_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_PROTOBUF_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package") find_package(protobuf CONFIG) if(protobuf_FOUND) @@ -261,6 +274,10 @@ else() message(WARNING "gRPC_SSL_PROVIDER is \"module\" but BORINGSSL_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_SSL_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_SSL_PROVIDER}" STREQUAL "package") find_package(OpenSSL) if(TARGET OpenSSL::SSL) From a65f006d2111b2d94d5108ac4fca7f29f75c81b1 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Mon, 15 May 2017 22:59:37 +0100 Subject: [PATCH 04/51] Set gRPC_INSTALL to ON by default for MSVC and OFF if a subproject Now that gRPC_INSTALL is forced off if using bundled third-party libraries, it no longer makes sense to set it OFF by default for MSVC. However, we do want to set it OFF by default if gRPC is being built as a subproject of another project. --- CMakeLists.txt | 5 +++-- templates/CMakeLists.txt.template | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a97b7a59ee6..23f3748b726 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,8 +49,9 @@ project(${PACKAGE_NAME} C CXX) option(gRPC_BUILD_TESTS "Build tests" OFF) set(gRPC_INSTALL_default ON) -if (MSVC) - set(gRPC_INSTALL_default OFF) +if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + # Disable gRPC_INSTALL by default if building as a submodule + set(gRPC_INSTALL_default OFF) endif() set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL "Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"") diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index c792877b049..0719b3688f3 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -93,8 +93,9 @@ option(gRPC_BUILD_TESTS "Build tests" OFF) set(gRPC_INSTALL_default ON) - if (MSVC) - set(gRPC_INSTALL_default OFF) + if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + # Disable gRPC_INSTALL by default if building as a submodule + set(gRPC_INSTALL_default OFF) endif() set(gRPC_INSTALL <%text>${gRPC_INSTALL_default} CACHE BOOL "Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"") From 8d1cfdcb5d86e6ebbbb8de9e0de51ff23768445c Mon Sep 17 00:00:00 2001 From: Yaron Shani Date: Mon, 22 May 2017 14:43:05 +0300 Subject: [PATCH 05/51] ALPN fix --- binding.gyp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/binding.gyp b/binding.gyp index 8aafdaa62b8..8a120adf825 100644 --- a/binding.gyp +++ b/binding.gyp @@ -130,6 +130,15 @@ ] }, { 'conditions': [ + ["target_arch=='ia32'", { + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] + }], + ["target_arch=='x64'", { + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] + }], + ["target_arch=='arm'", { + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] + }], ['grpc_alpn=="true"', { 'defines': [ 'TSI_OPENSSL_ALPN_SUPPORT=1' @@ -142,17 +151,6 @@ ], 'include_dirs': [ '<(node_root_dir)/deps/openssl/openssl/include', - ], - 'conditions': [ - ["target_arch=='ia32'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] - }], - ["target_arch=='x64'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] - }], - ["target_arch=='arm'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] - }] ] }], ['OS == "win"', { From 19489ae0cac02c972df29c80cd4432c3282e82bc Mon Sep 17 00:00:00 2001 From: Yaron Shani Date: Tue, 23 May 2017 08:22:35 +0300 Subject: [PATCH 06/51] update template --- templates/binding.gyp.template | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template index 933174ab6ed..204c5b63d4b 100644 --- a/templates/binding.gyp.template +++ b/templates/binding.gyp.template @@ -120,6 +120,15 @@ ] }, { 'conditions': [ + ["target_arch=='ia32'", { + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] + }], + ["target_arch=='x64'", { + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] + }], + ["target_arch=='arm'", { + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] + }], ['grpc_alpn=="true"', { 'defines': [ 'TSI_OPENSSL_ALPN_SUPPORT=1' @@ -132,17 +141,6 @@ ], 'include_dirs': [ '<(node_root_dir)/deps/openssl/openssl/include', - ], - 'conditions': [ - ["target_arch=='ia32'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] - }], - ["target_arch=='x64'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] - }], - ["target_arch=='arm'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] - }] ] }], ['OS == "win"', { From 1d9a11be82ee1dbeb1294f34e373d5f15625ed9b Mon Sep 17 00:00:00 2001 From: Yaron Shani Date: Mon, 22 May 2017 23:00:46 -0700 Subject: [PATCH 07/51] after running gen project --- binding.gyp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binding.gyp b/binding.gyp index 8a120adf825..e7ddc2b34ba 100644 --- a/binding.gyp +++ b/binding.gyp @@ -131,13 +131,13 @@ }, { 'conditions': [ ["target_arch=='ia32'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] }], ["target_arch=='x64'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] }], ["target_arch=='arm'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] + "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] }], ['grpc_alpn=="true"', { 'defines': [ From ce13cb78a2335e95729b9a18ea157661aa77a4d4 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 30 May 2017 14:11:38 -0700 Subject: [PATCH 08/51] 1.4.x branch cut, version bump PR --- BUILD | 4 ++-- CMakeLists.txt | 2 +- Makefile | 6 +++--- build.yaml | 4 ++-- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- package.json | 2 +- package.xml | 4 ++-- src/core/lib/surface/version.c | 2 +- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Core/Version.csproj.include | 2 +- src/csharp/Grpc.Core/VersionInfo.cs | 2 +- src/csharp/build_packages_dotnetcli.bat | 2 +- src/csharp/build_packages_dotnetcli.sh | 4 ++-- src/node/health_check/package.json | 4 ++-- src/node/tools/package.json | 2 +- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 2 +- 32 files changed, 39 insertions(+), 39 deletions(-) diff --git a/BUILD b/BUILD index bdea522ad15..2070ce3311d 100644 --- a/BUILD +++ b/BUILD @@ -51,9 +51,9 @@ load( # This should be updated along with build.yaml g_stands_for = "gregarious" -core_version = "3.0.0-dev" +core_version = "4.0.0-pre1" -version = "1.4.0-dev" +version = "1.4.0-pre1" grpc_cc_library( name = "gpr", diff --git a/CMakeLists.txt b/CMakeLists.txt index fd53f621a65..acae19ef39f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.4.0-dev") +set(PACKAGE_VERSION "1.4.0-pre1") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") diff --git a/Makefile b/Makefile index 82b2104b4a7..c87fd191445 100644 --- a/Makefile +++ b/Makefile @@ -422,9 +422,9 @@ E = @echo Q = @ endif -CORE_VERSION = 4.0.0-dev -CPP_VERSION = 1.4.0-dev -CSHARP_VERSION = 1.4.0-dev +CORE_VERSION = 4.0.0-pre1 +CPP_VERSION = 1.4.0-pre1 +CSHARP_VERSION = 1.4.0-pre1 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.yaml b/build.yaml index 26144e33def..fd43d64b1a9 100644 --- a/build.yaml +++ b/build.yaml @@ -12,9 +12,9 @@ settings: '#08': Use "-preN" suffixes to identify pre-release versions '#09': Per-language overrides are possible with (eg) ruby_version tag here '#10': See the expand_version.py for all the quirks here - core_version: 4.0.0-dev + core_version: 4.0.0-pre1 g_stands_for: gregarious - version: 1.4.0-dev + version: 1.4.0-pre1 filegroups: - name: census public_headers: diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index d9de2d78a05..44e8931fbca 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -37,7 +37,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.4.0-dev' + version = '1.4.0-pre1' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 62cb0d11a1c..88a64b8d11b 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.4.0-dev' + version = '1.4.0-pre1' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 77ceb22123c..cc6ab6c5cf8 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.4.0-dev' + version = '1.4.0-pre1' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'http://www.grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 10520bd3880..cf63bfeac75 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.4.0-dev' + version = '1.4.0-pre1' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'http://www.grpc.io' diff --git a/package.json b/package.json index 1ed182ced93..6cde38694b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "1.4.0-dev", + "version": "1.4.0-pre1", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", diff --git a/package.xml b/package.xml index 9179ef238c9..5d6c089f04f 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2017-05-22 - 1.4.0dev - 1.4.0dev + 1.4.0RC1 + 1.4.0RC1 beta diff --git a/src/core/lib/surface/version.c b/src/core/lib/surface/version.c index cddc595e4c9..39dfebb9485 100644 --- a/src/core/lib/surface/version.c +++ b/src/core/lib/surface/version.c @@ -36,6 +36,6 @@ #include -const char *grpc_version_string(void) { return "4.0.0-dev"; } +const char *grpc_version_string(void) { return "4.0.0-pre1"; } const char *grpc_g_stands_for(void) { return "gregarious"; } diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index 72a4c4cf94a..8359016c022 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -37,5 +37,5 @@ #include namespace grpc { -grpc::string Version() { return "1.4.0-dev"; } +grpc::string Version() { return "1.4.0-pre1"; } } diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include index 8388bfd9cca..8a15980f0aa 100755 --- a/src/csharp/Grpc.Core/Version.csproj.include +++ b/src/csharp/Grpc.Core/Version.csproj.include @@ -1,7 +1,7 @@ - 1.4.0-dev + 1.4.0-pre1 3.3.0 diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index 2e55d9d80eb..feac0736c37 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -53,6 +53,6 @@ namespace Grpc.Core /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.4.0-dev"; + public const string CurrentVersion = "1.4.0-pre1"; } } diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat index aa8a8d3b17b..cb4ff60d554 100755 --- a/src/csharp/build_packages_dotnetcli.bat +++ b/src/csharp/build_packages_dotnetcli.bat @@ -28,7 +28,7 @@ @rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @rem Current package versions -set VERSION=1.4.0-dev +set VERSION=1.4.0-pre1 @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh index d33923845c1..f3dc8435677 100755 --- a/src/csharp/build_packages_dotnetcli.sh +++ b/src/csharp/build_packages_dotnetcli.sh @@ -54,7 +54,7 @@ dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts -nuget pack Grpc.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts -nuget pack Grpc.Tools.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts +nuget pack Grpc.nuspec -Version "1.4.0-pre1" -OutputDirectory ../../artifacts +nuget pack Grpc.Tools.nuspec -Version "1.4.0-pre1" -OutputDirectory ../../artifacts (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/src/node/health_check/package.json b/src/node/health_check/package.json index 37c9b7a54f5..238547c1771 100644 --- a/src/node/health_check/package.json +++ b/src/node/health_check/package.json @@ -1,6 +1,6 @@ { "name": "grpc-health-check", - "version": "1.4.0-dev", + "version": "1.4.0-pre1", "author": "Google Inc.", "description": "Health check service for use with gRPC", "repository": { @@ -15,7 +15,7 @@ } ], "dependencies": { - "grpc": "^1.4.0-dev", + "grpc": "^1.4.0-pre1", "lodash": "^3.9.3", "google-protobuf": "^3.0.0" }, diff --git a/src/node/tools/package.json b/src/node/tools/package.json index a81aa87f4bb..f4f72a4de5e 100644 --- a/src/node/tools/package.json +++ b/src/node/tools/package.json @@ -1,6 +1,6 @@ { "name": "grpc-tools", - "version": "1.4.0-dev", + "version": "1.4.0-pre1", "author": "Google Inc.", "description": "Tools for developing with gRPC on Node.js", "homepage": "http://www.grpc.io/", diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 2f29058b59d..09f3303654e 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.4.0-dev' + v = '1.4.0-pre1' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index c846f4214c9..25a232a7222 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -38,4 +38,4 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.4.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.4.0-pre1" diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index a0cb0dd067f..fcfd1976322 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.4.0.dev0""" +__version__ = """1.4.0rc1""" diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index ea4bc7ba207..31b85e5aee7 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.4.0rc1' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index 26aa555e14c..53d798f603d 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.4.0rc1' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 978d6b4011f..25ee2808c6a 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.4.0rc1' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index 5f0b0848846..ea9d30704a6 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.4.0rc1' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index f30dff335f1..103e5cbbcda 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.4.0.dev' + VERSION = '1.4.0.pre1' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index 1f8d4afb95f..9ce13f3f827 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -29,6 +29,6 @@ module GRPC module Tools - VERSION = '1.4.0.dev' + VERSION = '1.4.0.pre1' end end diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 1f2aa81c850..09738ea9f30 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.4.0rc1' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 3861bdb85af..d3eb740e296 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.4.0-dev +PROJECT_NUMBER = 1.4.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 5bab66c7d6a..c87e52df82b 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.4.0-dev +PROJECT_NUMBER = 1.4.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index c5ae421d40c..1a8902a4ae0 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.0.0-dev +PROJECT_NUMBER = 4.0.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 15410dec019..49ebc2a9b7e 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.0.0-dev +PROJECT_NUMBER = 4.0.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 1ef9f4ed4da81222d7ddc26bc5fa5c5ca9ad86c0 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 30 May 2017 15:27:46 -0700 Subject: [PATCH 09/51] Add artifact builds for Node 8 --- package.json | 2 +- templates/package.json.template | 2 +- tools/run_tests/artifacts/build_artifact_node.bat | 2 +- tools/run_tests/artifacts/build_artifact_node.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1ed182ced93..1874f241257 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "arguejs": "^0.2.3", "lodash": "^4.15.0", "nan": "^2.0.0", - "node-pre-gyp": "^0.6.0", + "node-pre-gyp": "^0.6.35", "protobufjs": "^5.0.0" }, "devDependencies": { diff --git a/templates/package.json.template b/templates/package.json.template index 551c25f0423..1027e7bb9b7 100644 --- a/templates/package.json.template +++ b/templates/package.json.template @@ -35,7 +35,7 @@ "arguejs": "^0.2.3", "lodash": "^4.15.0", "nan": "^2.0.0", - "node-pre-gyp": "^0.6.0", + "node-pre-gyp": "^0.6.35", "protobufjs": "^5.0.0" }, "devDependencies": { diff --git a/tools/run_tests/artifacts/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat index da4d479a8c5..c2738619b33 100644 --- a/tools/run_tests/artifacts/build_artifact_node.bat +++ b/tools/run_tests/artifacts/build_artifact_node.bat @@ -27,7 +27,7 @@ @rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set node_versions=4.0.0 5.0.0 6.0.0 7.0.0 +set node_versions=4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh index 3947bded6ff..4d2f87838e7 100755 --- a/tools/run_tests/artifacts/build_artifact_node.sh +++ b/tools/run_tests/artifacts/build_artifact_node.sh @@ -42,7 +42,7 @@ mkdir -p "${ARTIFACTS_OUT}" npm update -node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 ) +node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 ) electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 ) From d2f91e8f024bcfb55675d426e654a9d02ac066e7 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 30 May 2017 16:35:34 -0700 Subject: [PATCH 10/51] Fix npm cache handling when updating dependencies --- tools/run_tests/helper_scripts/pre_build_node.bat | 6 ++++-- tools/run_tests/helper_scripts/pre_build_node.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/run_tests/helper_scripts/pre_build_node.bat b/tools/run_tests/helper_scripts/pre_build_node.bat index addb01a2a4d..62b883de466 100644 --- a/tools/run_tests/helper_scripts/pre_build_node.bat +++ b/tools/run_tests/helper_scripts/pre_build_node.bat @@ -29,5 +29,7 @@ set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm -@rem Expire cache after 1 day -call npm update --cache-min 86400 +@rem Update npm to at least version 5 +call npm update -g npm + +call npm update --prefer-online diff --git a/tools/run_tests/helper_scripts/pre_build_node.sh b/tools/run_tests/helper_scripts/pre_build_node.sh index 083cb2bc771..b7c6e14e743 100755 --- a/tools/run_tests/helper_scripts/pre_build_node.sh +++ b/tools/run_tests/helper_scripts/pre_build_node.sh @@ -35,10 +35,12 @@ source ~/.nvm/nvm.sh nvm install $NODE_VERSION set -ex +# Update npm to at least version 5 +npm update -g npm + export GRPC_CONFIG=${CONFIG:-opt} -# Expire cache after 1 day -npm update --cache-min 86400 +npm update --prefer-online npm install node-gyp-install ./node_modules/.bin/node-gyp-install From 88974d506a8dd3598c9d35a0bbf6264afe23731e Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 30 May 2017 16:41:51 -0700 Subject: [PATCH 11/51] Use protobuf's native upper camel conversion --- src/compiler/objective_c_generator_helpers.h | 4 +++- src/compiler/objective_c_plugin.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index b482f028a10..3ebd1b14447 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -38,6 +38,8 @@ #include "src/compiler/config.h" #include "src/compiler/generator_helpers.h" +#include + namespace grpc_objective_c_generator { using ::grpc::protobuf::FileDescriptor; @@ -45,7 +47,7 @@ using ::grpc::protobuf::ServiceDescriptor; using ::grpc::string; inline string MessageHeaderName(const FileDescriptor *file) { - return grpc_generator::FileNameInUpperCamel(file) + ".pbobjc.h"; + return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h"; } inline string ServiceClassName(const ServiceDescriptor *service) { diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 5178115e44c..682d6aa9aa7 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -59,7 +59,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return true; } - ::grpc::string file_name = grpc_generator::FileNameInUpperCamel(file); + ::grpc::string file_name = google::protobuf::compiler::objectivec::FilePath(file); ::grpc::string prefix = file->options().objc_class_prefix(); { From 4bea5b9866412c181c16cac119c314910a701c20 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 30 May 2017 17:37:02 -0700 Subject: [PATCH 12/51] Run tests on Node 8 by default, add Node 7 to portability suite --- tools/run_tests/run_tests.py | 7 ++++--- tools/run_tests/run_tests_matrix.py | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 568774cecea..266d31bf892 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -431,10 +431,11 @@ class NodeLanguage(object): # we should specify in the compiler argument _check_compiler(self.args.compiler, ['default', 'node0.12', 'node4', 'node5', 'node6', - 'node7', 'electron1.3', 'electron1.6']) + 'node7', 'node8', + 'electron1.3', 'electron1.6']) if self.args.compiler == 'default': self.runtime = 'node' - self.node_version = '7' + self.node_version = '8' else: if self.args.compiler.startswith('electron'): self.runtime = 'electron' @@ -1173,7 +1174,7 @@ argp.add_argument('--compiler', 'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7', 'vs2013', 'vs2015', 'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine', - 'node0.12', 'node4', 'node5', 'node6', 'node7', + 'node0.12', 'node4', 'node5', 'node6', 'node7', 'node8', 'electron1.3', 'electron1.6', 'coreclr', 'cmake'], diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 84551d93948..32b9d5676de 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -309,6 +309,15 @@ def _create_portability_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS) extra_args=extra_args, inner_jobs=inner_jobs) + test_jobs += _generate_jobs(languages=['node'], + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler='node7', + labels=['portability'], + extra_args=extra_args, + inner_jobs=inner_jobs) + return test_jobs From 88d937736548544077357a0bb74df52f275dec7e Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 31 May 2017 09:32:27 -0700 Subject: [PATCH 13/51] clang-format --- src/compiler/objective_c_plugin.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 682d6aa9aa7..466da4c3b48 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -59,7 +59,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return true; } - ::grpc::string file_name = google::protobuf::compiler::objectivec::FilePath(file); + ::grpc::string file_name = + google::protobuf::compiler::objectivec::FilePath(file); ::grpc::string prefix = file->options().objc_class_prefix(); { From 9d56717be4fa5d0c05e42bb1137b30ef121960d8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 26 May 2017 14:19:23 -0700 Subject: [PATCH 14/51] throw if server started with unbound ports --- src/csharp/Grpc.Core/Server.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 63c1d9cd00f..7ba204a0b6f 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -34,6 +34,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using Grpc.Core.Internal; @@ -155,6 +156,7 @@ namespace Grpc.Core /// /// Starts the server. + /// Throws IOException if not successful. /// public void Start() { @@ -163,7 +165,8 @@ namespace Grpc.Core GrpcPreconditions.CheckState(!startRequested); GrpcPreconditions.CheckState(!shutdownRequested); startRequested = true; - + + CheckPortsBoundSuccessfully(); handle.Start(); for (int i = 0; i < requestCallTokensPerCq; i++) @@ -316,6 +319,20 @@ namespace Grpc.Core } } + /// + /// Checks that all ports have been bound successfully. + /// + private void CheckPortsBoundSuccessfully() + { + lock (myLock) + { + if (!ports.All((port) => port.BoundPort != 0)) + { + throw new IOException("Failed to bind some of ports exposed by the server."); + } + } + } + private void DisposeHandle() { var activeCallCount = activeCallCounter.Count; From 67206428a41124abcde3798fa39728064ef59ff8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 26 May 2017 14:28:39 -0700 Subject: [PATCH 15/51] add StartThrowsWithUnboundPortTest --- src/csharp/Grpc.Core.Tests/ServerTest.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/csharp/Grpc.Core.Tests/ServerTest.cs b/src/csharp/Grpc.Core.Tests/ServerTest.cs index 3b51aa63300..5e95ed9ea61 100644 --- a/src/csharp/Grpc.Core.Tests/ServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ServerTest.cs @@ -32,6 +32,7 @@ #endregion using System; +using System.IO; using System.Linq; using Grpc.Core; using Grpc.Core.Internal; @@ -80,6 +81,21 @@ namespace Grpc.Core.Tests server.ShutdownAsync().Wait(); } + [Test] + public void StartThrowsWithUnboundPorts() + { + int twiceBoundPort = 9999; + Server server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) }) + { + Ports = { + new ServerPort("localhost", twiceBoundPort, ServerCredentials.Insecure), + new ServerPort("localhost", twiceBoundPort, ServerCredentials.Insecure) + } + }; + Assert.Throws(typeof(IOException), () => server.Start()); + server.ShutdownAsync().Wait(); + } + [Test] public void CannotModifyAfterStarted() { From feb99b215ed821ce756b674a61b069b2e7342d10 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 31 May 2017 15:52:29 -0700 Subject: [PATCH 16/51] Node artifacts: don't do testpackage --- tools/run_tests/artifacts/build_artifact_node.bat | 4 ++-- tools/run_tests/artifacts/build_artifact_node.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/run_tests/artifacts/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat index c2738619b33..f540ef5abef 100644 --- a/tools/run_tests/artifacts/build_artifact_node.bat +++ b/tools/run_tests/artifacts/build_artifact_node.bat @@ -45,13 +45,13 @@ for %%v in (%node_versions%) do ( @rem Try again after removing openssl headers rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\%%v\include\node\openssl" /S /Q rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\iojs-%%v\include\node\openssl" /S /Q - call .\node_modules\.bin\node-pre-gyp.cmd build package testpackage --target=%%v --target_arch=%1 || goto :error + call .\node_modules\.bin\node-pre-gyp.cmd build package --target=%%v --target_arch=%1 || goto :error xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error ) for %%v in (%electron_versions%) do ( - cmd /V /C "set "HOME=%HOMEDRIVE%%HOMEPATH%\electron-gyp" && call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package testpackage --runtime=electron --target=%%v --target_arch=%1 --disturl=https://atom.io/download/electron" || goto :error + cmd /V /C "set "HOME=%HOMEDRIVE%%HOMEPATH%\electron-gyp" && call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package --runtime=electron --target=%%v --target_arch=%1 --disturl=https://atom.io/download/electron" || goto :error xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error ) diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh index 4d2f87838e7..e5e36903ebd 100755 --- a/tools/run_tests/artifacts/build_artifact_node.sh +++ b/tools/run_tests/artifacts/build_artifact_node.sh @@ -48,12 +48,12 @@ electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 ) for version in ${node_versions[@]} do - ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH --grpc_alpine=true + ./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$NODE_TARGET_ARCH --grpc_alpine=true cp -r build/stage/* "${ARTIFACTS_OUT}"/ done for version in ${electron_versions[@]} do - HOME=~/.electron-gyp ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --runtime=electron --target=$version --target_arch=$NODE_TARGET_ARCH --disturl=https://atom.io/download/electron + HOME=~/.electron-gyp ./node_modules/.bin/node-pre-gyp configure rebuild package --runtime=electron --target=$version --target_arch=$NODE_TARGET_ARCH --disturl=https://atom.io/download/electron cp -r build/stage/* "${ARTIFACTS_OUT}"/ done From bc54144b2e7526defe28db98cfcf079387c44da7 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Thu, 1 Jun 2017 03:22:15 -0700 Subject: [PATCH 17/51] PHP: windows config.w32 fix --- config.w32 | 129 ++++++++++++++++++ src/php/ext/grpc/version.h | 2 +- templates/config.w32.template | 36 +++++ templates/src/php/ext/grpc/version.h.template | 2 +- 4 files changed, 167 insertions(+), 2 deletions(-) diff --git a/config.w32 b/config.w32 index 7c407e848a4..c9f30d655a6 100644 --- a/config.w32 +++ b/config.w32 @@ -640,4 +640,133 @@ if (PHP_GRPC != "no") { "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ "/I"+configure_module_dirname+"\\third_party\\zlib"); + + base_dir = get_define('BUILD_DIR'); + FSO.CreateFolder(base_dir+"\\ext"); + FSO.CreateFolder(base_dir+"\\ext\\grpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\boringssl"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\census"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\census\\gen"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\deadline"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\client"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\message_compress"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\server"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\load_reporting"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\max_age"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\message_size"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\workarounds"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\alpn"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client\\insecure"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client\\secure"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\insecure"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\secure"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\transport"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\channel"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\compression"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\debug"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\http"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\json"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\profiling"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\context"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\composite"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\fake"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\google_default"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\iam"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\jwt"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\oauth2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\plugin"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\ssl"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\transport"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\util"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\slice"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\support"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\surface"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\transport"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\plugin_registry"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php\\ext"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php\\ext\\grpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\aes"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\asn1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\base64"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bio"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bn"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bn\\asm"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\buf"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bytestring"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\chacha"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\cipher"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\cmac"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\conf"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\curve25519"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\des"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\dh"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\digest"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\dsa"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\ec"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\ecdh"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\ecdsa"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\engine"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\err"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\evp"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\hkdf"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\hmac"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\lhash"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\md4"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\md5"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\modes"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\newhope"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\obj"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\pem"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\pkcs8"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\poly1305"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\rand"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\rc4"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\rsa"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\sha"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\stack"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\x509"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\x509v3"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\ssl"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\nanopb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib"); + _build_dirs = new Array(); + for (i = 0; i < build_dirs.length; i++) { + if (build_dirs[i].indexOf('grpc') == -1) { + _build_dirs[_build_dirs.length] = build_dirs[i]; + } + } + build_dirs = _build_dirs; + } diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index 993ef2de274..0d5d36d9cf4 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -35,6 +35,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.4.0" +#define PHP_GRPC_VERSION "1.4.0RC1" #endif /* VERSION_H */ diff --git a/templates/config.w32.template b/templates/config.w32.template index c822eae097a..4edef963f2c 100644 --- a/templates/config.w32.template +++ b/templates/config.w32.template @@ -28,4 +28,40 @@ "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ "/I"+configure_module_dirname+"\\third_party\\zlib"); + <% + dirs = {} + for lib in libs: + if lib.name in php_config_m4.get('deps', []) and lib.name != 'ares': + for source in lib.src: + tmp = source + prev = '' + while (True): + idx = tmp.find('/'); + if (idx == -1): + break + dirs[prev + '\\\\' + tmp[:idx]] = 1 + prev += ('\\\\' + tmp[:idx]); + tmp = tmp[idx+1:] + + dirs['\\\\src'] = 1; + dirs['\\\\src\\\\php'] = 1; + dirs['\\\\src\\\\php\\\\ext'] = 1; + dirs['\\\\src\\\\php\\\\ext\\\\grpc'] = 1; + dirs = dirs.keys() + dirs.sort() + %> + base_dir = get_define('BUILD_DIR'); + FSO.CreateFolder(base_dir+"\\ext"); + FSO.CreateFolder(base_dir+"\\ext\\grpc"); + % for dir in dirs: + FSO.CreateFolder(base_dir+"\\ext\\grpc${dir}"); + % endfor + _build_dirs = new Array(); + for (i = 0; i < build_dirs.length; i++) { + if (build_dirs[i].indexOf('grpc') == -1) { + _build_dirs[_build_dirs.length] = build_dirs[i]; + } + } + build_dirs = _build_dirs; + } diff --git a/templates/src/php/ext/grpc/version.h.template b/templates/src/php/ext/grpc/version.h.template index 828ea69296c..10977a83c2a 100644 --- a/templates/src/php/ext/grpc/version.h.template +++ b/templates/src/php/ext/grpc/version.h.template @@ -37,6 +37,6 @@ #ifndef VERSION_H #define VERSION_H - #define PHP_GRPC_VERSION "${settings.php_version.php_composer()}" + #define PHP_GRPC_VERSION "${settings.php_version.php()}" #endif /* VERSION_H */ From c4096469299bb9d417b7a3ebacea1dbfd31ed34f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 1 Jun 2017 21:56:24 +0200 Subject: [PATCH 18/51] improve exception message --- src/csharp/Grpc.Core/Server.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 7ba204a0b6f..1fb5c62c8fb 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -326,9 +326,11 @@ namespace Grpc.Core { lock (myLock) { - if (!ports.All((port) => port.BoundPort != 0)) + var unboundPort = ports.FirstOrDefault(port => port.BoundPort == 0); + if (unboundPort != null) { - throw new IOException("Failed to bind some of ports exposed by the server."); + throw new IOException( + string.Format("Failed to bind port \"{0}:{1}\"", unboundPort.Host, unboundPort.Port)); } } } From f5083fe3e3f49631fbb5e3cfb06d9273b270c263 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 1 Jun 2017 14:11:09 -0700 Subject: [PATCH 19/51] Update npm when building Node artifacts --- tools/run_tests/artifacts/build_artifact_node.bat | 2 ++ tools/run_tests/artifacts/build_artifact_node.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/run_tests/artifacts/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat index f540ef5abef..72c59a96d33 100644 --- a/tools/run_tests/artifacts/build_artifact_node.bat +++ b/tools/run_tests/artifacts/build_artifact_node.bat @@ -35,6 +35,8 @@ set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm del /f /q BUILD || rmdir build /s /q +call npm update -g npm + call npm update || goto :error mkdir -p %ARTIFACTS_OUT% diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh index e5e36903ebd..8061c62a59c 100755 --- a/tools/run_tests/artifacts/build_artifact_node.sh +++ b/tools/run_tests/artifacts/build_artifact_node.sh @@ -34,6 +34,8 @@ source ~/.nvm/nvm.sh nvm use 4 set -ex +npm update -g npm + cd $(dirname $0)/../../.. rm -rf build || true From c4f84819bd92ccc1851647727400407bb9366564 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 5 Jun 2017 11:57:12 -0700 Subject: [PATCH 20/51] Backward compatibility --- src/compiler/objective_c_generator_helpers.h | 8 ++++++-- src/compiler/objective_c_plugin.cc | 14 +++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index 3ebd1b14447..3048fe273a2 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -46,8 +46,12 @@ using ::grpc::protobuf::FileDescriptor; using ::grpc::protobuf::ServiceDescriptor; using ::grpc::string; -inline string MessageHeaderName(const FileDescriptor *file) { - return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h"; +inline string MessageHeaderName(const FileDescriptor *file, bool dash_as_separator) { + if (dash_as_separator) { + return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h"; + } else { + return grpc_generator::FileNameInUpperCamel(file) + ".pbobjc.h"; + } } inline string ServiceClassName(const ServiceDescriptor *service) { diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 466da4c3b48..92b9c828fb6 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -59,8 +59,16 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return true; } - ::grpc::string file_name = - google::protobuf::compiler::objectivec::FilePath(file); + ::grpc::string file_name; + + // Simple parameter parsing as we have only one parameter. + // TODO(mxyan): Complete parameter parsing. + bool dash_as_separator = (0 == parameter.compare("--filename-dash-as-separator")); + if (dash_as_separator) { + file_name = google::protobuf::compiler::objectivec::FilePath(file); + } else { + file_name = grpc_generator::FileNameInUpperCamel(file); + } ::grpc::string prefix = file->options().objc_class_prefix(); { @@ -78,7 +86,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { ::grpc::string proto_imports; for (int i = 0; i < file->dependency_count(); i++) { ::grpc::string header = - grpc_objective_c_generator::MessageHeaderName(file->dependency(i)); + grpc_objective_c_generator::MessageHeaderName(file->dependency(i), dash_as_separator); const grpc::protobuf::FileDescriptor *dependency = file->dependency(i); if (IsProtobufLibraryBundledProtoFile(dependency)) { ::grpc::string base_name = header; From da83f0d439cbba013121bf1d5fbcd36364462c37 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 5 Jun 2017 13:46:22 -0700 Subject: [PATCH 21/51] Fix minor error in Node generated documentation --- src/node/src/grpc_extension.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/node/src/grpc_extension.js b/src/node/src/grpc_extension.js index 864da973144..8c374e50b3e 100644 --- a/src/node/src/grpc_extension.js +++ b/src/node/src/grpc_extension.js @@ -31,6 +31,13 @@ * */ +/** + * @module + * @private + */ + +'use strict'; + var binary = require('node-pre-gyp/lib/pre-binding'); var path = require('path'); var binding_path = From 28dbc84a53c13f0159b65ce9c5008b0e4f3798f7 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 5 Jun 2017 15:25:04 -0700 Subject: [PATCH 22/51] Polish --- src/compiler/objective_c_plugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 92b9c828fb6..aeaf743c632 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -63,7 +63,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { // Simple parameter parsing as we have only one parameter. // TODO(mxyan): Complete parameter parsing. - bool dash_as_separator = (0 == parameter.compare("--filename-dash-as-separator")); + bool dash_as_separator = (0 == parameter.compare("filename-dash-as-separator")); if (dash_as_separator) { file_name = google::protobuf::compiler::objectivec::FilePath(file); } else { From 732498b9111e1fd8604e45ca6877147d86302715 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 5 Jun 2017 15:28:10 -0700 Subject: [PATCH 23/51] clang-format --- src/compiler/objective_c_generator_helpers.h | 3 ++- src/compiler/objective_c_plugin.cc | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index 3048fe273a2..6fdb942387f 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -46,7 +46,8 @@ using ::grpc::protobuf::FileDescriptor; using ::grpc::protobuf::ServiceDescriptor; using ::grpc::string; -inline string MessageHeaderName(const FileDescriptor *file, bool dash_as_separator) { +inline string MessageHeaderName(const FileDescriptor *file, + bool dash_as_separator) { if (dash_as_separator) { return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h"; } else { diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index aeaf743c632..6fc612018b6 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -63,7 +63,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { // Simple parameter parsing as we have only one parameter. // TODO(mxyan): Complete parameter parsing. - bool dash_as_separator = (0 == parameter.compare("filename-dash-as-separator")); + bool dash_as_separator = + (0 == parameter.compare("filename-dash-as-separator")); if (dash_as_separator) { file_name = google::protobuf::compiler::objectivec::FilePath(file); } else { @@ -85,8 +86,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { // and import the files in the .pbrpc.m ::grpc::string proto_imports; for (int i = 0; i < file->dependency_count(); i++) { - ::grpc::string header = - grpc_objective_c_generator::MessageHeaderName(file->dependency(i), dash_as_separator); + ::grpc::string header = grpc_objective_c_generator::MessageHeaderName( + file->dependency(i), dash_as_separator); const grpc::protobuf::FileDescriptor *dependency = file->dependency(i); if (IsProtobufLibraryBundledProtoFile(dependency)) { ::grpc::string base_name = header; From 6a8763eca9866d6e94dfbff9ca8c133e5ef6e5c5 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Jun 2017 11:13:09 -0700 Subject: [PATCH 24/51] Add test to verify objective c plugin outputs correct filename --- .../RemoteTestClient/test-dash-filename.proto | 72 +++++++++++++++++++ src/objective-c/tests/build_tests.sh | 23 ++++++ 2 files changed, 95 insertions(+) create mode 100644 src/objective-c/tests/RemoteTestClient/test-dash-filename.proto diff --git a/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto b/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto new file mode 100644 index 00000000000..5c359c5c129 --- /dev/null +++ b/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto @@ -0,0 +1,72 @@ +// Copyright 2015, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +syntax = "proto3"; + +import "google/protobuf/empty.proto"; +import "messages.proto"; + +package grpc.testing; + +option objc_class_prefix = "RMT"; + +// A simple service to test the various types of RPCs and experiment with +// performance with various types of payload. +service TestService { + // One empty request followed by one empty response. + rpc EmptyCall(google.protobuf.Empty) returns (google.protobuf.Empty); + + // One request followed by one response. + rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + + // One request followed by a sequence of responses (streamed download). + // The server returns the payload with client desired type and sizes. + rpc StreamingOutputCall(StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); + + // A sequence of requests followed by one response (streamed upload). + // The server returns the aggregated size of client payload as the result. + rpc StreamingInputCall(stream StreamingInputCallRequest) + returns (StreamingInputCallResponse); + + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + rpc FullDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); + + // A sequence of requests followed by a sequence of responses. + // The server buffers all the client requests and then serves them in order. A + // stream of responses are returned to the client when the server starts with + // first request. + rpc HalfDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); +} diff --git a/src/objective-c/tests/build_tests.sh b/src/objective-c/tests/build_tests.sh index 6602d510d94..496dbcbe600 100755 --- a/src/objective-c/tests/build_tests.sh +++ b/src/objective-c/tests/build_tests.sh @@ -52,3 +52,26 @@ rm -f RemoteTestClient/*.{h,m} echo "TIME: $(date)" pod install + +# Verify the output proto name +[ -e ./RemoteTestClient/Test-dash-filename.pbrpc.h ] || { + echo >&2 "protoc outputs wrong filename." + exit 1 +} + +# Verify the output proto name when dash is treated as separator +PROTOC=../../../bins/$CONFIG/protobuf/protoc +PLUGIN=../../../bins/$CONFIG/grpc_objective_c_plugin + +eval $PROTOC \ + --plugin=protoc-gen-grpc=$PLUGIN \ + --objc_out=RemoteTestClient \ + --grpc_out=filename-dash-as-separator:RemoteTestClient \ + -I RemoteTestClient \ + -I ../../../third_party/protobuf/src \ + RemoteTestClient/*.proto + +[ -e ./RemoteTestClient/TestDashFilename.pbrpc.h ] || { + echo >&2 "protoc outputs wring filename. 2" + exit 1 +} From daa2cb663b5862cd9abbb1ca76eb98acc6a1500e Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Jun 2017 11:21:09 -0700 Subject: [PATCH 25/51] Add comment --- src/compiler/objective_c_plugin.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 6fc612018b6..ff980ae5499 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -32,6 +32,10 @@ */ // Generates Objective C gRPC service interface out of Protobuf IDL. +// For legacy reason, output filename of this plugin is by default in uppercamel +// case with dash "-" treated as character and preserved in the output file +// name. If normal upper camel case (dash treated as word separator) is desired, +// use plugin option "filename-dash-as-separator". #include From 44c16d31d3d13eff96b8e35010f398d4a634a9dc Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 6 Jun 2017 10:40:10 -0700 Subject: [PATCH 26/51] Undo updating npm in node artifact builds --- tools/run_tests/artifacts/build_artifact_node.bat | 2 -- tools/run_tests/artifacts/build_artifact_node.sh | 2 -- 2 files changed, 4 deletions(-) diff --git a/tools/run_tests/artifacts/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat index 72c59a96d33..f540ef5abef 100644 --- a/tools/run_tests/artifacts/build_artifact_node.bat +++ b/tools/run_tests/artifacts/build_artifact_node.bat @@ -35,8 +35,6 @@ set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm del /f /q BUILD || rmdir build /s /q -call npm update -g npm - call npm update || goto :error mkdir -p %ARTIFACTS_OUT% diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh index 8061c62a59c..e5e36903ebd 100755 --- a/tools/run_tests/artifacts/build_artifact_node.sh +++ b/tools/run_tests/artifacts/build_artifact_node.sh @@ -34,8 +34,6 @@ source ~/.nvm/nvm.sh nvm use 4 set -ex -npm update -g npm - cd $(dirname $0)/../../.. rm -rf build || true From cc620dffd02da894dd5678e650c474d21c8432c0 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 7 Jun 2017 10:00:39 -0700 Subject: [PATCH 27/51] Fix test proto --- .../RemoteTestClient/test-dash-filename.proto | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto b/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto index 5c359c5c129..413d6f9eaac 100644 --- a/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto +++ b/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto @@ -31,42 +31,9 @@ // of unary/streaming requests/responses. syntax = "proto3"; -import "google/protobuf/empty.proto"; -import "messages.proto"; - package grpc.testing; option objc_class_prefix = "RMT"; -// A simple service to test the various types of RPCs and experiment with -// performance with various types of payload. -service TestService { - // One empty request followed by one empty response. - rpc EmptyCall(google.protobuf.Empty) returns (google.protobuf.Empty); - - // One request followed by one response. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - rpc StreamingOutputCall(StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - rpc StreamingInputCall(stream StreamingInputCallRequest) - returns (StreamingInputCallResponse); - - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - rpc FullDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - rpc HalfDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); +service DummyService { } From 06eb057eb76d62ca6ee0987b9b2fae1befbff78a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 8 Jun 2017 18:21:09 +0200 Subject: [PATCH 28/51] add grpc_slice_unref to fix leaks --- src/csharp/ext/grpc_csharp_ext.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index a56113eca3c..8cde8ff0c03 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -413,8 +413,14 @@ GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_channel_create_call( host_slice = grpc_slice_from_copied_string(host); host_slice_ptr = &host_slice; } - return grpc_channel_create_call(channel, parent_call, propagation_mask, cq, - method_slice, host_slice_ptr, deadline, NULL); + grpc_call *ret = + grpc_channel_create_call(channel, parent_call, propagation_mask, cq, + method_slice, host_slice_ptr, deadline, NULL); + grpc_slice_unref(method_slice); + if (host != NULL) { + grpc_slice_unref(host_slice); + } + return ret; } GPR_EXPORT grpc_connectivity_state GPR_CALLTYPE @@ -805,7 +811,9 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server( ops[nops].reserved = NULL; nops++; } - return grpcsharp_call_start_batch(call, ops, nops, ctx, NULL); + grpc_call_error ret = grpcsharp_call_start_batch(call, ops, nops, ctx, NULL); + grpc_slice_unref(status_details_slice); + return ret; } GPR_EXPORT grpc_call_error GPR_CALLTYPE From 7352bae1bb02d0d66091f85761934e7fcc1b95ef Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 8 Jun 2017 09:58:06 -0700 Subject: [PATCH 29/51] Move tests --- .../tests/PluginTest/imported-with-dash.proto | 38 +++++++++++++++++++ .../test-dash-filename.proto | 8 +++- src/objective-c/tests/build_tests.sh | 22 ----------- src/objective-c/tests/run_tests.sh | 32 ++++++++++++++++ 4 files changed, 77 insertions(+), 23 deletions(-) create mode 100644 src/objective-c/tests/PluginTest/imported-with-dash.proto rename src/objective-c/tests/{RemoteTestClient => PluginTest}/test-dash-filename.proto (94%) diff --git a/src/objective-c/tests/PluginTest/imported-with-dash.proto b/src/objective-c/tests/PluginTest/imported-with-dash.proto new file mode 100644 index 00000000000..0c4ee3827ad --- /dev/null +++ b/src/objective-c/tests/PluginTest/imported-with-dash.proto @@ -0,0 +1,38 @@ +// Copyright 2017, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package grpc.testing; + +option objc_class_prefix = "RMT"; + +message TestMessageImported { + int32 dummy = 1; +} diff --git a/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto b/src/objective-c/tests/PluginTest/test-dash-filename.proto similarity index 94% rename from src/objective-c/tests/RemoteTestClient/test-dash-filename.proto rename to src/objective-c/tests/PluginTest/test-dash-filename.proto index 413d6f9eaac..be9386f9608 100644 --- a/src/objective-c/tests/RemoteTestClient/test-dash-filename.proto +++ b/src/objective-c/tests/PluginTest/test-dash-filename.proto @@ -1,4 +1,4 @@ -// Copyright 2015, Google Inc. +// Copyright 2017, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -35,5 +35,11 @@ package grpc.testing; option objc_class_prefix = "RMT"; +import "imported-with-dash.proto"; + +message TestMessage { + int32 dummy = 1; +} + service DummyService { } diff --git a/src/objective-c/tests/build_tests.sh b/src/objective-c/tests/build_tests.sh index 496dbcbe600..4b3ed21886c 100755 --- a/src/objective-c/tests/build_tests.sh +++ b/src/objective-c/tests/build_tests.sh @@ -53,25 +53,3 @@ rm -f RemoteTestClient/*.{h,m} echo "TIME: $(date)" pod install -# Verify the output proto name -[ -e ./RemoteTestClient/Test-dash-filename.pbrpc.h ] || { - echo >&2 "protoc outputs wrong filename." - exit 1 -} - -# Verify the output proto name when dash is treated as separator -PROTOC=../../../bins/$CONFIG/protobuf/protoc -PLUGIN=../../../bins/$CONFIG/grpc_objective_c_plugin - -eval $PROTOC \ - --plugin=protoc-gen-grpc=$PLUGIN \ - --objc_out=RemoteTestClient \ - --grpc_out=filename-dash-as-separator:RemoteTestClient \ - -I RemoteTestClient \ - -I ../../../third_party/protobuf/src \ - RemoteTestClient/*.proto - -[ -e ./RemoteTestClient/TestDashFilename.pbrpc.h ] || { - echo >&2 "protoc outputs wring filename. 2" - exit 1 -} diff --git a/src/objective-c/tests/run_tests.sh b/src/objective-c/tests/run_tests.sh index 2432209f4f1..2d61910bbda 100755 --- a/src/objective-c/tests/run_tests.sh +++ b/src/objective-c/tests/run_tests.sh @@ -38,6 +38,38 @@ cd $(dirname $0) # Run the tests server. BINDIR=../../../bins/$CONFIG +PROTOC=$BINDIR/protobuf/protoc +PLUGIN=$BINDIR/grpc_objective_c_plugin + +rm -rf PluginTest/*pb* + +# Verify the output proto filename +eval $PROTOC \ + --plugin=protoc-gen-grpc=$PLUGIN \ + --objc_out=PluginTest \ + --grpc_out=PluginTest \ + -I PluginTest \ + -I ../../../third_party/protobuf/src \ + PluginTest/*.proto + +[ -e ./PluginTest/TestDashFilename.pbrpc.h ] || { + echo >&2 "protoc outputs wrong filename." + exit 1 +} + +# Verify names of the imported protos in generated code +[ "`cat PluginTest/TestDashFilename.pbrpc.h | + egrep '#import ".*\.pb(objc|rpc)\.h"$' | + egrep '-'`" ] && { + echo >&2 "protoc generated import with wrong filename." + exit 1 +} +[ "`cat PluginTest/TestDashFilename.pbrpc.m | + egrep '#import ".*\.pb(objc|rpc)\.m"$' | + egrep '-'`" ] && { + echo >&2 "protoc generated import with wrong filename." + exit 1 +} [ -f $BINDIR/interop_server ] || { echo >&2 "Can't find the test server. Make sure run_tests.py is making" \ From d044281286961f6f26f09fb4ba34a32603b021b0 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 8 Jun 2017 10:06:39 -0700 Subject: [PATCH 30/51] Revert the changes to maintain backward compatibility --- src/compiler/objective_c_generator_helpers.h | 9 ++------- src/compiler/objective_c_plugin.cc | 21 ++++---------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index 6fdb942387f..3ebd1b14447 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -46,13 +46,8 @@ using ::grpc::protobuf::FileDescriptor; using ::grpc::protobuf::ServiceDescriptor; using ::grpc::string; -inline string MessageHeaderName(const FileDescriptor *file, - bool dash_as_separator) { - if (dash_as_separator) { - return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h"; - } else { - return grpc_generator::FileNameInUpperCamel(file) + ".pbobjc.h"; - } +inline string MessageHeaderName(const FileDescriptor *file) { + return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h"; } inline string ServiceClassName(const ServiceDescriptor *service) { diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index ff980ae5499..466da4c3b48 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -32,10 +32,6 @@ */ // Generates Objective C gRPC service interface out of Protobuf IDL. -// For legacy reason, output filename of this plugin is by default in uppercamel -// case with dash "-" treated as character and preserved in the output file -// name. If normal upper camel case (dash treated as word separator) is desired, -// use plugin option "filename-dash-as-separator". #include @@ -63,17 +59,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return true; } - ::grpc::string file_name; - - // Simple parameter parsing as we have only one parameter. - // TODO(mxyan): Complete parameter parsing. - bool dash_as_separator = - (0 == parameter.compare("filename-dash-as-separator")); - if (dash_as_separator) { - file_name = google::protobuf::compiler::objectivec::FilePath(file); - } else { - file_name = grpc_generator::FileNameInUpperCamel(file); - } + ::grpc::string file_name = + google::protobuf::compiler::objectivec::FilePath(file); ::grpc::string prefix = file->options().objc_class_prefix(); { @@ -90,8 +77,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { // and import the files in the .pbrpc.m ::grpc::string proto_imports; for (int i = 0; i < file->dependency_count(); i++) { - ::grpc::string header = grpc_objective_c_generator::MessageHeaderName( - file->dependency(i), dash_as_separator); + ::grpc::string header = + grpc_objective_c_generator::MessageHeaderName(file->dependency(i)); const grpc::protobuf::FileDescriptor *dependency = file->dependency(i); if (IsProtobufLibraryBundledProtoFile(dependency)) { ::grpc::string base_name = header; From bf91d9bbf74c8b923d41643868adbd2105954e81 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 9 Jun 2017 13:04:28 -0700 Subject: [PATCH 31/51] Node: add test for reconnecting client after server restart --- src/node/test/surface_test.js | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js index f8eaf62aaff..11577e797d9 100644 --- a/src/node/test/surface_test.js +++ b/src/node/test/surface_test.js @@ -1378,3 +1378,50 @@ describe('Cancelling surface client', function() { call.cancel(); }); }); +describe('Client reconnect', function() { + var server; + var Client; + var client; + var port; + beforeEach(function() { + var test_proto = ProtoBuf.loadProtoFile(__dirname + '/echo_service.proto'); + var echo_service = test_proto.lookup('EchoService'); + Client = grpc.loadObject(echo_service); + server = new grpc.Server(); + server.addService(Client.service, { + echo: function(call, callback) { + callback(null, call.request); + } + }); + port = server.bind('localhost:0', server_insecure_creds); + client = new Client('localhost:' + port, grpc.credentials.createInsecure()); + server.start(); + }); + afterEach(function() { + server.forceShutdown(); + }); + it('should reconnect after server restart', function(done) { + client.echo({value: 'test value', value2: 3}, function(error, response) { + assert.ifError(error); + assert.deepEqual(response, {value: 'test value', value2: 3}); + server.tryShutdown(function() { + server = new grpc.Server(); + server.addService(Client.service, { + echo: function(call, callback) { + callback(null, call.request); + } + }); + server.bind('localhost:' + port, server_insecure_creds); + server.start(); + client.echo(undefined, function(error, response) { + if (error) { + console.log(error); + } + assert.ifError(error); + assert.deepEqual(response, {value: '', value2: 0}); + done(); + }); + }); + }); + }); +}); From fcf61267e55b91a4ca708e57e6634e4db4057bb1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 10 Jun 2017 08:58:11 +0200 Subject: [PATCH 32/51] add pregen VS project deprecation info --- INSTALL.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 5406fec84db..9526a8637bf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -89,17 +89,19 @@ gRPC C Core library. There are several ways to build under Windows, of varying complexity depending on experience with the tools involved. -### Pre-generated Visual Studio solution -The pre-generated VS projects & solution are checked into the repository under the [vsprojects](/vsprojects) directory. -### Building using CMake (with BoringSSL) +### Building using CMake (RECOMMENDED) + +Builds gRPC C and C++ with boringssl. - Install [CMake](https://cmake.org/download/). - Install [Active State Perl](http://www.activestate.com/activeperl/) (`choco install activeperl`) - Install [Ninja](https://ninja-build.org/) (`choco install ninja`) - Install [Go](https://golang.org/dl/) (`choco install golang`) - Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`) - Run these commands in the repo root directory + +Using Ninja (faster build, supports boringssl's assembly optimizations) ``` > md .build > cd .build @@ -107,7 +109,14 @@ The pre-generated VS projects & solution are checked into the repository under t > cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release > cmake --build . ``` -NOTE: Currently you can only use Ninja to build using cmake on Windows (because of the boringssl dependency). + +Using Visual Studio 2015 (can only build with OPENSSL_NO_ASM) +``` +> md .build +> cd .build +> cmake .. -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=Release +> cmake --build . +``` ### msys2 (with mingw) @@ -131,3 +140,9 @@ MINGW64$ make NOTE: While most of the make targets are buildable under Mingw, some haven't been ported to Windows yet and may fail to build (mostly trying to include POSIX headers not available on Mingw). + +### Pre-generated Visual Studio solution (DEPRECATED) + +*WARNING: This used to be the recommended way to build on Windows, but because of significant limitations (hard to build dependencies including boringssl, .proto codegen is hard to support, ..), it is no longer recommended. Use cmake to build on Windows instead.* + +The pre-generated VS projects & solution are checked into the repository under the [vsprojects](/vsprojects) directory. From 8b26317f01159b4a818267676f9e87471ecc9e2a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 10 Jun 2017 09:21:53 +0200 Subject: [PATCH 33/51] add vsprojects deprecation notice --- vsprojects/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vsprojects/README.md b/vsprojects/README.md index 1f0cdc24ba7..b389cf88d26 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -1,5 +1,15 @@ + + # Pre-generated MS Visual Studio project & solution files +**DEPRECATED, please use cmake instead (it can generate Visual Studio projects for you). We will continue providing pre-generated VS projects for a while, but we will likely get rid of them entirely at some point.** + +**Pre-generated MS Visual Studio projects used to be the recommended way to build on Windows, but there were some limitations:** +- **hard to build dependencies, expecially boringssl (deps usually support cmake quite well)** +- **the nuget-based openssl & zlib dependencies are hard to maintain and update. We've received issues indicating that they are flawed.** +- **.proto codegen is hard to support in Visual Studio directly (but we have a pretty decent support in cmake)** +- **It's a LOT of generated files. We prefer not to have too much generated code in our github repo.** + Versions 2013 and 2015 are both supported. You can use [their respective community editions](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). From 9d6316cc5b8b8969940b3c6b387e75a6065d0ba3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 10 Jun 2017 09:22:44 +0200 Subject: [PATCH 34/51] fixup --- vsprojects/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/vsprojects/README.md b/vsprojects/README.md index b389cf88d26..4b6608ba938 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -1,5 +1,3 @@ - - # Pre-generated MS Visual Studio project & solution files **DEPRECATED, please use cmake instead (it can generate Visual Studio projects for you). We will continue providing pre-generated VS projects for a while, but we will likely get rid of them entirely at some point.** From 035f7e4839c272ef48c0c14c8dbf719e3a52a624 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 12 Jun 2017 09:35:31 -0700 Subject: [PATCH 35/51] Modify copyright information --- .../tests/PluginTest/imported-with-dash.proto | 36 +++++------------- .../tests/PluginTest/test-dash-filename.proto | 38 +++++-------------- 2 files changed, 20 insertions(+), 54 deletions(-) diff --git a/src/objective-c/tests/PluginTest/imported-with-dash.proto b/src/objective-c/tests/PluginTest/imported-with-dash.proto index 0c4ee3827ad..c01bbecc070 100644 --- a/src/objective-c/tests/PluginTest/imported-with-dash.proto +++ b/src/objective-c/tests/PluginTest/imported-with-dash.proto @@ -1,32 +1,16 @@ -// Copyright 2017, Google Inc. -// All rights reserved. +// Copyright 2017 gRPC authors. // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: +// 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 // -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. +// http://www.apache.org/licenses/LICENSE-2.0 // -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - +// 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"; package grpc.testing; diff --git a/src/objective-c/tests/PluginTest/test-dash-filename.proto b/src/objective-c/tests/PluginTest/test-dash-filename.proto index be9386f9608..afbb6035df0 100644 --- a/src/objective-c/tests/PluginTest/test-dash-filename.proto +++ b/src/objective-c/tests/PluginTest/test-dash-filename.proto @@ -1,34 +1,16 @@ -// Copyright 2017, Google Inc. -// All rights reserved. +// Copyright 2017 gRPC authors. // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: +// 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 // -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. +// http://www.apache.org/licenses/LICENSE-2.0 // -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. +// 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"; package grpc.testing; From 6fe1d803359fdf48813602521cd6c1a3b09e75bf Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 12 Jun 2017 11:37:40 +0200 Subject: [PATCH 36/51] explicitly use built protoc for CMake build --- CMakeLists.txt | 2 +- templates/CMakeLists.txt.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a60786458b1..a0ac4f6e62c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,7 +304,7 @@ function(protobuf_generate_grpc_cpp) "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" - COMMAND ${_gRPC_PROTOBUF_PROTOC} + COMMAND $ ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} --cpp_out=${_gRPC_PROTO_GENS_DIR} --plugin=protoc-gen-grpc=$ diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 71509c416bd..1ae6089bf68 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -349,7 +349,7 @@ <%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" <%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" <%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" - COMMAND <%text>${_gRPC_PROTOBUF_PROTOC} + COMMAND <%text>$ ARGS --grpc_out=<%text>generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} --cpp_out=<%text>${_gRPC_PROTO_GENS_DIR} --plugin=protoc-gen-grpc=$ From 807693bd89832a75d6678a94226f4f6276fe2343 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 12 Jun 2017 10:15:27 +0200 Subject: [PATCH 37/51] cmake: add zlib and cares dep --- CMakeLists.txt | 4 ++++ templates/CMakeLists.txt.template | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a60786458b1..1248f096a91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1487,6 +1487,8 @@ target_include_directories(grpc_cronet target_link_libraries(grpc_cronet ${_gRPC_BASELIB_LIBRARIES} ${_gRPC_SSL_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_CARES_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} gpr ) @@ -2075,6 +2077,8 @@ target_include_directories(grpc_unsecure target_link_libraries(grpc_unsecure ${_gRPC_BASELIB_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_CARES_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} gpr ) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 71509c416bd..53ae543c4c5 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -43,7 +43,7 @@ deps.append("${_gRPC_SSL_LIBRARIES}") if target_dict.language == 'c++': deps.append("${_gRPC_PROTOBUF_LIBRARIES}") - if target_dict['name'] in ['grpc']: + if target_dict['name'] in ['grpc', 'grpc_cronet', 'grpc_unsecure']: deps.append("${_gRPC_ZLIB_LIBRARIES}") deps.append("${_gRPC_CARES_LIBRARIES}") deps.append("${_gRPC_ALLTARGETS_LIBRARIES}") From 0b0d9d47a6b96938c8ff9af9bbc9261f2d9230c4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 13 Jun 2017 09:55:59 +0200 Subject: [PATCH 38/51] make use of --build_only apparent --- tools/run_tests/run_tests_matrix.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 0fe3b37d4b6..96e865b0c0e 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -102,6 +102,8 @@ def _generate_jobs(languages, configs, platforms, iomgr_platform = 'native', name += '_%s_%s' % (arch, compiler) runtests_args += ['--arch', arch, '--compiler', compiler] + if '--build_only' in extra_args: + name += '_buildonly' for extra_env in extra_envs: name += '_%s_%s' % (extra_env, extra_envs[extra_env]) From 8f596ae2cdb3d3bc2a4c1885467df91cfd01f841 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 13 Jun 2017 10:41:11 -0700 Subject: [PATCH 39/51] Change bound port to get Node distrib tests to work again --- test/distrib/node/run_distrib_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/distrib/node/run_distrib_test.sh b/test/distrib/node/run_distrib_test.sh index d429eb27e18..4bd02112fe3 100755 --- a/test/distrib/node/run_distrib_test.sh +++ b/test/distrib/node/run_distrib_test.sh @@ -49,8 +49,8 @@ npm install -g node-static STATIC_SERVER=127.0.0.1 # If port_server is running, get port from that. Otherwise, assume we're in -# docker and use 8080 -STATIC_PORT=$(curl 'localhost:32767/get' || echo '8080') +# docker and use 12345 +STATIC_PORT=$(curl 'localhost:32767/get' || echo '12345') # Serves the input_artifacts directory statically at localhost: static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT & From 976b743d0af6408292f7ceb7494d0c5b93d93ee0 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Wed, 14 Jun 2017 12:14:34 -0700 Subject: [PATCH 40/51] Delete unnecessary Kokoro shell scripts --- .../sanitizer/pull_request/grpc_c_asan.sh | 23 ------------------- .../sanitizer/pull_request/grpc_c_msan.sh | 23 ------------------- .../sanitizer/pull_request/grpc_c_tsan.sh | 23 ------------------- .../sanitizer/pull_request/grpc_c_ubsan.sh | 23 ------------------- .../sanitizer/pull_request/grpc_cpp_asan.sh | 23 ------------------- .../sanitizer/pull_request/grpc_cpp_tsan.sh | 23 ------------------- 6 files changed, 138 deletions(-) delete mode 100755 tools/internal_ci/linux/sanitizer/pull_request/grpc_c_asan.sh delete mode 100755 tools/internal_ci/linux/sanitizer/pull_request/grpc_c_msan.sh delete mode 100755 tools/internal_ci/linux/sanitizer/pull_request/grpc_c_tsan.sh delete mode 100755 tools/internal_ci/linux/sanitizer/pull_request/grpc_c_ubsan.sh delete mode 100755 tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_asan.sh delete mode 100755 tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_tsan.sh diff --git a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_asan.sh b/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_asan.sh deleted file mode 100755 index 859b03d8ef6..00000000000 --- a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_asan.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2017 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. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -tools/run_tests/run_tests_matrix.py -f c asan --inner_jobs 16 -j 1 --internal_ci --filter_pr_tests --base_branch origin/master --max_time=3600 diff --git a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_msan.sh b/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_msan.sh deleted file mode 100755 index b64148fcd05..00000000000 --- a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_msan.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2017 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. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -tools/run_tests/run_tests_matrix.py -f c msan --inner_jobs 16 -j 1 --internal_ci --filter_pr_tests --base_branch origin/master --max_time=3600 diff --git a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_tsan.sh b/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_tsan.sh deleted file mode 100755 index 4fe0637c3cc..00000000000 --- a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_tsan.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2017 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. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -tools/run_tests/run_tests_matrix.py -f c tsan --inner_jobs 16 -j 1 --internal_ci --filter_pr_tests --base_branch origin/master --max_time=3600 diff --git a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_ubsan.sh b/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_ubsan.sh deleted file mode 100755 index af57f6e1e50..00000000000 --- a/tools/internal_ci/linux/sanitizer/pull_request/grpc_c_ubsan.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2017 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. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -tools/run_tests/run_tests_matrix.py -f c ubsan --inner_jobs 16 -j 1 --internal_ci --filter_pr_tests --base_branch origin/master --max_time=3600 diff --git a/tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_asan.sh b/tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_asan.sh deleted file mode 100755 index 59f1799c45a..00000000000 --- a/tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_asan.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2017 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. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -tools/run_tests/run_tests_matrix.py -f c++ asan --inner_jobs 16 -j 1 --internal_ci --filter_pr_tests --base_branch origin/master --max_time=3600 diff --git a/tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_tsan.sh b/tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_tsan.sh deleted file mode 100755 index fb1aae7056e..00000000000 --- a/tools/internal_ci/linux/sanitizer/pull_request/grpc_cpp_tsan.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2017 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. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -tools/run_tests/run_tests_matrix.py -f c++ tsan --inner_jobs 16 -j 1 --internal_ci --filter_pr_tests --base_branch origin/master --max_time=3600 From 8d69a2fea85dbfc499e56b5e1abb3bbe27980086 Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 15 Jun 2017 10:26:12 -0700 Subject: [PATCH 41/51] correct channel arg constructor calls in ruby channel creds test --- src/ruby/spec/channel_credentials_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruby/spec/channel_credentials_spec.rb b/src/ruby/spec/channel_credentials_spec.rb index 058168a473e..e53f3162080 100644 --- a/src/ruby/spec/channel_credentials_spec.rb +++ b/src/ruby/spec/channel_credentials_spec.rb @@ -20,7 +20,7 @@ describe GRPC::Core::ChannelCredentials do def load_test_certs test_root = File.join(File.dirname(__FILE__), 'testdata') - files = ['ca.pem', 'server1.pem', 'server1.key'] + files = ['ca.pem', 'server1.key', 'server1.pem'] files.map { |f| File.open(File.join(test_root, f)).read } end From 43b8930b19738b7edb51bb58c0f7b8cb41c1cc78 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 15 Jun 2017 11:41:28 -0700 Subject: [PATCH 42/51] Document use of ${http_proxy} environment variable. --- doc/environment_variables.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/environment_variables.md b/doc/environment_variables.md index 47efb3a1d87..dce434ff30d 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -4,6 +4,10 @@ gRPC environment variables gRPC C core based implementations (those contained in this repository) expose some configuration as environment variables that can be set. +* http_proxy + The URI of the proxy to use for HTTP CONNECT support. Does not currently + support username or password information in the URI. + * GRPC_ABORT_ON_LEAKS A debugging aid to cause a call to abort() when gRPC objects are leaked past grpc_shutdown(). Set to 1 to cause the abort, if unset or 0 it does not From 8961a10ca1d1f31ec314d5df350ead53298d249f Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Fri, 16 Jun 2017 12:29:59 -0700 Subject: [PATCH 43/51] Silence noisy cache_discovery warning --- tools/gcp/utils/big_query_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gcp/utils/big_query_utils.py b/tools/gcp/utils/big_query_utils.py index efc5c1839f8..76c86645b76 100755 --- a/tools/gcp/utils/big_query_utils.py +++ b/tools/gcp/utils/big_query_utils.py @@ -31,7 +31,7 @@ def create_big_query(): """Authenticates with cloud platform and gets a BiqQuery service object """ creds = GoogleCredentials.get_application_default() - return discovery.build('bigquery', 'v2', credentials=creds) + return discovery.build('bigquery', 'v2', credentials=creds, cache_discovery=False) def create_dataset(biq_query, project_id, dataset_id): From 60a672b87f96aabec551d0d0e6e29b67dcc47d12 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Fri, 16 Jun 2017 14:28:06 -0700 Subject: [PATCH 44/51] Clear alarms in jobset.py when finished running jobs --- tools/run_tests/python_utils/jobset.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py index b56cce1a504..044c6f3aa4f 100755 --- a/tools/run_tests/python_utils/jobset.py +++ b/tools/run_tests/python_utils/jobset.py @@ -473,6 +473,8 @@ class Jobset(object): while self._running: if self.cancelled(): pass # poll cancellation self.reap() + if platform_string() != 'windows': + signal.alarm(0) return not self.cancelled() and self._failures == 0 From f7c90fd521bf8417fa345c308d2912cb97c818ad Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 18 May 2017 16:38:35 +0200 Subject: [PATCH 45/51] Add grpc dependency where grpc++ is used --- build.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.yaml b/build.yaml index 7ab1cee2630..e55c4ca3012 100644 --- a/build.yaml +++ b/build.yaml @@ -1037,6 +1037,7 @@ filegroups: - include/grpc++/test/server_context_test_spouse.h deps: - grpc++ + - grpc libs: - name: gpr build: all @@ -1287,6 +1288,7 @@ libs: - test/cpp/util/proto_reflection_descriptor_database.cc deps: - grpc++ + - grpc filegroups: - grpc++_reflection_proto - grpc++_config_proto @@ -1302,6 +1304,7 @@ libs: - src/cpp/ext/proto_server_reflection_plugin.cc deps: - grpc++ + - grpc filegroups: - grpc++_reflection_proto - name: grpc++_test_config @@ -1335,6 +1338,7 @@ libs: deps: - grpc++ - grpc_test_util + - grpc filegroups: - grpc++_codegen_base - grpc++_codegen_base_src @@ -1392,6 +1396,7 @@ libs: deps: - grpc++_proto_reflection_desc_db - grpc++ + - grpc filegroups: - grpc++_reflection_proto - grpc++_config_proto @@ -1556,6 +1561,7 @@ libs: - grpc_test_util - grpc++_test_util - grpc++ + - grpc - name: grpc_csharp_ext build: all language: csharp @@ -3726,6 +3732,7 @@ targets: - test/cpp/util/string_ref_test.cc deps: - grpc++ + - grpc - name: cxx_time_test gtest: true build: test From b77a20b64bd8e0635b97310b2abcce0b0d511b34 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 18 May 2017 16:45:07 +0200 Subject: [PATCH 46/51] regenerate projects --- CMakeLists.txt | 6 ++++++ Makefile | 16 ++++++++-------- .../run_tests/generated/sources_and_headers.json | 7 +++++++ .../grpc++_proto_reflection_desc_db.vcxproj | 3 +++ .../grpc++_reflection/grpc++_reflection.vcxproj | 3 +++ .../grpc++_test_util/grpc++_test_util.vcxproj | 3 +++ .../vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj | 3 +++ vsprojects/vcxproj/qps/qps.vcxproj | 3 +++ .../cxx_string_ref_test.vcxproj | 3 +++ 9 files changed, 39 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b3c8505a02..22a5cd159b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2931,6 +2931,7 @@ target_link_libraries(grpc++_proto_reflection_desc_db ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ + grpc ) foreach(_hdr @@ -2989,6 +2990,7 @@ target_link_libraries(grpc++_reflection ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ + grpc ) foreach(_hdr @@ -3133,6 +3135,7 @@ target_link_libraries(grpc++_test_util ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ grpc_test_util + grpc ) foreach(_hdr @@ -3491,6 +3494,7 @@ target_link_libraries(grpc_cli_libs ${_gRPC_ALLTARGETS_LIBRARIES} grpc++_proto_reflection_desc_db grpc++ + grpc ) foreach(_hdr @@ -4029,6 +4033,7 @@ target_link_libraries(qps grpc_test_util grpc++_test_util grpc++ + grpc ) @@ -9991,6 +9996,7 @@ target_link_libraries(cxx_string_ref_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ + grpc ${_gRPC_GFLAGS_LIBRARIES} ) diff --git a/Makefile b/Makefile index 75f75da3241..c7890cb8d53 100644 --- a/Makefile +++ b/Makefile @@ -4924,18 +4924,18 @@ endif ifeq ($(SYSTEM),MINGW32) -$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(OPENSSL_DEP) +$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++$(SHARED_VERSION_CPP)-dll + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++$(SHARED_VERSION_CPP)-dll -lgrpc$(SHARED_VERSION_CORE)-dll else -$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT_CPP) $(OPENSSL_DEP) +$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` ifeq ($(SYSTEM),Darwin) - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ -lgrpc else - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_reflection.so.1 -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_reflection.so.1 -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ -lgrpc $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so endif @@ -14370,16 +14370,16 @@ $(BINDIR)/$(CONFIG)/cxx_string_ref_test: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/cxx_string_ref_test: $(PROTOBUF_DEP) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a +$(BINDIR)/$(CONFIG)/cxx_string_ref_test: $(PROTOBUF_DEP) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cxx_string_ref_test + $(Q) $(LDXX) $(LDFLAGS) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cxx_string_ref_test endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/util/string_ref_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a +$(OBJDIR)/$(CONFIG)/test/cpp/util/string_ref_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a deps_cxx_string_ref_test: $(CXX_STRING_REF_TEST_OBJS:.o=.dep) diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 16ff417a277..956f45fc2d0 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -3049,6 +3049,7 @@ }, { "deps": [ + "grpc", "grpc++" ], "headers": [], @@ -6080,6 +6081,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_config_proto", "grpc++_reflection_proto" @@ -6099,6 +6101,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_reflection_proto" ], @@ -6135,6 +6138,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_codegen_base", "grpc++_codegen_base_src", @@ -6229,6 +6233,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_config_proto", "grpc++_proto_reflection_desc_db", @@ -6480,6 +6485,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_test_util", "grpc_test_util" @@ -9336,6 +9342,7 @@ }, { "deps": [ + "grpc", "grpc++" ], "headers": [ diff --git a/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj b/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj index 453b483fdea..853b58455dd 100644 --- a/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj +++ b/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj @@ -168,6 +168,9 @@ {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + diff --git a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj index da4c6857764..91137c124cb 100644 --- a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj +++ b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj @@ -170,6 +170,9 @@ {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj index 49582188216..ed9190dbe31 100644 --- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj @@ -261,6 +261,9 @@ {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + diff --git a/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj b/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj index c97c7dcb3db..ba97f97e1d3 100644 --- a/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj +++ b/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj @@ -184,6 +184,9 @@ {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + diff --git a/vsprojects/vcxproj/qps/qps.vcxproj b/vsprojects/vcxproj/qps/qps.vcxproj index 6e290f4557d..b7758952f1c 100644 --- a/vsprojects/vcxproj/qps/qps.vcxproj +++ b/vsprojects/vcxproj/qps/qps.vcxproj @@ -231,6 +231,9 @@ {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + diff --git a/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj b/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj index 8d9989557fb..18993f5e9ab 100644 --- a/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj +++ b/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj @@ -167,6 +167,9 @@ {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + From 24e820762a9c6b8a5c4179ea39571d0f1a3b5d2c Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 14 Jun 2017 19:56:29 -0700 Subject: [PATCH 47/51] Add json out flag to qps driver --- test/cpp/qps/qps_json_driver.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index a946992100f..6fcdaeb9741 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -17,6 +17,7 @@ */ #include +#include #include #include @@ -57,6 +58,9 @@ DEFINE_string(qps_server_target_override, "", "Override QPS server target to configure in client configs." "Only applicable if there is a single benchmark server."); +DEFINE_string(json_file_out, "", + "File to write the JSON output to."); + namespace grpc { namespace testing { @@ -88,6 +92,13 @@ static std::unique_ptr RunAndReport(const Scenario& scenario, *success = result->server_success(i); } + if (FLAGS_json_file_out != "") { + std::ofstream json_outfile; + json_outfile.open(FLAGS_json_file_out); + json_outfile << "{\"qps\": " << result->summary().qps() << "}\n"; + json_outfile.close(); + } + return result; } From dc1b51e6b380ecea72622aca9c6677dfab556a13 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 19 Jun 2017 09:00:25 -0700 Subject: [PATCH 48/51] clang fmt --- test/cpp/qps/qps_json_driver.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index 6fcdaeb9741..590c22ec29f 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -16,8 +16,8 @@ * */ -#include #include +#include #include #include @@ -58,8 +58,7 @@ DEFINE_string(qps_server_target_override, "", "Override QPS server target to configure in client configs." "Only applicable if there is a single benchmark server."); -DEFINE_string(json_file_out, "", - "File to write the JSON output to."); +DEFINE_string(json_file_out, "", "File to write the JSON output to."); namespace grpc { namespace testing { From 45e161b1c9cd48c769ce8977114bf1f057dd4bb3 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 16 Jun 2017 15:12:13 -0700 Subject: [PATCH 49/51] Make threshold toggleable --- tools/profiling/microbenchmarks/bm_diff/bm_diff.py | 2 +- tools/profiling/microbenchmarks/bm_diff/bm_speedup.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py index 73abf90ff52..ec1840e2a10 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py @@ -108,7 +108,7 @@ class Benchmark: mdn_diff = abs(_median(new) - _median(old)) _maybe_print('%s: %s=%r %s=%r mdn_diff=%r' % (f, new_name, new, old_name, old, mdn_diff)) - s = bm_speedup.speedup(new, old) + s = bm_speedup.speedup(new, old, 1e-10) if abs(s) > 3 and mdn_diff > 0.5: self.final[f] = '%+d%%' % s return self.final.keys() diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py index 3d126efa62b..5bff8d0ca9d 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py @@ -17,8 +17,6 @@ from scipy import stats import math -_THRESHOLD = 1e-10 - def scale(a, mul): return [x * mul for x in a] @@ -28,18 +26,18 @@ def cmp(a, b): return stats.ttest_ind(a, b) -def speedup(new, old): +def speedup(new, old, threshold): if (len(set(new))) == 1 and new == old: return 0 s0, p0 = cmp(new, old) if math.isnan(p0): return 0 if s0 == 0: return 0 - if p0 > _THRESHOLD: return 0 + if p0 > threshold: return 0 if s0 < 0: pct = 1 while pct < 101: sp, pp = cmp(new, scale(old, 1 - pct / 100.0)) if sp > 0: break - if pp > _THRESHOLD: break + if pp > threshold: break pct += 1 return -(pct - 1) else: @@ -47,7 +45,7 @@ def speedup(new, old): while pct < 100000: sp, pp = cmp(new, scale(old, 1 + pct / 100.0)) if sp < 0: break - if pp > _THRESHOLD: break + if pp > threshold: break pct += 1 return pct - 1 From 3345e1ccf766d813dcd0f07324214cf623725ff0 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 19 Jun 2017 09:28:22 -0700 Subject: [PATCH 50/51] Actually enable trickle diff --- tools/jenkins/run_trickle_diff.sh | 2 +- .../microbenchmarks/bm_diff/bm_constants.py | 5 ++-- .../microbenchmarks/bm_diff/bm_diff.py | 29 +++++++++---------- .../microbenchmarks/bm_diff/bm_speedup.py | 12 ++++---- tools/profiling/microbenchmarks/bm_json.py | 2 ++ 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/tools/jenkins/run_trickle_diff.sh b/tools/jenkins/run_trickle_diff.sh index da905d02490..47dd8b44d64 100755 --- a/tools/jenkins/run_trickle_diff.sh +++ b/tools/jenkins/run_trickle_diff.sh @@ -20,4 +20,4 @@ set -ex cd $(dirname $0)/../.. tools/run_tests/start_port_server.py -tools/profiling/microbenchmarks/bm_diff/bm_main.py -d origin/$ghprbTargetBranch -b bm_fullstack_trickle -l 4 -t cli_transport_stalls cli_stream_stalls svr_transport_stalls svr_stream_stalls --no-counters --pr_comment_name trickle +tools/profiling/microbenchmarks/bm_diff/bm_main.py -d origin/$ghprbTargetBranch -b bm_fullstack_trickle -l 4 -t cli_transport_stalls_per_iteration cli_stream_stalls_per_iteration svr_transport_stalls_per_iteration svr_stream_stalls_per_iteration --no-counters --pr_comment_name trickle diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py index 4cd65867c37..ad79a0a1972 100644 --- a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py @@ -26,5 +26,6 @@ _AVAILABLE_BENCHMARK_TESTS = [ _INTERESTING = ('cpu_time', 'real_time', 'locks_per_iteration', 'allocs_per_iteration', 'writes_per_iteration', 'atm_cas_per_iteration', 'atm_add_per_iteration', - 'nows_per_iteration', 'cli_transport_stalls', 'cli_stream_stalls', - 'svr_transport_stalls', 'svr_stream_stalls',) + 'nows_per_iteration', 'cli_transport_stalls_per_iteration', + 'cli_stream_stalls_per_iteration', 'svr_transport_stalls_per_iteration', + 'svr_stream_stalls_per_iteration',) diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py index ec1840e2a10..809817a1a8c 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py @@ -108,9 +108,10 @@ class Benchmark: mdn_diff = abs(_median(new) - _median(old)) _maybe_print('%s: %s=%r %s=%r mdn_diff=%r' % (f, new_name, new, old_name, old, mdn_diff)) - s = bm_speedup.speedup(new, old, 1e-10) - if abs(s) > 3 and mdn_diff > 0.5: - self.final[f] = '%+d%%' % s + s = bm_speedup.speedup(new, old, 1e-5) + if abs(s) > 3: + if mdn_diff > 0.5 or 'trickle' in f: + self.final[f] = '%+d%%' % s return self.final.keys() def skip(self): @@ -172,18 +173,16 @@ def diff(bms, loops, track, old, new, counters): js_new_ctr = None js_old_ctr = None - if js_new_ctr: - for row in bm_json.expand_json(js_new_ctr, js_new_opt): - name = row['cpp_name'] - if name.endswith('_mean') or name.endswith('_stddev'): - continue - benchmarks[name].add_sample(track, row, True) - if js_old_ctr: - for row in bm_json.expand_json(js_old_ctr, js_old_opt): - name = row['cpp_name'] - if name.endswith('_mean') or name.endswith('_stddev'): - continue - benchmarks[name].add_sample(track, row, False) + for row in bm_json.expand_json(js_new_ctr, js_new_opt): + name = row['cpp_name'] + if name.endswith('_mean') or name.endswith('_stddev'): + continue + benchmarks[name].add_sample(track, row, True) + for row in bm_json.expand_json(js_old_ctr, js_old_opt): + name = row['cpp_name'] + if name.endswith('_mean') or name.endswith('_stddev'): + continue + benchmarks[name].add_sample(track, row, False) really_interesting = set() for name, bm in benchmarks.items(): diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py index 5bff8d0ca9d..4bf59fb2808 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py @@ -34,7 +34,7 @@ def speedup(new, old, threshold): if p0 > threshold: return 0 if s0 < 0: pct = 1 - while pct < 101: + while pct < 100: sp, pp = cmp(new, scale(old, 1 - pct / 100.0)) if sp > 0: break if pp > threshold: break @@ -42,7 +42,7 @@ def speedup(new, old, threshold): return -(pct - 1) else: pct = 1 - while pct < 100000: + while pct < 10000: sp, pp = cmp(new, scale(old, 1 + pct / 100.0)) if sp < 0: break if pp > threshold: break @@ -51,7 +51,7 @@ def speedup(new, old, threshold): if __name__ == "__main__": - new = [1.0, 1.0, 1.0, 1.0] - old = [2.0, 2.0, 2.0, 2.0] - print speedup(new, old) - print speedup(old, new) + new = [0.0, 0.0, 0.0, 0.0] + old=[2.96608e-06, 3.35076e-06, 3.45384e-06, 3.34407e-06] + print speedup(new, old, 1e-5) + print speedup(old, new, 1e-5) diff --git a/tools/profiling/microbenchmarks/bm_json.py b/tools/profiling/microbenchmarks/bm_json.py index 062611f1c76..930287e0d69 100644 --- a/tools/profiling/microbenchmarks/bm_json.py +++ b/tools/profiling/microbenchmarks/bm_json.py @@ -167,6 +167,8 @@ def parse_name(name): return out def expand_json(js, js2 = None): + assert(js or js2) + if not js: js = js2 for bm in js['benchmarks']: if bm['name'].endswith('_stddev') or bm['name'].endswith('_mean'): continue context = js['context'] From 65fe1abed281fd911382d40fca72d79c14e9960a Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 19 Jun 2017 14:30:33 -0700 Subject: [PATCH 51/51] Address github comments --- tools/profiling/microbenchmarks/bm_diff/bm_speedup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py index 4bf59fb2808..63e691af02f 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py @@ -17,6 +17,7 @@ from scipy import stats import math +_DEFAULT_THRESHOLD = 1e-10 def scale(a, mul): return [x * mul for x in a] @@ -26,7 +27,7 @@ def cmp(a, b): return stats.ttest_ind(a, b) -def speedup(new, old, threshold): +def speedup(new, old, threshold = _DEFAULT_THRESHOLD): if (len(set(new))) == 1 and new == old: return 0 s0, p0 = cmp(new, old) if math.isnan(p0): return 0 @@ -52,6 +53,6 @@ def speedup(new, old, threshold): if __name__ == "__main__": new = [0.0, 0.0, 0.0, 0.0] - old=[2.96608e-06, 3.35076e-06, 3.45384e-06, 3.34407e-06] + old = [2.96608e-06, 3.35076e-06, 3.45384e-06, 3.34407e-06] print speedup(new, old, 1e-5) print speedup(old, new, 1e-5)