diff --git a/.gitignore b/.gitignore index 9a1dc008505d5c6a61b6c680a8fcd35085a85c3c..502483f45698907f47c72722070a33c58475f39b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ coverage # cache for run_tests.py .run_tests_cache +.preprocessed_build # emacs temp files *~ diff --git a/.travis.yml b/.travis.yml index d2d1c8ba63994226dc3401323252ca7364fa8951..004d44f3a557b817390803f865b1c813145e120c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode7.1 +osx_image: xcode7.2 env: global: - CONFIG=opt @@ -27,6 +27,6 @@ xcode_scheme: - InteropTestsLocalCleartext # TODO(jcanizales): Investigate why they time out: # - InteropTestsRemote -xcode_sdk: iphonesimulator9.1 +xcode_sdk: iphonesimulator9.2 notifications: email: false diff --git a/INSTALL b/INSTALL index a0df57dcd35c86dd7be149256f91141833f7668b..e33f8970a951afc95766e1bc08cb20b2915df77c 100644 --- a/INSTALL +++ b/INSTALL @@ -141,15 +141,7 @@ Then execute the following for all the needed build dependencies $ make gtest.a gtest_main.a $ sudo cp libgtest.a libgtest_main.a /opt/local/lib $ sudo mkdir /opt/local/include/gtest - $ sudo cp -pr ../gtest-svn/include/gtest /opt/local/include/gtest - -We will also need to make openssl and install it appropriately - - $ cd <git directory> - $ cd third_party/openssl - $ ./config - $ sudo make install - $ cd ../../ + $ sudo cp -pr ../gtest-svn/include/gtest /opt/local/include/gtest If you are going to make changes and need to regenerate the projects file, you will need to install certain modules for python. diff --git a/Makefile b/Makefile index 0ab3696e0e641426b0c274393c37e63303ebef62..941827bf9c5ebf9d91dce48a02330e29e8ecdde7 100644 --- a/Makefile +++ b/Makefile @@ -275,6 +275,12 @@ endif CXX11_CHECK_CMD = $(CXX) -std=c++11 -o $(TMPOUT) -c test/build/c++11.cc HAS_CXX11 = $(shell $(CXX11_CHECK_CMD) 2> /dev/null && echo true || echo false) +CHECK_SHADOW_WORKS_CMD = $(CC) -std=c99 -Werror -Wshadow -o $(TMPOUT) -c test/build/shadow.c +HAS_WORKING_SHADOW = $(shell $(CHECK_SHADOW_WORKS_CMD) 2> /dev/null && echo true || echo false) +ifeq ($(HAS_WORKING_SHADOW),true) +W_SHADOW=-Wshadow +endif + CHECK_NO_SHIFT_NEGATIVE_VALUE_CMD = $(CC) -std=c99 -Werror -Wno-shift-negative-value -o $(TMPOUT) -c test/build/empty.c HAS_NO_SHIFT_NEGATIVE_VALUE = $(shell $(CHECK_NO_SHIFT_NEGATIVE_VALUE_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_NO_SHIFT_NEGATIVE_VALUE),true) @@ -295,7 +301,7 @@ ifdef EXTRA_DEFINES DEFINES += $(EXTRA_DEFINES) endif -CFLAGS += -std=c99 -Wsign-conversion -Wconversion -Wshadow +CFLAGS += -std=c99 -Wsign-conversion -Wconversion $(W_SHADOW) ifeq ($(HAS_CXX11),true) CXXFLAGS += -std=c++11 else @@ -426,6 +432,7 @@ endif OPENSSL_ALPN_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) OPENSSL_NPN_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/openssl-npn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) +BORINGSSL_COMPILE_CHECK_CMD = $(CC) $(CPPFLAGS) -Ithird_party/boringssl/include -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX $(CFLAGS) -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-unknown-pragmas -Wno-implicit-function-declaration -Wno-unused-variable -Wno-sign-compare -o $(TMPOUT) test/build/boringssl.c $(LDFLAGS) ZLIB_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS) PROTOBUF_CHECK_CMD = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS) @@ -510,10 +517,13 @@ HAS_ZOOKEEPER = $(shell $(ZOOKEEPER_CHECK_CMD) 2> /dev/null && echo true || echo # Note that for testing purposes, one can do: # make HAS_EMBEDDED_OPENSSL_ALPN=false # to emulate the fact we do not have OpenSSL in the third_party folder. -ifeq ($(wildcard third_party/boringssl/include/openssl/ssl.h),) +ifneq ($(wildcard third_party/openssl-1.0.2f/libssl.a),) +HAS_EMBEDDED_OPENSSL_ALPN = third_party/openssl-1.0.2f +else ifeq ($(wildcard third_party/boringssl/include/openssl/ssl.h),) HAS_EMBEDDED_OPENSSL_ALPN = false else -HAS_EMBEDDED_OPENSSL_ALPN = true +CAN_COMPILE_EMBEDDED_OPENSSL ?= $(shell $(BORINGSSL_COMPILE_CHECK_CMD) 2> /dev/null && echo true || echo false) +HAS_EMBEDDED_OPENSSL_ALPN = $(CAN_COMPILE_EMBEDDED_OPENSSL) endif ifeq ($(wildcard third_party/zlib/zlib.h),) @@ -572,8 +582,8 @@ ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),true) EMBED_OPENSSL ?= false NO_SECURE ?= false else # HAS_SYSTEM_OPENSSL_ALPN=false -ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true) -EMBED_OPENSSL ?= true +ifneq ($(HAS_EMBEDDED_OPENSSL_ALPN),false) +EMBED_OPENSSL ?= $(HAS_EMBEDDED_OPENSSL_ALPN) NO_SECURE ?= false else # HAS_EMBEDDED_OPENSSL_ALPN=false ifeq ($(HAS_SYSTEM_OPENSSL_NPN),true) @@ -594,6 +604,12 @@ OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/libboringssl.a OPENSSL_MERGE_OBJS += $(LIBBORINGSSL_OBJS) # need to prefix these to ensure overriding system libraries CPPFLAGS := -Ithird_party/boringssl/include $(CPPFLAGS) +else ifneq ($(EMBED_OPENSSL),false) +OPENSSL_DEP += $(EMBED_OPENSSL)/libssl.a $(EMBED_OPENSSL)/libcrypto.a +OPENSSL_MERGE_LIBS += $(EMBED_OPENSSL)/libssl.a $(EMBED_OPENSSL)/libcrypto.a +OPENSSL_MERGE_OBJS += $(wildcard $(EMBED_OPENSSL)/grpc_obj/*.o) +# need to prefix these to ensure overriding system libraries +CPPFLAGS := -I$(EMBED_OPENSSL)/include $(CPPFLAGS) else # EMBED_OPENSSL=false ifeq ($(HAS_PKG_CONFIG),true) OPENSSL_PKG_CONFIG = true @@ -768,8 +784,9 @@ openssl_dep_message: @echo @echo "DEPENDENCY ERROR" @echo - @echo "The target you are trying to run requires OpenSSL." - @echo "Your system doesn't have it, and neither does the third_party directory." + @echo "The target you are trying to run requires an OpenSSL implementation." + @echo "Your system doesn't have one, and either the third_party directory" + @echo "doesn't have it, or your compiler can't build BoringSSL." @echo @echo "Please consult INSTALL to get more information." @echo @@ -13097,3 +13114,7 @@ test/cpp/util/test_credentials_provider.cc: $(OPENSSL_DEP) endif .PHONY: all strip tools dep_error openssl_dep_error openssl_dep_message git_update stop buildtests buildtests_c buildtests_cxx test test_c test_cxx install install_c install_cxx install-headers install-headers_c install-headers_cxx install-shared install-shared_c install-shared_cxx install-static install-static_c install-static_cxx strip strip-shared strip-static strip_c strip-shared_c strip-static_c strip_cxx strip-shared_cxx strip-static_cxx dep_c dep_cxx bins_dep_c bins_dep_cxx clean + +.PHONY: printvars +printvars: + @$(foreach V,$(sort $(.VARIABLES)), $(if $(filter-out environment% default automatic, $(origin $V)),$(warning $V=$($V) ($(value $V))))) diff --git a/PYTHON-MANIFEST.in b/PYTHON-MANIFEST.in index 072089ac51f1442ab2f4d28410e4c4e10615f3f9..25aba87c187d22c3f7ff10b434339ecc6d84c6f2 100644 --- a/PYTHON-MANIFEST.in +++ b/PYTHON-MANIFEST.in @@ -1,4 +1,5 @@ -graft src/python/grpcio/grpc +recursive-include src/python/grpcio/grpc *.c *.h *.py *.pyx *.pxd *.pxi *.python *.pem +recursive-exclude src/python/grpcio/grpc/_cython *.so *.pyd graft src/python/grpcio/tests graft src/core graft include/grpc diff --git a/build.yaml b/build.yaml index bfa2efd94e625c2267e643d9a1ae142d14032b9e..c4bbca6e2ce055de77b581da1fe0f7c9a24299c1 100644 --- a/build.yaml +++ b/build.yaml @@ -1954,6 +1954,7 @@ targets: - linux - posix - name: alarm_cpp_test + gtest: true build: test language: c++ src: @@ -1966,6 +1967,7 @@ targets: - gpr_test_util - gpr - name: async_end2end_test + gtest: true build: test language: c++ src: @@ -2012,6 +2014,7 @@ targets: - linux - posix - name: auth_property_iterator_test + gtest: true build: test language: c++ src: @@ -2024,6 +2027,7 @@ targets: - gpr_test_util - gpr - name: channel_arguments_test + gtest: true build: test language: c++ src: @@ -2033,6 +2037,7 @@ targets: - grpc - gpr - name: cli_call_test + gtest: true build: test language: c++ src: @@ -2045,6 +2050,7 @@ targets: - gpr_test_util - gpr - name: client_crash_test + gtest: true cpu_cost: 0.1 build: test language: c++ @@ -2075,6 +2081,7 @@ targets: - gpr_test_util - gpr - name: credentials_test + gtest: true build: test language: c++ src: @@ -2084,6 +2091,7 @@ targets: - grpc - gpr - name: cxx_byte_buffer_test + gtest: true build: test language: c++ src: @@ -2095,6 +2103,7 @@ targets: - gpr_test_util - gpr - name: cxx_slice_test + gtest: true build: test language: c++ src: @@ -2106,6 +2115,7 @@ targets: - gpr_test_util - gpr - name: cxx_string_ref_test + gtest: true build: test language: c++ src: @@ -2113,6 +2123,7 @@ targets: deps: - grpc++ - name: cxx_time_test + gtest: true build: test language: c++ src: @@ -2124,6 +2135,7 @@ targets: - gpr_test_util - gpr - name: end2end_test + gtest: true cpu_cost: 0.5 build: test language: c++ @@ -2154,6 +2166,7 @@ targets: - linux - posix - name: generic_end2end_test + gtest: true build: test language: c++ src: @@ -2230,6 +2243,7 @@ targets: vs_config_type: Application vs_project_guid: '{069E9D05-B78B-4751-9252-D21EBAE7DE8E}' - name: grpclb_api_test + gtest: true build: test language: c++ src: @@ -2241,6 +2255,7 @@ targets: - grpc++ - grpc - name: hybrid_end2end_test + gtest: true build: test language: c++ src: @@ -2320,6 +2335,7 @@ targets: - gpr - grpc++_test_config - name: mock_test + gtest: true build: test language: c++ src: @@ -2455,6 +2471,7 @@ targets: - gpr - grpc++_test_config - name: secure_auth_context_test + gtest: true build: test language: c++ src: @@ -2484,6 +2501,7 @@ targets: - linux - posix - name: server_crash_test + gtest: true cpu_cost: 0.1 build: test language: c++ @@ -2514,6 +2532,7 @@ targets: - gpr_test_util - gpr - name: shutdown_test + gtest: true build: test language: c++ src: @@ -2537,6 +2556,7 @@ targets: - gpr_test_util - gpr - name: streaming_throughput_test + gtest: true build: test language: c++ src: @@ -2613,6 +2633,7 @@ targets: - linux - posix - name: thread_stress_test + gtest: true cpu_cost: 100 build: test language: c++ @@ -2626,6 +2647,7 @@ targets: - gpr_test_util - gpr - name: zookeeper_test + gtest: true build: test run: false language: c++ @@ -2816,12 +2838,15 @@ node_modules: - src/node/ext/server.cc - src/node/ext/server_credentials.cc - src/node/ext/timeval.cc +openssl_fallback: + base_uri: http://openssl.org/source/ + extraction_dir: openssl-1.0.2f + tarball: openssl-1.0.2f.tar.gz php_config_m4: deps: - grpc - gpr - boringssl - - z headers: - src/php/ext/grpc/byte_buffer.h - src/php/ext/grpc/call.h diff --git a/config.m4 b/config.m4 index 0323d5d2ad3b65392989b1ca104317b44fcd3747..f09ddcb40ec4ee23a3e741e26f94a690c8246861 100644 --- a/config.m4 +++ b/config.m4 @@ -48,11 +48,9 @@ if test "$PHP_GRPC" != "no"; then src/core/support/env_linux.c \ src/core/support/env_posix.c \ src/core/support/env_win32.c \ - src/core/support/file.c \ - src/core/support/file_posix.c \ - src/core/support/file_win32.c \ src/core/support/histogram.c \ src/core/support/host_port.c \ + src/core/support/load_file.c \ src/core/support/log.c \ src/core/support/log_android.c \ src/core/support/log_linux.c \ @@ -78,6 +76,8 @@ if test "$PHP_GRPC" != "no"; then src/core/support/time_precise.c \ src/core/support/time_win32.c \ src/core/support/tls_pthread.c \ + src/core/support/tmpfile_posix.c \ + src/core/support/tmpfile_win32.c \ src/core/support/wrap_memcpy.c \ src/core/census/grpc_context.c \ src/core/census/grpc_filter.c \ @@ -109,7 +109,7 @@ if test "$PHP_GRPC" != "no"; then src/core/client_config/subchannel_factory.c \ src/core/client_config/subchannel_index.c \ src/core/client_config/uri_parser.c \ - src/core/compression/algorithm.c \ + src/core/compression/compression_algorithm.c \ src/core/compression/message_compress.c \ src/core/debug/trace.c \ src/core/httpcli/format_request.c \ @@ -210,7 +210,7 @@ if test "$PHP_GRPC" != "no"; then src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ src/core/httpcli/httpcli_security_connector.c \ - src/core/security/base64.c \ + src/core/security/b64.c \ src/core/security/client_auth_filter.c \ src/core/security/credentials.c \ src/core/security/credentials_metadata.c \ @@ -533,22 +533,73 @@ if test "$PHP_GRPC" != "no"; then third_party/boringssl/ssl/t1_enc.c \ third_party/boringssl/ssl/t1_lib.c \ third_party/boringssl/ssl/tls_record.c \ - third_party/zlib/adler32.c \ - third_party/zlib/compress.c \ - third_party/zlib/crc32.c \ - third_party/zlib/deflate.c \ - third_party/zlib/gzclose.c \ - third_party/zlib/gzlib.c \ - third_party/zlib/gzread.c \ - third_party/zlib/gzwrite.c \ - third_party/zlib/infback.c \ - third_party/zlib/inffast.c \ - third_party/zlib/inflate.c \ - third_party/zlib/inftrees.c \ - third_party/zlib/trees.c \ - third_party/zlib/uncompr.c \ - third_party/zlib/zutil.c \ , $ext_shared, , -Wall -Werror -std=c11 \ -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \ -D_HAS_EXCEPTIONS=0 -DNOMINMAX) + + PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc) + + PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/census) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/channel) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config/lb_policies) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config/resolvers) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/compression) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/debug) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/httpcli) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/iomgr) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/json) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/profiling) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/proto/grpc/lb/v0) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/security) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/support) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/surface) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/transport) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/transport/chttp2) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/aes) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/asn1) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/base64) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bio) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bn) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bn/asm) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/buf) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bytestring) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/chacha) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/cipher) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/cmac) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/conf) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/curve25519) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/des) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/dh) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/digest) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/dsa) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ec) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ecdh) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ecdsa) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/engine) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/err) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/evp) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/hkdf) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/hmac) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/lhash) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/md4) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/md5) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/modes) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/obj) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/pem) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/pkcs8) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/poly1305) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rand) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rc4) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rsa) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/sha) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/stack) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl/pqueue) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb) fi diff --git a/doc/health-checking.md b/doc/health-checking.md index 0b3f9c6a034c43e45859086b5a39d3acb12ab370..92512e942bd90f7d03bd1f3e6db4f48795f0a959 100644 --- a/doc/health-checking.md +++ b/doc/health-checking.md @@ -26,7 +26,7 @@ The server should export a service defined in the following proto: ``` syntax = "proto3"; -package grpc.health.v1alpha; +package grpc.health.v1; message HealthCheckRequest { string service = 1; @@ -49,7 +49,7 @@ service Health { A client can query the server’s health status by calling the `Check` method, and a deadline should be set on the rpc. The client can optionally set the service name it wants to query for health status. The suggested format of service name -is `package_names.ServiceName`, such as `grpc.health.v1alpha.Health`. +is `package_names.ServiceName`, such as `grpc.health.v1.Health`. The server should register all the services manually and set the individual status, including an empty service name and its status. For each diff --git a/examples/csharp/helloworld/.nuget/packages.config b/examples/csharp/helloworld/.nuget/packages.config index 1cbe7e1d65ffdc21cef806cb81315acd267de100..fb778311d1f77f07aa041cf5a28cdc8113dcf799 100644 --- a/examples/csharp/helloworld/.nuget/packages.config +++ b/examples/csharp/helloworld/.nuget/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Grpc.Tools" version="0.12.0" /> + <package id="Grpc.Tools" version="0.13.0" /> </packages> \ No newline at end of file diff --git a/examples/csharp/helloworld/Greeter/Greeter.csproj b/examples/csharp/helloworld/Greeter/Greeter.csproj index fa1c20f5ff4cddc2339e5a708dd1b16b15f8c0a8..a25ad5f7910b21001740e148bf70bc9ce4019755 100644 --- a/examples/csharp/helloworld/Greeter/Greeter.csproj +++ b/examples/csharp/helloworld/Greeter/Greeter.csproj @@ -10,7 +10,7 @@ <RootNamespace>Greeter</RootNamespace> <AssemblyName>Greeter</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <NuGetPackageImportStamp>4eea1d1c</NuGetPackageImportStamp> + <NuGetPackageImportStamp>39f4a691</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -31,15 +31,18 @@ <ConsolePause>false</ConsolePause> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf"> - <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> + <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath> + <Reference Include="Grpc.Core, Version=0.13.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="System" /> - <Reference Include="System.Interactive.Async"> - <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath> + <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> @@ -53,15 +56,11 @@ <None Include="protos\helloworld.proto" /> </ItemGroup> <ItemGroup /> - <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" /> + <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> + <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> </Target> - <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" /> - <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> </Project> \ No newline at end of file diff --git a/examples/csharp/helloworld/Greeter/Helloworld.cs b/examples/csharp/helloworld/Greeter/Helloworld.cs index 668165a6ce60b431bc35a9ec63cd12ae7ab70720..63969b7514b9302aa44bc68aa4e4fdc9176ba3b7 100644 --- a/examples/csharp/helloworld/Greeter/Helloworld.cs +++ b/examples/csharp/helloworld/Greeter/Helloworld.cs @@ -9,41 +9,46 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Helloworld { + /// <summary>Holder for reflection information generated from helloworld.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Helloworld { + public static partial class HelloworldReflection { #region Descriptor + /// <summary>File descriptor for helloworld.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static Helloworld() { + static HelloworldReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChBoZWxsb3dvcmxkLnByb3RvEgpoZWxsb3dvcmxkIhwKDEhlbGxvUmVxdWVz", - "dBIMCgRuYW1lGAEgASgJIh0KCkhlbGxvUmVwbHkSDwoHbWVzc2FnZRgBIAEo", - "CTJJCgdHcmVldGVyEj4KCFNheUhlbGxvEhguaGVsbG93b3JsZC5IZWxsb1Jl", - "cXVlc3QaFi5oZWxsb3dvcmxkLkhlbGxvUmVwbHkiAEIYChBpby5ncnBjLmV4", + "ChBoZWxsb3dvcmxkLnByb3RvEgpoZWxsb3dvcmxkIhwKDEhlbGxvUmVxdWVz", + "dBIMCgRuYW1lGAEgASgJIh0KCkhlbGxvUmVwbHkSDwoHbWVzc2FnZRgBIAEo", + "CTJJCgdHcmVldGVyEj4KCFNheUhlbGxvEhguaGVsbG93b3JsZC5IZWxsb1Jl", + "cXVlc3QaFi5oZWxsb3dvcmxkLkhlbGxvUmVwbHkiAEIYChBpby5ncnBjLmV4", "YW1wbGVzogIDSExXYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloRequest), new[]{ "Name" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloReply), new[]{ "Message" }, null, null, null) + new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloRequest), global::Helloworld.HelloRequest.Parser, new[]{ "Name" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloReply), global::Helloworld.HelloReply.Parser, new[]{ "Message" }, null, null, null) })); } #endregion } #region Messages + /// <summary> + /// The request message containing the user's name. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HelloRequest : pb::IMessage<HelloRequest> { private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest()); public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Helloworld.Helloworld.Descriptor.MessageTypes[0]; } + get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -64,6 +69,7 @@ namespace Helloworld { return new HelloRequest(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -95,7 +101,7 @@ namespace Helloworld { } public override string ToString() { - return pb::JsonFormatter.Default.Format(this); + return pb::JsonFormatter.ToDiagnosticString(this); } public void WriteTo(pb::CodedOutputStream output) { @@ -139,13 +145,16 @@ namespace Helloworld { } + /// <summary> + /// The response message containing the greetings + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HelloReply : pb::IMessage<HelloReply> { private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply()); public static pb::MessageParser<HelloReply> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Helloworld.Helloworld.Descriptor.MessageTypes[1]; } + get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -166,6 +175,7 @@ namespace Helloworld { return new HelloReply(this); } + /// <summary>Field number for the "message" field.</summary> public const int MessageFieldNumber = 1; private string message_ = ""; public string Message { @@ -197,7 +207,7 @@ namespace Helloworld { } public override string ToString() { - return pb::JsonFormatter.Default.Format(this); + return pb::JsonFormatter.ToDiagnosticString(this); } public void WriteTo(pb::CodedOutputStream output) { diff --git a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs index edfe4d22574d9af323bdbfddc8c1a65a62c23e6f..4014bc21e32c0e5c763a8b666bbfdb6b3ed56e2e 100644 --- a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs +++ b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs @@ -25,7 +25,7 @@ namespace Helloworld { // service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Helloworld.Helloworld.Descriptor.Services[0]; } + get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; } } // client interface diff --git a/examples/csharp/helloworld/Greeter/packages.config b/examples/csharp/helloworld/Greeter/packages.config index cabcadc78f2a7119945c60e53a1ea4feb0573999..abe9ad085073e8a5bd795840370a9ff01eeeb560 100644 --- a/examples/csharp/helloworld/Greeter/packages.config +++ b/examples/csharp/helloworld/Greeter/packages.config @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" /> - <package id="Grpc" version="0.12.0" targetFramework="net45" /> - <package id="Grpc.Core" version="0.12.0" targetFramework="net45" /> - <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" /> - <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" /> - <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" /> - <package id="Ix-Async" version="1.2.3" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> + <package id="Grpc" version="0.13.0" targetFramework="net45" /> + <package id="Grpc.Core" version="0.13.0" targetFramework="net45" /> + <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" /> + <package id="Ix-Async" version="1.2.5" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj b/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj index 164a6165eff1b941fc6fee959b6c8b134e65a7e1..a71cfeeef33127cd5ca1a7709e417b9c015949bf 100644 --- a/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj +++ b/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj @@ -10,7 +10,7 @@ <RootNamespace>GreeterClient</RootNamespace> <AssemblyName>GreeterClient</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <NuGetPackageImportStamp>29206d49</NuGetPackageImportStamp> + <NuGetPackageImportStamp>dcebbc77</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -31,15 +31,18 @@ <Externalconsole>true</Externalconsole> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf"> - <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> + <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath> + <Reference Include="Grpc.Core, Version=0.13.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="System" /> - <Reference Include="System.Interactive.Async"> - <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath> + <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> @@ -56,15 +59,11 @@ <ItemGroup> <None Include="packages.config" /> </ItemGroup> - <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" /> + <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> + <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> </Target> - <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" /> - <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> </Project> \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterClient/packages.config b/examples/csharp/helloworld/GreeterClient/packages.config index cabcadc78f2a7119945c60e53a1ea4feb0573999..abe9ad085073e8a5bd795840370a9ff01eeeb560 100644 --- a/examples/csharp/helloworld/GreeterClient/packages.config +++ b/examples/csharp/helloworld/GreeterClient/packages.config @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" /> - <package id="Grpc" version="0.12.0" targetFramework="net45" /> - <package id="Grpc.Core" version="0.12.0" targetFramework="net45" /> - <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" /> - <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" /> - <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" /> - <package id="Ix-Async" version="1.2.3" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> + <package id="Grpc" version="0.13.0" targetFramework="net45" /> + <package id="Grpc.Core" version="0.13.0" targetFramework="net45" /> + <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" /> + <package id="Ix-Async" version="1.2.5" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj b/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj index 56436d3834cf01c04092232277dec5299ac8b77c..34eea8c246d0204d611d0b080f069d73430f86ee 100644 --- a/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj +++ b/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj @@ -10,7 +10,7 @@ <RootNamespace>GreeterServer</RootNamespace> <AssemblyName>GreeterServer</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <NuGetPackageImportStamp>8a2cae0f</NuGetPackageImportStamp> + <NuGetPackageImportStamp>2ea5dfd0</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -31,15 +31,18 @@ <Externalconsole>true</Externalconsole> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf"> - <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> + <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath> + <Reference Include="Grpc.Core, Version=0.13.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="System" /> - <Reference Include="System.Interactive.Async"> - <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath> + <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> @@ -56,15 +59,11 @@ <ItemGroup> <None Include="packages.config" /> </ItemGroup> - <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" /> + <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> + <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> </Target> - <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" /> - <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> </Project> \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterServer/packages.config b/examples/csharp/helloworld/GreeterServer/packages.config index cabcadc78f2a7119945c60e53a1ea4feb0573999..abe9ad085073e8a5bd795840370a9ff01eeeb560 100644 --- a/examples/csharp/helloworld/GreeterServer/packages.config +++ b/examples/csharp/helloworld/GreeterServer/packages.config @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" /> - <package id="Grpc" version="0.12.0" targetFramework="net45" /> - <package id="Grpc.Core" version="0.12.0" targetFramework="net45" /> - <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" /> - <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" /> - <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" /> - <package id="Ix-Async" version="1.2.3" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> + <package id="Grpc" version="0.13.0" targetFramework="net45" /> + <package id="Grpc.Core" version="0.13.0" targetFramework="net45" /> + <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" /> + <package id="Ix-Async" version="1.2.5" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/helloworld/README.md b/examples/csharp/helloworld/README.md index f1af1f6793c0585ddf1e5c533f52fe0f75c19c7a..63131ed98c0004ff464c36e91a1549318890e557 100644 --- a/examples/csharp/helloworld/README.md +++ b/examples/csharp/helloworld/README.md @@ -16,35 +16,17 @@ PREREQUISITES - Visual Studio 2013 or 2015 **Linux** -- Mono -- Monodevelop 5.9 with NuGet Add-in installed +- Mono 4.0+ +- Monodevelop 5.9+ (with NuGet plugin installed) **Mac OS X** -- Xamarin Studio (with NuGet plugin installed) +- Xamarin Studio 5.9+ - [homebrew][] BUILD ------- -**Windows** - -- Open solution `Greeter.sln` with Visual Studio - -- Build the solution (this will automatically download NuGet dependencies) - -**Linux (Debian)** - -- Install gRPC C core and C# native extension using [How to use gRPC C#][] instructions - -- Open solution `Greeter.sln` in MonoDevelop. - -- Build the solution (you need to manually restore dependencies by using `mono nuget.exe restore` if you don't have NuGet add-in) - -**Mac OS X** - -- Install gRPC C core and C# native extension using [How to use gRPC C#][] instructions - -- Open solution `Greeter.sln` with Xamarin Studio +- Open solution `Greeter.sln` with Visual Studio, Monodevelop (on Linux) or Xamarin Studio (on Mac OS X) - Build the solution (this will automatically download NuGet dependencies) @@ -65,7 +47,7 @@ Try it! > GreeterClient.exe ``` -You can also run the server and client directly from Visual Studio. +You can also run the server and client directly from the IDE. On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client. @@ -76,5 +58,4 @@ You can find a more detailed tutorial in [gRPC Basics: C#][] [homebrew]:http://brew.sh [helloworld.proto]:../../protos/helloworld.proto -[How to use gRPC C#]:../../../src/csharp#how-to-use [gRPC Basics: C#]:http://www.grpc.io/docs/tutorials/basic/csharp.html diff --git a/examples/csharp/helloworld/generate_protos.bat b/examples/csharp/helloworld/generate_protos.bat index 8ba2c2e936fa779fd5ae833679967783a7673cbb..7f3654c8da0331f58671721d517bc7d9d27f515c 100644 --- a/examples/csharp/helloworld/generate_protos.bat +++ b/examples/csharp/helloworld/generate_protos.bat @@ -5,6 +5,6 @@ setlocal @rem enter this directory cd /d %~dp0 -packages\Google.Protobuf.3.0.0-alpha4\tools\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.12.0\tools\grpc_csharp_plugin.exe +packages\Google.Protobuf.3.0.0-beta2\tools\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.13.0\tools\grpc_csharp_plugin.exe endlocal \ No newline at end of file diff --git a/examples/csharp/route_guide/.nuget/packages.config b/examples/csharp/route_guide/.nuget/packages.config index 1cbe7e1d65ffdc21cef806cb81315acd267de100..fb778311d1f77f07aa041cf5a28cdc8113dcf799 100644 --- a/examples/csharp/route_guide/.nuget/packages.config +++ b/examples/csharp/route_guide/.nuget/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Grpc.Tools" version="0.12.0" /> + <package id="Grpc.Tools" version="0.13.0" /> </packages> \ No newline at end of file diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs index deb97e1b2d75cb5280420f969b93fb3adae84631..3bd79df418935b9a39c97b6e4614be086baf046c 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs +++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs @@ -9,57 +9,62 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Routeguide { - namespace Proto { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class RouteGuide { - - #region Descriptor - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static RouteGuide() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChFyb3V0ZV9ndWlkZS5wcm90bxIKcm91dGVndWlkZSIsCgVQb2ludBIQCghs", - "YXRpdHVkZRgBIAEoBRIRCglsb25naXR1ZGUYAiABKAUiSQoJUmVjdGFuZ2xl", - "Eh0KAmxvGAEgASgLMhEucm91dGVndWlkZS5Qb2ludBIdCgJoaRgCIAEoCzIR", - "LnJvdXRlZ3VpZGUuUG9pbnQiPAoHRmVhdHVyZRIMCgRuYW1lGAEgASgJEiMK", - "CGxvY2F0aW9uGAIgASgLMhEucm91dGVndWlkZS5Qb2ludCJBCglSb3V0ZU5v", - "dGUSIwoIbG9jYXRpb24YASABKAsyES5yb3V0ZWd1aWRlLlBvaW50Eg8KB21l", - "c3NhZ2UYAiABKAkiYgoMUm91dGVTdW1tYXJ5EhMKC3BvaW50X2NvdW50GAEg", - "ASgFEhUKDWZlYXR1cmVfY291bnQYAiABKAUSEAoIZGlzdGFuY2UYAyABKAUS", - "FAoMZWxhcHNlZF90aW1lGAQgASgFMoUCCgpSb3V0ZUd1aWRlEjYKCkdldEZl", - "YXR1cmUSES5yb3V0ZWd1aWRlLlBvaW50GhMucm91dGVndWlkZS5GZWF0dXJl", - "IgASPgoMTGlzdEZlYXR1cmVzEhUucm91dGVndWlkZS5SZWN0YW5nbGUaEy5y", - "b3V0ZWd1aWRlLkZlYXR1cmUiADABEj4KC1JlY29yZFJvdXRlEhEucm91dGVn", - "dWlkZS5Qb2ludBoYLnJvdXRlZ3VpZGUuUm91dGVTdW1tYXJ5IgAoARI/CglS", - "b3V0ZUNoYXQSFS5yb3V0ZWd1aWRlLlJvdXRlTm90ZRoVLnJvdXRlZ3VpZGUu", - "Um91dGVOb3RlIgAoATABQg8KB2V4LmdycGOiAgNSVEdiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Point), new[]{ "Latitude", "Longitude" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Rectangle), new[]{ "Lo", "Hi" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Feature), new[]{ "Name", "Location" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteNote), new[]{ "Location", "Message" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteSummary), new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null) - })); - } - #endregion + /// <summary>Holder for reflection information generated from route_guide.proto</summary> + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class RouteGuideReflection { + + #region Descriptor + /// <summary>File descriptor for route_guide.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RouteGuideReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChFyb3V0ZV9ndWlkZS5wcm90bxIKcm91dGVndWlkZSIsCgVQb2ludBIQCghs", + "YXRpdHVkZRgBIAEoBRIRCglsb25naXR1ZGUYAiABKAUiSQoJUmVjdGFuZ2xl", + "Eh0KAmxvGAEgASgLMhEucm91dGVndWlkZS5Qb2ludBIdCgJoaRgCIAEoCzIR", + "LnJvdXRlZ3VpZGUuUG9pbnQiPAoHRmVhdHVyZRIMCgRuYW1lGAEgASgJEiMK", + "CGxvY2F0aW9uGAIgASgLMhEucm91dGVndWlkZS5Qb2ludCJBCglSb3V0ZU5v", + "dGUSIwoIbG9jYXRpb24YASABKAsyES5yb3V0ZWd1aWRlLlBvaW50Eg8KB21l", + "c3NhZ2UYAiABKAkiYgoMUm91dGVTdW1tYXJ5EhMKC3BvaW50X2NvdW50GAEg", + "ASgFEhUKDWZlYXR1cmVfY291bnQYAiABKAUSEAoIZGlzdGFuY2UYAyABKAUS", + "FAoMZWxhcHNlZF90aW1lGAQgASgFMoUCCgpSb3V0ZUd1aWRlEjYKCkdldEZl", + "YXR1cmUSES5yb3V0ZWd1aWRlLlBvaW50GhMucm91dGVndWlkZS5GZWF0dXJl", + "IgASPgoMTGlzdEZlYXR1cmVzEhUucm91dGVndWlkZS5SZWN0YW5nbGUaEy5y", + "b3V0ZWd1aWRlLkZlYXR1cmUiADABEj4KC1JlY29yZFJvdXRlEhEucm91dGVn", + "dWlkZS5Qb2ludBoYLnJvdXRlZ3VpZGUuUm91dGVTdW1tYXJ5IgAoARI/CglS", + "b3V0ZUNoYXQSFS5yb3V0ZWd1aWRlLlJvdXRlTm90ZRoVLnJvdXRlZ3VpZGUu", + "Um91dGVOb3RlIgAoATABQg8KB2V4LmdycGOiAgNSVEdiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Point), global::Routeguide.Point.Parser, new[]{ "Latitude", "Longitude" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Rectangle), global::Routeguide.Rectangle.Parser, new[]{ "Lo", "Hi" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Feature), global::Routeguide.Feature.Parser, new[]{ "Name", "Location" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteNote), global::Routeguide.RouteNote.Parser, new[]{ "Location", "Message" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteSummary), global::Routeguide.RouteSummary.Parser, new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null) + })); + } + #endregion - } } #region Messages + /// <summary> + /// Points are represented as latitude-longitude pairs in the E7 representation + /// (degrees multiplied by 10**7 and rounded to the nearest integer). + /// Latitudes should be in the range +/- 90 degrees and longitude should be in + /// the range +/- 180 degrees (inclusive). + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Point : pb::IMessage<Point> { private static readonly pb::MessageParser<Point> _parser = new pb::MessageParser<Point>(() => new Point()); public static pb::MessageParser<Point> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[0]; } + get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[0]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -81,6 +86,7 @@ namespace Routeguide { return new Point(this); } + /// <summary>Field number for the "latitude" field.</summary> public const int LatitudeFieldNumber = 1; private int latitude_; public int Latitude { @@ -90,6 +96,7 @@ namespace Routeguide { } } + /// <summary>Field number for the "longitude" field.</summary> public const int LongitudeFieldNumber = 2; private int longitude_; public int Longitude { @@ -123,7 +130,7 @@ namespace Routeguide { } public override string ToString() { - return pb::JsonFormatter.Default.Format(this); + return pb::JsonFormatter.ToDiagnosticString(this); } public void WriteTo(pb::CodedOutputStream output) { @@ -181,13 +188,17 @@ namespace Routeguide { } + /// <summary> + /// A latitude-longitude rectangle, represented as two diagonally opposite + /// points "lo" and "hi". + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Rectangle : pb::IMessage<Rectangle> { private static readonly pb::MessageParser<Rectangle> _parser = new pb::MessageParser<Rectangle>(() => new Rectangle()); public static pb::MessageParser<Rectangle> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[1]; } + get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[1]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -209,8 +220,12 @@ namespace Routeguide { return new Rectangle(this); } + /// <summary>Field number for the "lo" field.</summary> public const int LoFieldNumber = 1; private global::Routeguide.Point lo_; + /// <summary> + /// One corner of the rectangle. + /// </summary> public global::Routeguide.Point Lo { get { return lo_; } set { @@ -218,8 +233,12 @@ namespace Routeguide { } } + /// <summary>Field number for the "hi" field.</summary> public const int HiFieldNumber = 2; private global::Routeguide.Point hi_; + /// <summary> + /// The other corner of the rectangle. + /// </summary> public global::Routeguide.Point Hi { get { return hi_; } set { @@ -251,7 +270,7 @@ namespace Routeguide { } public override string ToString() { - return pb::JsonFormatter.Default.Format(this); + return pb::JsonFormatter.ToDiagnosticString(this); } public void WriteTo(pb::CodedOutputStream output) { @@ -321,13 +340,18 @@ namespace Routeguide { } + /// <summary> + /// A feature names something at a given point. + /// + /// If a feature could not be named, the name is empty. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Feature : pb::IMessage<Feature> { private static readonly pb::MessageParser<Feature> _parser = new pb::MessageParser<Feature>(() => new Feature()); public static pb::MessageParser<Feature> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[2]; } + get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[2]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -349,8 +373,12 @@ namespace Routeguide { return new Feature(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// The name of the feature. + /// </summary> public string Name { get { return name_; } set { @@ -358,8 +386,12 @@ namespace Routeguide { } } + /// <summary>Field number for the "location" field.</summary> public const int LocationFieldNumber = 2; private global::Routeguide.Point location_; + /// <summary> + /// The point where the feature is detected. + /// </summary> public global::Routeguide.Point Location { get { return location_; } set { @@ -391,7 +423,7 @@ namespace Routeguide { } public override string ToString() { - return pb::JsonFormatter.Default.Format(this); + return pb::JsonFormatter.ToDiagnosticString(this); } public void WriteTo(pb::CodedOutputStream output) { @@ -455,13 +487,16 @@ namespace Routeguide { } + /// <summary> + /// A RouteNote is a message sent while at a given point. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class RouteNote : pb::IMessage<RouteNote> { private static readonly pb::MessageParser<RouteNote> _parser = new pb::MessageParser<RouteNote>(() => new RouteNote()); public static pb::MessageParser<RouteNote> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[3]; } + get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[3]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -483,8 +518,12 @@ namespace Routeguide { return new RouteNote(this); } + /// <summary>Field number for the "location" field.</summary> public const int LocationFieldNumber = 1; private global::Routeguide.Point location_; + /// <summary> + /// The location from which the message is sent. + /// </summary> public global::Routeguide.Point Location { get { return location_; } set { @@ -492,8 +531,12 @@ namespace Routeguide { } } + /// <summary>Field number for the "message" field.</summary> public const int MessageFieldNumber = 2; private string message_ = ""; + /// <summary> + /// The message to be sent. + /// </summary> public string Message { get { return message_; } set { @@ -525,7 +568,7 @@ namespace Routeguide { } public override string ToString() { - return pb::JsonFormatter.Default.Format(this); + return pb::JsonFormatter.ToDiagnosticString(this); } public void WriteTo(pb::CodedOutputStream output) { @@ -589,13 +632,20 @@ namespace Routeguide { } + /// <summary> + /// A RouteSummary is received in response to a RecordRoute rpc. + /// + /// It contains the number of individual points received, the number of + /// detected features, and the total distance covered as the cumulative sum of + /// the distance between each point. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class RouteSummary : pb::IMessage<RouteSummary> { private static readonly pb::MessageParser<RouteSummary> _parser = new pb::MessageParser<RouteSummary>(() => new RouteSummary()); public static pb::MessageParser<RouteSummary> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[4]; } + get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[4]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -619,8 +669,12 @@ namespace Routeguide { return new RouteSummary(this); } + /// <summary>Field number for the "point_count" field.</summary> public const int PointCountFieldNumber = 1; private int pointCount_; + /// <summary> + /// The number of points received. + /// </summary> public int PointCount { get { return pointCount_; } set { @@ -628,8 +682,12 @@ namespace Routeguide { } } + /// <summary>Field number for the "feature_count" field.</summary> public const int FeatureCountFieldNumber = 2; private int featureCount_; + /// <summary> + /// The number of known features passed while traversing the route. + /// </summary> public int FeatureCount { get { return featureCount_; } set { @@ -637,8 +695,12 @@ namespace Routeguide { } } + /// <summary>Field number for the "distance" field.</summary> public const int DistanceFieldNumber = 3; private int distance_; + /// <summary> + /// The distance covered in metres. + /// </summary> public int Distance { get { return distance_; } set { @@ -646,8 +708,12 @@ namespace Routeguide { } } + /// <summary>Field number for the "elapsed_time" field.</summary> public const int ElapsedTimeFieldNumber = 4; private int elapsedTime_; + /// <summary> + /// The duration of the traversal in seconds. + /// </summary> public int ElapsedTime { get { return elapsedTime_; } set { @@ -683,7 +749,7 @@ namespace Routeguide { } public override string ToString() { - return pb::JsonFormatter.Default.Format(this); + return pb::JsonFormatter.ToDiagnosticString(this); } public void WriteTo(pb::CodedOutputStream output) { diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj index 3a2a29cface182483fa8a2451d655be521ee1d8b..1fbf1ce1831fa4f76b01288d606ecac59041411b 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj +++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj @@ -11,7 +11,7 @@ <AssemblyName>RouteGuide</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> - <NuGetPackageImportStamp>68b3dd23</NuGetPackageImportStamp> + <NuGetPackageImportStamp>5b6d924a</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -31,11 +31,13 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf"> - <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> + <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath> + <Reference Include="Grpc.Core, Version=0.12.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> @@ -65,17 +67,13 @@ </None> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" /> + <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> + <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> </Target> - <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" /> - <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs index d60256fff6520f5a60b0f5774fda9c603214e4b8..66d1c07978656805ab7bd7c9ea003b755c566027 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs +++ b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs @@ -49,7 +49,7 @@ namespace Routeguide { // service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Routeguide.Proto.RouteGuide.Descriptor.Services[0]; } + get { return global::Routeguide.RouteGuideReflection.Descriptor.Services[0]; } } // client interface diff --git a/examples/csharp/route_guide/RouteGuide/packages.config b/examples/csharp/route_guide/RouteGuide/packages.config index 87173151026cf0e844e4988866dc636431dcdd31..e4e21099494af7eadc885d015d3c53020f761961 100644 --- a/examples/csharp/route_guide/RouteGuide/packages.config +++ b/examples/csharp/route_guide/RouteGuide/packages.config @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" /> - <package id="Grpc" version="0.12.0" targetFramework="net45" /> - <package id="Grpc.Core" version="0.12.0" targetFramework="net45" /> - <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" /> - <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" /> - <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> + <package id="Grpc" version="0.13.0" targetFramework="net45" /> + <package id="Grpc.Core" version="0.13.0" targetFramework="net45" /> + <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" /> <package id="Ix-Async" version="1.2.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj b/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj index 89e5025df838ffcbbcf546abe6ca01d81d58a8ee..f55627ed5ca48e4529618139d9d3d3a756bf3567 100644 --- a/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj +++ b/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj @@ -11,7 +11,7 @@ <AssemblyName>RouteGuideClient</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> - <NuGetPackageImportStamp>f5579f73</NuGetPackageImportStamp> + <NuGetPackageImportStamp>69015b00</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -33,11 +33,13 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf"> - <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> + <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath> + <Reference Include="Grpc.Core, Version=0.12.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> @@ -68,17 +70,13 @@ </ProjectReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" /> + <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> + <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> </Target> - <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" /> - <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> diff --git a/examples/csharp/route_guide/RouteGuideClient/packages.config b/examples/csharp/route_guide/RouteGuideClient/packages.config index 87173151026cf0e844e4988866dc636431dcdd31..e4e21099494af7eadc885d015d3c53020f761961 100644 --- a/examples/csharp/route_guide/RouteGuideClient/packages.config +++ b/examples/csharp/route_guide/RouteGuideClient/packages.config @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" /> - <package id="Grpc" version="0.12.0" targetFramework="net45" /> - <package id="Grpc.Core" version="0.12.0" targetFramework="net45" /> - <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" /> - <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" /> - <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> + <package id="Grpc" version="0.13.0" targetFramework="net45" /> + <package id="Grpc.Core" version="0.13.0" targetFramework="net45" /> + <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" /> <package id="Ix-Async" version="1.2.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj b/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj index 2e930625c42c403e22de636be5ee4a0f94822106..873556d65c6d7dd5cdec0c4310136a335b6406f4 100644 --- a/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj +++ b/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj @@ -11,7 +11,7 @@ <AssemblyName>RouteGuideServer</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> - <NuGetPackageImportStamp>89e15444</NuGetPackageImportStamp> + <NuGetPackageImportStamp>656158d8</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -33,11 +33,13 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf"> - <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> + <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath> + <Reference Include="Grpc.Core, Version=0.12.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> @@ -69,17 +71,13 @@ </ProjectReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" /> + <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" /> - <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> + <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" /> </Target> - <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" /> - <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> diff --git a/examples/csharp/route_guide/RouteGuideServer/packages.config b/examples/csharp/route_guide/RouteGuideServer/packages.config index 87173151026cf0e844e4988866dc636431dcdd31..e4e21099494af7eadc885d015d3c53020f761961 100644 --- a/examples/csharp/route_guide/RouteGuideServer/packages.config +++ b/examples/csharp/route_guide/RouteGuideServer/packages.config @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" /> - <package id="Grpc" version="0.12.0" targetFramework="net45" /> - <package id="Grpc.Core" version="0.12.0" targetFramework="net45" /> - <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" /> - <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" /> - <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" /> + <package id="Grpc" version="0.13.0" targetFramework="net45" /> + <package id="Grpc.Core" version="0.13.0" targetFramework="net45" /> + <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" /> <package id="Ix-Async" version="1.2.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/route_guide/generate_protos.bat b/examples/csharp/route_guide/generate_protos.bat index fad63ef0aeba4904c3387d0c72e29e337fcb201d..d9cd021a917ce7993b4e9b0e22081be76a5a76b0 100644 --- a/examples/csharp/route_guide/generate_protos.bat +++ b/examples/csharp/route_guide/generate_protos.bat @@ -5,6 +5,6 @@ setlocal @rem enter this directory cd /d %~dp0 -packages\Google.Protobuf.3.0.0-alpha4\tools\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.12.0\tools\grpc_csharp_plugin.exe +packages\Google.Protobuf.3.0.0-beta2\tools\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.13.0\tools\grpc_csharp_plugin.exe endlocal \ No newline at end of file diff --git a/examples/python/README.md b/examples/python/README.md index 7b48c824baea41fa358c5a5c9a1d7426902de900..b57da8f6428846027b455e842828c792f0bd7852 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -6,24 +6,18 @@ Background For this sample, we've already generated the server and client stubs from [helloworld.proto][] and we'll be using a specific reference platform. -Prerequisites -------------- - -- Debian 8.2 "Jessie" platform with `root` access -- `git` -- `python2.7` -- `pip` -- Python development headers -Set-up -------- +Install gRPC: ```sh - $ # install the gRPC Core: - $ sudo apt-get install libgrpc-dev - $ # install gRPC Python: - $ sudo pip install -U grpcio==0.11.0b1 - $ # Since this "hello, world" example uses protocol buffers: - $ sudo pip install -U protobuf==3.0.0a3 + $ pip install grpcio +``` +Or, to install it system wide: +```sh + $ sudo pip install grpcio +``` + +Download the example +```sh $ # Clone the repository to get the example code: $ git clone https://github.com/grpc/grpc $ # Navigate to the "hello, world" Python example: diff --git a/examples/python/route_guide/run_client.sh b/examples/python/route_guide/run_client.sh deleted file mode 100755 index e5fd383859e70114bf53e85a53d0fc094641882b..0000000000000000000000000000000000000000 --- a/examples/python/route_guide/run_client.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# 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. - -# This is where you have cloned out the https://github.com/grpc/grpc repository -# And built gRPC Python. -# ADJUST THIS PATH TO WHERE YOUR ACTUAL LOCATION IS -GRPC_ROOT=~/github/grpc - -$GRPC_ROOT/python2.7_virtual_environment/bin/python -B route_guide_client.py diff --git a/examples/python/route_guide/run_server.sh b/examples/python/route_guide/run_server.sh deleted file mode 100755 index 7b1a764c061b4e2899ceec3d9962e7f410a67eb7..0000000000000000000000000000000000000000 --- a/examples/python/route_guide/run_server.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# 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. - -# This is where you have cloned out the https://github.com/grpc/grpc repository -# And built gRPC Python. -# ADJUST THIS PATH TO WHERE YOUR ACTUAL LOCATION IS -GRPC_ROOT=~/github/grpc - -$GRPC_ROOT/python2.7_virtual_environment/bin/python -B route_guide_server.py diff --git a/package.json b/package.json index 4e7e83b02bf460b3d1819e28907c8bb4cb382a87..db7f299e1367e7cbb57a9b6554d9a5797652e696 100644 --- a/package.json +++ b/package.json @@ -421,102 +421,6 @@ "third_party/zlib/trees.c", "third_party/zlib/uncompr.c", "third_party/zlib/zutil.c", - "include/grpc/support/alloc.h", - "include/grpc/support/atm.h", - "include/grpc/support/atm_gcc_atomic.h", - "include/grpc/support/atm_gcc_sync.h", - "include/grpc/support/atm_win32.h", - "include/grpc/support/avl.h", - "include/grpc/support/cmdline.h", - "include/grpc/support/cpu.h", - "include/grpc/support/histogram.h", - "include/grpc/support/host_port.h", - "include/grpc/support/log.h", - "include/grpc/support/log_win32.h", - "include/grpc/support/port_platform.h", - "include/grpc/support/slice.h", - "include/grpc/support/slice_buffer.h", - "include/grpc/support/string_util.h", - "include/grpc/support/subprocess.h", - "include/grpc/support/sync.h", - "include/grpc/support/sync_generic.h", - "include/grpc/support/sync_posix.h", - "include/grpc/support/sync_win32.h", - "include/grpc/support/thd.h", - "include/grpc/support/time.h", - "include/grpc/support/tls.h", - "include/grpc/support/tls_gcc.h", - "include/grpc/support/tls_msvc.h", - "include/grpc/support/tls_pthread.h", - "include/grpc/support/useful.h", - "include/grpc/impl/codegen/alloc.h", - "include/grpc/impl/codegen/atm.h", - "include/grpc/impl/codegen/atm_gcc_atomic.h", - "include/grpc/impl/codegen/atm_gcc_sync.h", - "include/grpc/impl/codegen/atm_win32.h", - "include/grpc/impl/codegen/log.h", - "include/grpc/impl/codegen/port_platform.h", - "include/grpc/impl/codegen/slice.h", - "include/grpc/impl/codegen/slice_buffer.h", - "include/grpc/impl/codegen/sync.h", - "include/grpc/impl/codegen/sync_generic.h", - "include/grpc/impl/codegen/sync_posix.h", - "include/grpc/impl/codegen/sync_win32.h", - "include/grpc/impl/codegen/time.h", - "src/core/profiling/timers.h", - "src/core/support/block_annotate.h", - "src/core/support/env.h", - "src/core/support/load_file.h", - "src/core/support/murmur_hash.h", - "src/core/support/stack_lockfree.h", - "src/core/support/string.h", - "src/core/support/string_win32.h", - "src/core/support/thd_internal.h", - "src/core/support/time_precise.h", - "src/core/support/tmpfile.h", - "src/core/profiling/basic_timers.c", - "src/core/profiling/stap_timers.c", - "src/core/support/alloc.c", - "src/core/support/avl.c", - "src/core/support/cmdline.c", - "src/core/support/cpu_iphone.c", - "src/core/support/cpu_linux.c", - "src/core/support/cpu_posix.c", - "src/core/support/cpu_windows.c", - "src/core/support/env_linux.c", - "src/core/support/env_posix.c", - "src/core/support/env_win32.c", - "src/core/support/histogram.c", - "src/core/support/host_port.c", - "src/core/support/load_file.c", - "src/core/support/log.c", - "src/core/support/log_android.c", - "src/core/support/log_linux.c", - "src/core/support/log_posix.c", - "src/core/support/log_win32.c", - "src/core/support/murmur_hash.c", - "src/core/support/slice.c", - "src/core/support/slice_buffer.c", - "src/core/support/stack_lockfree.c", - "src/core/support/string.c", - "src/core/support/string_posix.c", - "src/core/support/string_win32.c", - "src/core/support/subprocess_posix.c", - "src/core/support/subprocess_windows.c", - "src/core/support/sync.c", - "src/core/support/sync_posix.c", - "src/core/support/sync_win32.c", - "src/core/support/thd.c", - "src/core/support/thd_posix.c", - "src/core/support/thd_win32.c", - "src/core/support/time.c", - "src/core/support/time_posix.c", - "src/core/support/time_precise.c", - "src/core/support/time_win32.c", - "src/core/support/tls_pthread.c", - "src/core/support/tmpfile_posix.c", - "src/core/support/tmpfile_win32.c", - "src/core/support/wrap_memcpy.c", "third_party/boringssl/crypto/aes/internal.h", "third_party/boringssl/crypto/asn1/asn1_locl.h", "third_party/boringssl/crypto/bio/internal.h", @@ -918,6 +822,102 @@ "third_party/boringssl/ssl/t1_enc.c", "third_party/boringssl/ssl/t1_lib.c", "third_party/boringssl/ssl/tls_record.c", + "include/grpc/support/alloc.h", + "include/grpc/support/atm.h", + "include/grpc/support/atm_gcc_atomic.h", + "include/grpc/support/atm_gcc_sync.h", + "include/grpc/support/atm_win32.h", + "include/grpc/support/avl.h", + "include/grpc/support/cmdline.h", + "include/grpc/support/cpu.h", + "include/grpc/support/histogram.h", + "include/grpc/support/host_port.h", + "include/grpc/support/log.h", + "include/grpc/support/log_win32.h", + "include/grpc/support/port_platform.h", + "include/grpc/support/slice.h", + "include/grpc/support/slice_buffer.h", + "include/grpc/support/string_util.h", + "include/grpc/support/subprocess.h", + "include/grpc/support/sync.h", + "include/grpc/support/sync_generic.h", + "include/grpc/support/sync_posix.h", + "include/grpc/support/sync_win32.h", + "include/grpc/support/thd.h", + "include/grpc/support/time.h", + "include/grpc/support/tls.h", + "include/grpc/support/tls_gcc.h", + "include/grpc/support/tls_msvc.h", + "include/grpc/support/tls_pthread.h", + "include/grpc/support/useful.h", + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", + "src/core/profiling/timers.h", + "src/core/support/block_annotate.h", + "src/core/support/env.h", + "src/core/support/load_file.h", + "src/core/support/murmur_hash.h", + "src/core/support/stack_lockfree.h", + "src/core/support/string.h", + "src/core/support/string_win32.h", + "src/core/support/thd_internal.h", + "src/core/support/time_precise.h", + "src/core/support/tmpfile.h", + "src/core/profiling/basic_timers.c", + "src/core/profiling/stap_timers.c", + "src/core/support/alloc.c", + "src/core/support/avl.c", + "src/core/support/cmdline.c", + "src/core/support/cpu_iphone.c", + "src/core/support/cpu_linux.c", + "src/core/support/cpu_posix.c", + "src/core/support/cpu_windows.c", + "src/core/support/env_linux.c", + "src/core/support/env_posix.c", + "src/core/support/env_win32.c", + "src/core/support/histogram.c", + "src/core/support/host_port.c", + "src/core/support/load_file.c", + "src/core/support/log.c", + "src/core/support/log_android.c", + "src/core/support/log_linux.c", + "src/core/support/log_posix.c", + "src/core/support/log_win32.c", + "src/core/support/murmur_hash.c", + "src/core/support/slice.c", + "src/core/support/slice_buffer.c", + "src/core/support/stack_lockfree.c", + "src/core/support/string.c", + "src/core/support/string_posix.c", + "src/core/support/string_win32.c", + "src/core/support/subprocess_posix.c", + "src/core/support/subprocess_windows.c", + "src/core/support/sync.c", + "src/core/support/sync_posix.c", + "src/core/support/sync_win32.c", + "src/core/support/thd.c", + "src/core/support/thd_posix.c", + "src/core/support/thd_win32.c", + "src/core/support/time.c", + "src/core/support/time_posix.c", + "src/core/support/time_precise.c", + "src/core/support/time_win32.c", + "src/core/support/tls_pthread.c", + "src/core/support/tmpfile_posix.c", + "src/core/support/tmpfile_win32.c", + "src/core/support/wrap_memcpy.c", "binding.gyp" ], "main": "src/node/index.js", diff --git a/package.xml b/package.xml index 99109ada8fd2eed100f4bdc8bb8b70175fec76bd..be4cfc79db77a41f39fe12f9bcf80fe702a0ef59 100644 --- a/package.xml +++ b/package.xml @@ -10,7 +10,7 @@ <email>grpc-packages@google.com</email> <active>yes</active> </lead> - <date>2016-02-23</date> + <date>2016-02-25</date> <time>16:06:07</time> <version> <release>0.8.0</release> @@ -95,13 +95,14 @@ <file baseinstalldir="/" name="src/core/profiling/timers.h" role="src" /> <file baseinstalldir="/" name="src/core/support/block_annotate.h" role="src" /> <file baseinstalldir="/" name="src/core/support/env.h" role="src" /> - <file baseinstalldir="/" name="src/core/support/file.h" role="src" /> + <file baseinstalldir="/" name="src/core/support/load_file.h" role="src" /> <file baseinstalldir="/" name="src/core/support/murmur_hash.h" role="src" /> <file baseinstalldir="/" name="src/core/support/stack_lockfree.h" role="src" /> <file baseinstalldir="/" name="src/core/support/string.h" role="src" /> <file baseinstalldir="/" name="src/core/support/string_win32.h" role="src" /> <file baseinstalldir="/" name="src/core/support/thd_internal.h" role="src" /> <file baseinstalldir="/" name="src/core/support/time_precise.h" role="src" /> + <file baseinstalldir="/" name="src/core/support/tmpfile.h" role="src" /> <file baseinstalldir="/" name="src/core/profiling/basic_timers.c" role="src" /> <file baseinstalldir="/" name="src/core/profiling/stap_timers.c" role="src" /> <file baseinstalldir="/" name="src/core/support/alloc.c" role="src" /> @@ -114,11 +115,9 @@ <file baseinstalldir="/" name="src/core/support/env_linux.c" role="src" /> <file baseinstalldir="/" name="src/core/support/env_posix.c" role="src" /> <file baseinstalldir="/" name="src/core/support/env_win32.c" role="src" /> - <file baseinstalldir="/" name="src/core/support/file.c" role="src" /> - <file baseinstalldir="/" name="src/core/support/file_posix.c" role="src" /> - <file baseinstalldir="/" name="src/core/support/file_win32.c" role="src" /> <file baseinstalldir="/" name="src/core/support/histogram.c" role="src" /> <file baseinstalldir="/" name="src/core/support/host_port.c" role="src" /> + <file baseinstalldir="/" name="src/core/support/load_file.c" role="src" /> <file baseinstalldir="/" name="src/core/support/log.c" role="src" /> <file baseinstalldir="/" name="src/core/support/log_android.c" role="src" /> <file baseinstalldir="/" name="src/core/support/log_linux.c" role="src" /> @@ -144,6 +143,8 @@ <file baseinstalldir="/" name="src/core/support/time_precise.c" role="src" /> <file baseinstalldir="/" name="src/core/support/time_win32.c" role="src" /> <file baseinstalldir="/" name="src/core/support/tls_pthread.c" role="src" /> + <file baseinstalldir="/" name="src/core/support/tmpfile_posix.c" role="src" /> + <file baseinstalldir="/" name="src/core/support/tmpfile_win32.c" role="src" /> <file baseinstalldir="/" name="src/core/support/wrap_memcpy.c" role="src" /> <file baseinstalldir="/" name="include/grpc/grpc_security.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/byte_buffer.h" role="src" /> @@ -274,7 +275,7 @@ <file baseinstalldir="/" name="src/core/transport/transport.h" role="src" /> <file baseinstalldir="/" name="src/core/transport/transport_impl.h" role="src" /> <file baseinstalldir="/" name="src/core/security/auth_filters.h" role="src" /> - <file baseinstalldir="/" name="src/core/security/base64.h" role="src" /> + <file baseinstalldir="/" name="src/core/security/b64.h" role="src" /> <file baseinstalldir="/" name="src/core/security/credentials.h" role="src" /> <file baseinstalldir="/" name="src/core/security/handshake.h" role="src" /> <file baseinstalldir="/" name="src/core/security/json_token.h" role="src" /> @@ -324,7 +325,7 @@ <file baseinstalldir="/" name="src/core/client_config/subchannel_factory.c" role="src" /> <file baseinstalldir="/" name="src/core/client_config/subchannel_index.c" role="src" /> <file baseinstalldir="/" name="src/core/client_config/uri_parser.c" role="src" /> - <file baseinstalldir="/" name="src/core/compression/algorithm.c" role="src" /> + <file baseinstalldir="/" name="src/core/compression/compression_algorithm.c" role="src" /> <file baseinstalldir="/" name="src/core/compression/message_compress.c" role="src" /> <file baseinstalldir="/" name="src/core/debug/trace.c" role="src" /> <file baseinstalldir="/" name="src/core/httpcli/format_request.c" role="src" /> @@ -425,7 +426,7 @@ <file baseinstalldir="/" name="src/core/transport/transport.c" role="src" /> <file baseinstalldir="/" name="src/core/transport/transport_op_string.c" role="src" /> <file baseinstalldir="/" name="src/core/httpcli/httpcli_security_connector.c" role="src" /> - <file baseinstalldir="/" name="src/core/security/base64.c" role="src" /> + <file baseinstalldir="/" name="src/core/security/b64.c" role="src" /> <file baseinstalldir="/" name="src/core/security/client_auth_filter.c" role="src" /> <file baseinstalldir="/" name="src/core/security/credentials.c" role="src" /> <file baseinstalldir="/" name="src/core/security/credentials_metadata.c" role="src" /> @@ -855,32 +856,6 @@ <file baseinstalldir="/" name="third_party/boringssl/ssl/t1_enc.c" role="src" /> <file baseinstalldir="/" name="third_party/boringssl/ssl/t1_lib.c" role="src" /> <file baseinstalldir="/" name="third_party/boringssl/ssl/tls_record.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/crc32.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/deflate.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/gzguts.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/inffast.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/inffixed.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/inflate.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/inftrees.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/trees.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/zconf.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/zlib.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/zutil.h" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/adler32.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/compress.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/crc32.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/deflate.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/gzclose.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/gzlib.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/gzread.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/gzwrite.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/infback.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/inffast.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/inflate.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/inftrees.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/trees.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/uncompr.c" role="src" /> - <file baseinstalldir="/" name="third_party/zlib/zutil.c" role="src" /> </dir> </contents> <dependencies> @@ -988,7 +963,7 @@ Update to wrap gRPC C Core version 0.10.0 <release>beta</release> <api>beta</api> </stability> - <date>2016-02-23</date> + <date>2016-02-25</date> <license>BSD</license> <notes> - Simplify gRPC PHP installation #4517 diff --git a/setup.py b/setup.py index 5b9f9b6c662f606cc10e791a471fdad8c951ff29..cfb578e21581645985c72e23c6acd820a470c041 100644 --- a/setup.py +++ b/setup.py @@ -208,7 +208,6 @@ PACKAGE_DATA = { '_credentials/roots.pem', '_windows/grpc_c.32.python', '_windows/grpc_c.64.python', - 'cygrpc.so', ], } if INSTALL_TESTS: diff --git a/src/core/client_config/subchannel_index.c b/src/core/client_config/subchannel_index.c index f78a7fd588c48640c8ffe15dc79a59205af07932..3f948998f9cae1f4f4d81ae46c2ce51ffdedcc7b 100644 --- a/src/core/client_config/subchannel_index.c +++ b/src/core/client_config/subchannel_index.c @@ -149,11 +149,13 @@ static const gpr_avl_vtable subchannel_avl_vtable = { void grpc_subchannel_index_init(void) { g_subchannel_index = gpr_avl_create(&subchannel_avl_vtable); gpr_mu_init(&g_mu); + gpr_tls_init(&subchannel_index_exec_ctx); } void grpc_subchannel_index_shutdown(void) { gpr_mu_destroy(&g_mu); gpr_avl_unref(g_subchannel_index); + gpr_tls_destroy(&subchannel_index_exec_ctx); } grpc_subchannel *grpc_subchannel_index_find(grpc_exec_ctx *exec_ctx, diff --git a/src/core/support/env_linux.c b/src/core/support/env_linux.c index 1ca6fa1affe29a9d630afff58a262ff94504e9ee..fe51f846b710f65dfb8a5e5034f52b787cb729b4 100644 --- a/src/core/support/env_linux.c +++ b/src/core/support/env_linux.c @@ -43,7 +43,9 @@ #include "src/core/support/env.h" #include <dlfcn.h> +#include <features.h> #include <stdlib.h> +#include <string.h> #include <grpc/support/log.h> #include <grpc/support/string_util.h> @@ -60,12 +62,22 @@ char *gpr_getenv(const char *name) { const char *names[] = {"secure_getenv", "__secure_getenv", "getenv"}; for (size_t i = 0; getenv_func == NULL && i < GPR_ARRAY_SIZE(names); i++) { getenv_func = (getenv_type)dlsym(RTLD_DEFAULT, names[i]); + if (getenv_func != NULL && strstr(names[i], "secure") == NULL) { + gpr_log(GPR_DEBUG, + "Warning: insecure environment read function '%s' used", + names[i]); + } } char *result = getenv_func(name); return result == NULL ? result : gpr_strdup(result); -#else +#elif __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 17) char *result = secure_getenv(name); return result == NULL ? result : gpr_strdup(result); +#else + gpr_log(GPR_DEBUG, "Warning: insecure environment read function '%s' used", + "getenv"); + char *result = getenv(name); + return result == NULL ? result : gpr_strdup(result); #endif } diff --git a/src/csharp/Grpc.Core/Internal/DefaultSslRootsOverride.cs b/src/csharp/Grpc.Core/Internal/DefaultSslRootsOverride.cs index eeaa7add81395e71939995ca85d44d48a10bd5e7..dfaee5d9d7cd207d52a28e2c4f2795bf82459402 100644 --- a/src/csharp/Grpc.Core/Internal/DefaultSslRootsOverride.cs +++ b/src/csharp/Grpc.Core/Internal/DefaultSslRootsOverride.cs @@ -56,7 +56,7 @@ namespace Grpc.Core.Internal { lock (staticLock) { - var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(RootsPemResourceName); + var stream = typeof(DefaultSslRootsOverride).GetTypeInfo().Assembly.GetManifestResourceStream(RootsPemResourceName); if (stream == null) { throw new IOException(string.Format("Error loading the embedded resource \"{0}\"", RootsPemResourceName)); diff --git a/src/csharp/Grpc.Core/Internal/PlatformApis.cs b/src/csharp/Grpc.Core/Internal/PlatformApis.cs index f0c5b0f63f61e1d15d0d04137f279c64477d1e5d..fb1acfb607b23925900c2d211746fa0bed32e365 100644 --- a/src/csharp/Grpc.Core/Internal/PlatformApis.cs +++ b/src/csharp/Grpc.Core/Internal/PlatformApis.cs @@ -53,12 +53,18 @@ namespace Grpc.Core.Internal static PlatformApis() { +#if DNXCORE50 + isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + isMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); +#else var platform = Environment.OSVersion.Platform; // PlatformID.MacOSX is never returned, commonly used trick is to identify Mac is by using uname. isMacOSX = (platform == PlatformID.Unix && GetUname() == "Darwin"); isLinux = (platform == PlatformID.Unix && !isMacOSX); isWindows = (platform == PlatformID.Win32NT || platform == PlatformID.Win32S || platform == PlatformID.Win32Windows); +#endif isMono = Type.GetType("Mono.Runtime") != null; } diff --git a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs index a8a76c749229468a56bd246d39ca2c7cdc19e087..c3fac05324c8245694c425eb88cab306dcc7f641 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs @@ -36,7 +36,7 @@ using System.Text; using System.Threading.Tasks; using Grpc.Core; -using Grpc.Health.V1Alpha; +using Grpc.Health.V1; using NUnit.Framework; namespace Grpc.HealthCheck.Tests @@ -49,7 +49,7 @@ namespace Grpc.HealthCheck.Tests const string Host = "localhost"; Server server; Channel channel; - Grpc.Health.V1Alpha.Health.IHealthClient client; + Grpc.Health.V1.Health.IHealthClient client; Grpc.HealthCheck.HealthServiceImpl serviceImpl; [TestFixtureSetUp] @@ -59,13 +59,13 @@ namespace Grpc.HealthCheck.Tests server = new Server { - Services = { Grpc.Health.V1Alpha.Health.BindService(serviceImpl) }, + Services = { Grpc.Health.V1.Health.BindService(serviceImpl) }, Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } } }; server.Start(); channel = new Channel(Host, server.Ports.Single().BoundPort, ChannelCredentials.Insecure); - client = Grpc.Health.V1Alpha.Health.NewClient(channel); + client = Grpc.Health.V1.Health.NewClient(channel); } [TestFixtureTearDown] @@ -79,16 +79,16 @@ namespace Grpc.HealthCheck.Tests [Test] public void ServiceIsRunning() { - serviceImpl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.SERVING); + serviceImpl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); - var response = client.Check(new HealthCheckRequest { Host = "", Service = "" }); + var response = client.Check(new HealthCheckRequest { Service = "" }); Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, response.Status); } [Test] public void ServiceDoesntExist() { - Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => client.Check(new HealthCheckRequest { Host = "", Service = "nonexistent.service" })); + Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => client.Check(new HealthCheckRequest { Service = "nonexistent.service" })); } // TODO(jtattermusch): add test with timeout once timeouts are supported diff --git a/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs b/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs index 2097c0dc8cf7daa2c79f72a4706299af0ee76d0d..47e4b7c2a70194bb84232f42db9588756c6dffca 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs @@ -1,5 +1,5 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ using System.Text; using System.Threading.Tasks; using Grpc.Core; -using Grpc.Health.V1Alpha; +using Grpc.Health.V1; using NUnit.Framework; namespace Grpc.HealthCheck.Tests @@ -50,58 +50,56 @@ namespace Grpc.HealthCheck.Tests public void SetStatus() { var impl = new HealthServiceImpl(); - impl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.SERVING); - Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, GetStatusHelper(impl, "", "")); + impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); + Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, GetStatusHelper(impl, "")); - impl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.NOT_SERVING); - Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.NOT_SERVING, GetStatusHelper(impl, "", "")); + impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.NOT_SERVING); + Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.NOT_SERVING, GetStatusHelper(impl, "")); - impl.SetStatus("virtual-host", "", HealthCheckResponse.Types.ServingStatus.UNKNOWN); - Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.UNKNOWN, GetStatusHelper(impl, "virtual-host", "")); + impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.UNKNOWN); + Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.UNKNOWN, GetStatusHelper(impl, "")); - impl.SetStatus("virtual-host", "grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.SERVING); - Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, GetStatusHelper(impl, "virtual-host", "grpc.test.TestService")); + impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.SERVING); + Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, GetStatusHelper(impl, "grpc.test.TestService")); } [Test] public void ClearStatus() { var impl = new HealthServiceImpl(); - impl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.SERVING); - impl.SetStatus("virtual-host", "", HealthCheckResponse.Types.ServingStatus.UNKNOWN); + impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); + impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.UNKNOWN); - impl.ClearStatus("", ""); + impl.ClearStatus(""); - Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => GetStatusHelper(impl, "", "")); - Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.UNKNOWN, GetStatusHelper(impl, "virtual-host", "")); + Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => GetStatusHelper(impl, "")); + Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.UNKNOWN, GetStatusHelper(impl, "grpc.test.TestService")); } [Test] public void ClearAll() { var impl = new HealthServiceImpl(); - impl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.SERVING); - impl.SetStatus("virtual-host", "", HealthCheckResponse.Types.ServingStatus.UNKNOWN); + impl.SetStatus("", HealthCheckResponse.Types.ServingStatus.SERVING); + impl.SetStatus("grpc.test.TestService", HealthCheckResponse.Types.ServingStatus.UNKNOWN); impl.ClearAll(); - Assert.Throws(typeof(RpcException), () => GetStatusHelper(impl, "", "")); - Assert.Throws(typeof(RpcException), () => GetStatusHelper(impl, "virtual-host", "")); + Assert.Throws(typeof(RpcException), () => GetStatusHelper(impl, "")); + Assert.Throws(typeof(RpcException), () => GetStatusHelper(impl, "grpc.test.TestService")); } [Test] public void NullsRejected() { var impl = new HealthServiceImpl(); - Assert.Throws(typeof(ArgumentNullException), () => impl.SetStatus(null, "", HealthCheckResponse.Types.ServingStatus.SERVING)); - Assert.Throws(typeof(ArgumentNullException), () => impl.SetStatus("", null, HealthCheckResponse.Types.ServingStatus.SERVING)); + Assert.Throws(typeof(ArgumentNullException), () => impl.SetStatus(null, HealthCheckResponse.Types.ServingStatus.SERVING)); - Assert.Throws(typeof(ArgumentNullException), () => impl.ClearStatus(null, "")); - Assert.Throws(typeof(ArgumentNullException), () => impl.ClearStatus("", null)); + Assert.Throws(typeof(ArgumentNullException), () => impl.ClearStatus(null)); } - private static HealthCheckResponse.Types.ServingStatus GetStatusHelper(HealthServiceImpl impl, string host, string service) + private static HealthCheckResponse.Types.ServingStatus GetStatusHelper(HealthServiceImpl impl, string service) { - return impl.Check(new HealthCheckRequest { Host = host, Service = service }, null).Result.Status; + return impl.Check(new HealthCheckRequest { Service = service }, null).Result.Status; } } } diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec index 66386288df132f448b0dee70305b15ae41e0c824..7b3b391009eb05ca1ba9a85aceec8b829d22939b 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec @@ -4,7 +4,7 @@ <id>Grpc.HealthCheck</id> <title>gRPC C# Healthchecking</title> <summary>Implementation of gRPC health service</summary> - <description>Example implementation of grpc.health.v1alpha service that can be used for health-checking.</description> + <description>Example implementation of grpc.health.v1 service that can be used for health-checking.</description> <version>$version$</version> <authors>Google Inc.</authors> <owners>grpc-packages</owners> diff --git a/src/csharp/Grpc.HealthCheck/Health.cs b/src/csharp/Grpc.HealthCheck/Health.cs index 56673f1adf699bef3998cae252799bcbe7d3bfe5..d0d0c0b519665376069e283e7ae90f347c4b127a 100644 --- a/src/csharp/Grpc.HealthCheck/Health.cs +++ b/src/csharp/Grpc.HealthCheck/Health.cs @@ -7,7 +7,7 @@ using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Grpc.Health.V1Alpha { +namespace Grpc.Health.V1 { /// <summary>Holder for reflection information generated from health.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -23,20 +23,19 @@ namespace Grpc.Health.V1Alpha { static HealthReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CgxoZWFsdGgucHJvdG8SE2dycGMuaGVhbHRoLnYxYWxwaGEiMwoSSGVhbHRo", - "Q2hlY2tSZXF1ZXN0EgwKBGhvc3QYASABKAkSDwoHc2VydmljZRgCIAEoCSKZ", - "AQoTSGVhbHRoQ2hlY2tSZXNwb25zZRJGCgZzdGF0dXMYASABKA4yNi5ncnBj", - "LmhlYWx0aC52MWFscGhhLkhlYWx0aENoZWNrUmVzcG9uc2UuU2VydmluZ1N0", - "YXR1cyI6Cg1TZXJ2aW5nU3RhdHVzEgsKB1VOS05PV04QABILCgdTRVJWSU5H", - "EAESDwoLTk9UX1NFUlZJTkcQAjJkCgZIZWFsdGgSWgoFQ2hlY2sSJy5ncnBj", - "LmhlYWx0aC52MWFscGhhLkhlYWx0aENoZWNrUmVxdWVzdBooLmdycGMuaGVh", - "bHRoLnYxYWxwaGEuSGVhbHRoQ2hlY2tSZXNwb25zZUIWqgITR3JwYy5IZWFs", - "dGguVjFBbHBoYWIGcHJvdG8z")); + "CgxoZWFsdGgucHJvdG8SDmdycGMuaGVhbHRoLnYxIiUKEkhlYWx0aENoZWNr", + "UmVxdWVzdBIPCgdzZXJ2aWNlGAEgASgJIpQBChNIZWFsdGhDaGVja1Jlc3Bv", + "bnNlEkEKBnN0YXR1cxgBIAEoDjIxLmdycGMuaGVhbHRoLnYxLkhlYWx0aENo", + "ZWNrUmVzcG9uc2UuU2VydmluZ1N0YXR1cyI6Cg1TZXJ2aW5nU3RhdHVzEgsK", + "B1VOS05PV04QABILCgdTRVJWSU5HEAESDwoLTk9UX1NFUlZJTkcQAjJaCgZI", + "ZWFsdGgSUAoFQ2hlY2sSIi5ncnBjLmhlYWx0aC52MS5IZWFsdGhDaGVja1Jl", + "cXVlc3QaIy5ncnBjLmhlYWx0aC52MS5IZWFsdGhDaGVja1Jlc3BvbnNlQhGq", + "Ag5HcnBjLkhlYWx0aC5WMWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1Alpha.HealthCheckRequest), global::Grpc.Health.V1Alpha.HealthCheckRequest.Parser, new[]{ "Host", "Service" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1Alpha.HealthCheckResponse), global::Grpc.Health.V1Alpha.HealthCheckResponse.Parser, new[]{ "Status" }, null, new[]{ typeof(global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus) }, null) + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1.HealthCheckRequest), global::Grpc.Health.V1.HealthCheckRequest.Parser, new[]{ "Service" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1.HealthCheckResponse), global::Grpc.Health.V1.HealthCheckResponse.Parser, new[]{ "Status" }, null, new[]{ typeof(global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus) }, null) })); } #endregion @@ -49,7 +48,7 @@ namespace Grpc.Health.V1Alpha { public static pb::MessageParser<HealthCheckRequest> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Health.V1Alpha.HealthReflection.Descriptor.MessageTypes[0]; } + get { return global::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[0]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -63,7 +62,6 @@ namespace Grpc.Health.V1Alpha { partial void OnConstruction(); public HealthCheckRequest(HealthCheckRequest other) : this() { - host_ = other.host_; service_ = other.service_; } @@ -71,18 +69,8 @@ namespace Grpc.Health.V1Alpha { return new HealthCheckRequest(this); } - /// <summary>Field number for the "host" field.</summary> - public const int HostFieldNumber = 1; - private string host_ = ""; - public string Host { - get { return host_; } - set { - host_ = pb::Preconditions.CheckNotNull(value, "value"); - } - } - /// <summary>Field number for the "service" field.</summary> - public const int ServiceFieldNumber = 2; + public const int ServiceFieldNumber = 1; private string service_ = ""; public string Service { get { return service_; } @@ -102,14 +90,12 @@ namespace Grpc.Health.V1Alpha { if (ReferenceEquals(other, this)) { return true; } - if (Host != other.Host) return false; if (Service != other.Service) return false; return true; } public override int GetHashCode() { int hash = 1; - if (Host.Length != 0) hash ^= Host.GetHashCode(); if (Service.Length != 0) hash ^= Service.GetHashCode(); return hash; } @@ -119,21 +105,14 @@ namespace Grpc.Health.V1Alpha { } public void WriteTo(pb::CodedOutputStream output) { - if (Host.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Host); - } if (Service.Length != 0) { - output.WriteRawTag(18); + output.WriteRawTag(10); output.WriteString(Service); } } public int CalculateSize() { int size = 0; - if (Host.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Host); - } if (Service.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); } @@ -144,9 +123,6 @@ namespace Grpc.Health.V1Alpha { if (other == null) { return; } - if (other.Host.Length != 0) { - Host = other.Host; - } if (other.Service.Length != 0) { Service = other.Service; } @@ -160,10 +136,6 @@ namespace Grpc.Health.V1Alpha { input.SkipLastField(); break; case 10: { - Host = input.ReadString(); - break; - } - case 18: { Service = input.ReadString(); break; } @@ -179,7 +151,7 @@ namespace Grpc.Health.V1Alpha { public static pb::MessageParser<HealthCheckResponse> Parser { get { return _parser; } } public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Health.V1Alpha.HealthReflection.Descriptor.MessageTypes[1]; } + get { return global::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[1]; } } pbr::MessageDescriptor pb::IMessage.Descriptor { @@ -202,8 +174,8 @@ namespace Grpc.Health.V1Alpha { /// <summary>Field number for the "status" field.</summary> public const int StatusFieldNumber = 1; - private global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus status_ = global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN; - public global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus Status { + private global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus status_ = global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN; + public global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus Status { get { return status_; } set { status_ = value; @@ -227,7 +199,7 @@ namespace Grpc.Health.V1Alpha { public override int GetHashCode() { int hash = 1; - if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) hash ^= Status.GetHashCode(); + if (Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) hash ^= Status.GetHashCode(); return hash; } @@ -236,7 +208,7 @@ namespace Grpc.Health.V1Alpha { } public void WriteTo(pb::CodedOutputStream output) { - if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { + if (Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { output.WriteRawTag(8); output.WriteEnum((int) Status); } @@ -244,7 +216,7 @@ namespace Grpc.Health.V1Alpha { public int CalculateSize() { int size = 0; - if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { + if (Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); } return size; @@ -254,7 +226,7 @@ namespace Grpc.Health.V1Alpha { if (other == null) { return; } - if (other.Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { + if (other.Status != global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { Status = other.Status; } } @@ -267,7 +239,7 @@ namespace Grpc.Health.V1Alpha { input.SkipLastField(); break; case 8: { - status_ = (global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus) input.ReadEnum(); + status_ = (global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus) input.ReadEnum(); break; } } diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 882edd56270b6fbb2173c5b6cfcf058a3dd7e8df..68320eb5c2effa410693eec82851005105a854b7 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -7,15 +7,15 @@ using System.Threading; using System.Threading.Tasks; using Grpc.Core; -namespace Grpc.Health.V1Alpha { +namespace Grpc.Health.V1 { public static class Health { - static readonly string __ServiceName = "grpc.health.v1alpha.Health"; + static readonly string __ServiceName = "grpc.health.v1.Health"; - static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckRequest> __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1Alpha.HealthCheckRequest.Parser.ParseFrom); - static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckResponse> __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1Alpha.HealthCheckResponse.Parser.ParseFrom); + static readonly Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom); + static readonly Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom); - static readonly Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse> __Method_Check = new Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse>( + static readonly Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse> __Method_Check = new Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>( MethodType.Unary, __ServiceName, "Check", @@ -25,22 +25,22 @@ namespace Grpc.Health.V1Alpha { // service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Grpc.Health.V1Alpha.HealthReflection.Descriptor.Services[0]; } + get { return global::Grpc.Health.V1.HealthReflection.Descriptor.Services[0]; } } // client interface public interface IHealthClient { - global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallOptions options); - AsyncUnaryCall<global::Grpc.Health.V1Alpha.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncUnaryCall<global::Grpc.Health.V1Alpha.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallOptions options); + global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, CallOptions options); + AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, CallOptions options); } // server-side interface public interface IHealth { - Task<global::Grpc.Health.V1Alpha.HealthCheckResponse> Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, ServerCallContext context); + Task<global::Grpc.Health.V1.HealthCheckResponse> Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context); } // client stub @@ -49,22 +49,22 @@ namespace Grpc.Health.V1Alpha { public HealthClient(Channel channel) : base(channel) { } - public global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_Check, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); } - public global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallOptions options) + public global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, CallOptions options) { var call = CreateCall(__Method_Check, options); return Calls.BlockingUnaryCall(call, request); } - public AsyncUnaryCall<global::Grpc.Health.V1Alpha.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_Check, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); } - public AsyncUnaryCall<global::Grpc.Health.V1Alpha.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, CallOptions options) + public AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, CallOptions options) { var call = CreateCall(__Method_Check, options); return Calls.AsyncUnaryCall(call, request); diff --git a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs index e2ad1a834bfd57c9943c369e8c7dd91e476f5802..21482b302b4dcc1659e5ea33cb2d08e52f0e1412 100644 --- a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs +++ b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs @@ -37,7 +37,7 @@ using System.Threading.Tasks; using Grpc.Core; using Grpc.Core.Utils; -using Grpc.Health.V1Alpha; +using Grpc.Health.V1; namespace Grpc.HealthCheck { @@ -48,44 +48,42 @@ namespace Grpc.HealthCheck /// <code> /// var serviceImpl = new HealthServiceImpl(); /// server = new Server(); - /// server.AddServiceDefinition(Grpc.Health.V1Alpha.Health.BindService(serviceImpl)); + /// server.AddServiceDefinition(Grpc.Health.V1.Health.BindService(serviceImpl)); /// </code> /// </summary> - public class HealthServiceImpl : Grpc.Health.V1Alpha.Health.IHealth + public class HealthServiceImpl : Grpc.Health.V1.Health.IHealth { private readonly object myLock = new object(); - private readonly Dictionary<Key, HealthCheckResponse.Types.ServingStatus> statusMap = - new Dictionary<Key, HealthCheckResponse.Types.ServingStatus>(); + private readonly Dictionary<string, HealthCheckResponse.Types.ServingStatus> statusMap = + new Dictionary<string, HealthCheckResponse.Types.ServingStatus>(); /// <summary> - /// Sets the health status for given host and service. + /// Sets the health status for given service. /// </summary> - /// <param name="host">The host. Cannot be null.</param> /// <param name="service">The service. Cannot be null.</param> /// <param name="status">the health status</param> - public void SetStatus(string host, string service, HealthCheckResponse.Types.ServingStatus status) + public void SetStatus(string service, HealthCheckResponse.Types.ServingStatus status) { lock (myLock) { - statusMap[CreateKey(host, service)] = status; + statusMap[service] = status; } } /// <summary> - /// Clears health status for given host and service. + /// Clears health status for given service. /// </summary> - /// <param name="host">The host. Cannot be null.</param> /// <param name="service">The service. Cannot be null.</param> - public void ClearStatus(string host, string service) + public void ClearStatus(string service) { lock (myLock) { - statusMap.Remove(CreateKey(host, service)); + statusMap.Remove(service); } } /// <summary> - /// Clears statuses for all hosts and services. + /// Clears statuses for all services. /// </summary> public void ClearAll() { @@ -105,11 +103,10 @@ namespace Grpc.HealthCheck { lock (myLock) { - var host = request.Host; var service = request.Service; HealthCheckResponse.Types.ServingStatus status; - if (!statusMap.TryGetValue(CreateKey(host, service), out status)) + if (!statusMap.TryGetValue(service, out status)) { // TODO(jtattermusch): returning specific status from server handler is not supported yet. throw new RpcException(new Status(StatusCode.NotFound, "")); @@ -117,22 +114,5 @@ namespace Grpc.HealthCheck return Task.FromResult(new HealthCheckResponse { Status = status }); } } - - private static Key CreateKey(string host, string service) - { - return new Key(host, service); - } - - private struct Key - { - public Key(string host, string service) - { - this.Host = GrpcPreconditions.CheckNotNull(host); - this.Service = GrpcPreconditions.CheckNotNull(service); - } - - readonly string Host; - readonly string Service; - } } } diff --git a/src/csharp/README.md b/src/csharp/README.md index 65ae0b5efda3ea55d96de1e521a1b42904838129..b4fa945ac988e65a571e4229b87b14342a86204c 100644 --- a/src/csharp/README.md +++ b/src/csharp/README.md @@ -12,9 +12,9 @@ Beta PREREQUISITES -------------- -- Windows: .NET Framework 4.5+, Visual Studio 2013 or 2015. -- Linux: Mono 3.2.8+, MonoDevelop 5.9 with NuGet add-in installed. -- Mac OS X: [homebrew][], Xamarin Studio with NuGet add-in installed. +- Windows: .NET Framework 4.5+, Visual Studio 2013 or 2015 +- Linux: Mono 4+, MonoDevelop 5.9+ (with NuGet add-in installed) +- Mac OS X: Xamarin Studio 5.9+ HOW TO USE -------------- @@ -24,66 +24,28 @@ HOW TO USE - Open Visual Studio and start a new project/solution. - Add NuGet package `Grpc` as a dependency (Project options -> Manage NuGet Packages). - That will also pull all the transitive dependencies (including the native libraries that + That will also pull all the transitive dependencies (including the gRPC native library that gRPC C# is using internally). **Linux (Debian)** -- Add [Debian jessie-backports][] to your `sources.list` file. Example: - - ```sh - echo "deb http://http.debian.net/debian jessie-backports main" | \ - sudo tee -a /etc/apt/sources.list - ``` - -- Install the gRPC Debian package - - ```sh - sudo apt-get update - sudo apt-get install libgrpc0 - ``` - -- gRPC C# depends on native shared library `libgrpc_csharp_ext.so` (Unix flavor of grpc_csharp_ext.dll). - This library is not part of the base gRPC debian package and needs to be installed manually from - a `.deb` file. Download the debian package `libgrpc_csharp_ext` from corresponding gRPC release on GitHub - and install it using `dpkg`. - - ```sh - # choose version corresponding to the version of libgrpc you've installed. - wget https://github.com/grpc/grpc/releases/download/release-0_11_0/libgrpc-csharp-ext0_0.11.0.0-1_amd64.deb - dpkg -i libgrpc-csharp-ext0_0.11.0.0-1_amd64.deb - ``` - - Open MonoDevelop and start a new project/solution. - Add NuGet package `Grpc` as a dependency (Project -> Add NuGet packages). + That will also pull all the transitive dependencies (including the gRPC native library that + gRPC C# is using internally). -- NOTE: Currently, there are no debian packages for the latest version Protocol Buffers compiler (_protoc_) - and the gRPC _protoc_ plugin. You can install them using [gRPC Linuxbrew instructions][]. +- NOTE: gRPC C# doesn't have a good story yet for shipping precompiled Linux version of Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin. You can install them using [gRPC Linuxbrew instructions][]. **Mac OS X** -- WARNING: As of now gRPC C# only works on 64bit version of Mono (because we don't compile - the native extension for C# in 32bit mode yet). That means your development experience - with Xamarin Studio on MacOS will not be great, as you won't be able to run your - code directly from Xamarin Studio (which requires 32bit version of Mono). - -- Install [homebrew][]. Run the following command to install gRPC C# native dependencies. - - ```sh - $ curl -fsSL https://goo.gl/getgrpc | bash - - ``` - This will download and run the [gRPC install script][], then install the latest version of gRPC C core and native C# extension. - It also installs Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin for C#. - -- Install 64-bit version of mono with command `brew install mono`. - - Open Xamarin Studio and start a new project/solution. - Add NuGet package `Grpc` as a dependency (Project -> Add NuGet packages). + That will also pull all the transitive dependencies (including the gRPC native library that + gRPC C# is using internally). -- *You will be able to build your project in Xamarin Studio, but to run or test it, - you will need to run it under 64-bit version of Mono.* +- NOTE: gRPC C# doesn't have a good story yet for shipping precompiled Mac OS X version of Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin. You can install them using [gRPC Homebrew instructions][]. BUILD FROM SOURCE ----------------- @@ -94,7 +56,7 @@ If you are a user of gRPC C#, go to Usage section above. **Windows** - The grpc_csharp_ext native library needs to be built so you can build the gRPC C# solution. You can - either build the native solution in `vsprojects/grpc.sln` from Visual Studio manually, or you can use + either build the native solution in `vsprojects/grpc_csharp_ext.sln` from Visual Studio manually, or you can use a convenience batch script that builds everything for you. ``` @@ -102,30 +64,28 @@ If you are a user of gRPC C#, go to Usage section above. > buildall.bat ``` -- Open Grpc.sln using Visual Studio. NuGet dependencies will be restored - upon build (you need to have NuGet add-in installed). +- Open Grpc.sln using Visual Studio. **Linux** +- The grpc_csharp_ext native library needs to be built so you can build the gRPC C# solution: ```sh - $ sudo apt-get install mono-devel - $ sudo apt-get install nunit nunit-console + # from the gRPC repository root + $ make CONFIG=dbg grpc_csharp_ext ``` -You can use older versions of MonoDevelop, but then you might need to restore -NuGet dependencies manually (by `nuget restore`), because older versions of MonoDevelop -don't support NuGet add-in. +- Use MonoDevelop to open the solution Grpc.sln + +**Mac OS X** -- Compile and install the gRPC C# extension library (that will be used via - P/Invoke from C#). +- The grpc_csharp_ext native library needs to be built so you can build the gRPC C# solution. + ```sh - $ make grpc_csharp_ext - $ sudo make install_grpc_csharp_ext + # from the gRPC repository root + $ tools/run_tests/run_tests.py -c dbg -l csharp --build_only ``` -- Use MonoDevelop to open the solution Grpc.sln - -- Build the solution & run all the tests from test view. +- Use Xamarin Studio to open the solution Grpc.sln RUNNING TESTS ------------- @@ -135,17 +95,9 @@ gRPC C# is using NUnit as the testing framework. Under Visual Studio, make sure NUnit test adapter is installed (under "Extensions and Updates"). Then you should be able to run all the tests using Test Explorer. -Under Monodevelop, make sure you installed "NUnit support" in Add-in manager. +Under Monodevelop or Xamarin Studio, make sure you installed "NUnit support" in Add-in manager. Then you should be able to run all the test from the Test View. -After building the solution, you can also run the tests from command line -using nunit-console tool. - -```sh -# from Grpc.Core.Test/bin/Debug directory -$ nunit-console Grpc.Core.Tests.dll -``` - gRPC team uses a Python script to simplify facilitate running tests for different languages. @@ -176,27 +128,15 @@ CONTENTS - Grpc.IntegrationTesting: Cross-language gRPC implementation testing (interop testing). -TROUBLESHOOTING +THE NATIVE DEPENDENCY --------------- -### Problem: Unable to load DLL 'grpc_csharp_ext.dll' - -Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. `grpc_csharp_ext` library is a native extension library that facilitates this by wrapping some C core API into a form that's more digestible for P/Invoke. If you get the above error, it means that the native dependencies could not be located by the C# runtime (or they are incompatible with the current runtime, so they could not be loaded). The solution to this is environment specific. - -- If you are developing on Windows in Visual Studio, the `grpc_csharp_ext.dll` that is shipped by gRPC nuget packages should be automatically copied to your build destination folder once you build. By adjusting project properties in your VS project file, you can influence which exact configuration of `grpc_csharp_ext.dll` will be used (based on VS version, bitness, debug/release configuration). - -- If you are running your application that is using gRPC on Windows machine that doesn't have Visual Studio installed, you might need to install [Visual C++ 2013 redistributable](https://www.microsoft.com/en-us/download/details.aspx?id=40784) that contains some system .dll libraries that `grpc_csharp_ext.dll` depends on (see #905 for more details). - -- On Linux (or Docker), you need to first install gRPC C core and `libgrpc_csharp_ext.so` shared libraries. - See [How to Use](#how-to-use) section for details how to install it. - Installation on a machine where your application is going to be deployed is no different. - -- On Mac, you need to first install gRPC C core and `libgrpc_csharp_ext.dylib` shared libraries using Homebrew. See above for installation instruction. - Installation on a machine where your application is going to be deployed is no different. +Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. `grpc_csharp_ext` library is a native extension library that facilitates this by wrapping some C core API into a form that's more digestible for P/Invoke. -- Possible cause for the problem is that the `grpc_csharp_ext` library is installed, but it has different bitness (32/64bit) than your C# runtime (in case you are using mono) or C# application. +Prior to version 0.13, installing `grpc_csharp_ext` was required to make gRPC work on Linux and MacOS. Starting with version 0.13, we have improved the packaging story significantly and precompiled versions of the native library for all supported platforms are now shipped with the NuGet package. Just installing the `Grpc` NuGet package should be the only step needed to use gRPC C#, regardless of your platform (Windows, Linux or Mac) and the bitness (32 or 64bit). [gRPC Linuxbrew instructions]:https://github.com/grpc/homebrew-grpc#quick-install-linux +[gRPC Homebrew instructions]:https://github.com/grpc/homebrew-grpc#quick-install-linux [homebrew]:http://brew.sh [gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install [grpc.io]: http://www.grpc.io/docs/installation/csharp.html diff --git a/src/csharp/generate_proto_csharp.sh b/src/csharp/generate_proto_csharp.sh index 0261a458af730dd3996a21e9f10d3e346fa68791..23e0540253a3ec226619959dbc8000a3bba741a1 100755 --- a/src/csharp/generate_proto_csharp.sh +++ b/src/csharp/generate_proto_csharp.sh @@ -42,7 +42,7 @@ $PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \ -I src/proto/math src/proto/math/math.proto $PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \ - -I src/proto/grpc/health/v1alpha src/proto/grpc/health/v1alpha/health.proto + -I src/proto/grpc/health/v1 src/proto/grpc/health/v1/health.proto $PROTOC --plugin=$PLUGIN --csharp_out=$TESTING_DIR --grpc_out=$TESTING_DIR \ -I . src/proto/grpc/testing/{control,empty,messages,payloads,services,stats,test}.proto diff --git a/src/node/health_check/health.js b/src/node/health_check/health.js index 1a2c0366875701b6b57cf52e0bbfabaf9137f2a2..6ab41571831b803f372fd7f32fd78a972d1ec2a3 100644 --- a/src/node/health_check/health.js +++ b/src/node/health_check/health.js @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,9 +38,9 @@ var grpc = require('../'); var _ = require('lodash'); var health_proto = grpc.load(__dirname + - '/../../proto/grpc/health/v1alpha/health.proto'); + '/../../proto/grpc/health/v1/health.proto'); -var HealthClient = health_proto.grpc.health.v1alpha.Health; +var HealthClient = health_proto.grpc.health.v1.Health; function HealthImplementation(statusMap) { this.statusMap = _.clone(statusMap); diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m index 00c4b8830d344104648115f2180d4757235ef47e..9a3e5b5009bcce48d7b60f4b75bf6d6c3800c3ac 100644 --- a/src/objective-c/tests/GRPCClientTests.m +++ b/src/objective-c/tests/GRPCClientTests.m @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +35,7 @@ #import <XCTest/XCTest.h> #import <GRPCClient/GRPCCall.h> +#import <GRPCClient/GRPCCall+ChannelArg.h> #import <GRPCClient/GRPCCall+OAuth2.h> #import <GRPCClient/GRPCCall+Tests.h> #import <ProtoRPC/ProtoMethod.h> @@ -45,6 +46,7 @@ static NSString * const kHostAddress = @"localhost:5050"; static NSString * const kPackage = @"grpc.testing"; static NSString * const kService = @"TestService"; +static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; static ProtoMethod *kInexistentMethod; static ProtoMethod *kEmptyCallMethod; @@ -127,8 +129,7 @@ static ProtoMethod *kUnaryCallMethod; XCTFail(@"Received unexpected response: %@", value); } completionHandler:^(NSError *errorOrNil) { XCTAssertNotNil(errorOrNil, @"Finished without error!"); - // TODO(jcanizales): The server should return code 12 UNIMPLEMENTED, not 5 NOT FOUND. - XCTAssertEqual(errorOrNil.code, 5, @"Finished with unexpected error: %@", errorOrNil); + XCTAssertEqual(errorOrNil.code, 12, @"Finished with unexpected error: %@", errorOrNil); [expectation fulfill]; }]; @@ -191,7 +192,6 @@ static ProtoMethod *kUnaryCallMethod; [self waitForExpectationsWithTimeout:8 handler:nil]; } -// TODO(jcanizales): Activate this test against the remote server. - (void)testMetadata { __weak XCTestExpectation *expectation = [self expectationWithDescription:@"RPC unauthorized."]; @@ -200,7 +200,7 @@ static ProtoMethod *kUnaryCallMethod; request.fillOauthScope = YES; GRXWriter *requestsWriter = [GRXWriter writerWithValue:[request data]]; - GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress + GRPCCall *call = [[GRPCCall alloc] initWithHost:kRemoteSSLHost path:kUnaryCallMethod.HTTPPath requestsWriter:requestsWriter]; @@ -257,4 +257,40 @@ static ProtoMethod *kUnaryCallMethod; [self waitForExpectationsWithTimeout:8 handler:nil]; } +// TODO(makarandd): Move to a different file that contains only unit tests +- (void)testExceptions { + // Try to set userAgentPrefix for host that is nil. This should cause + // an exception. + @try { + [GRPCCall setUserAgentPrefix:@"Foo" forHost:nil]; + XCTFail(@"Did not receive an exception when host is nil"); + } @catch(NSException *theException) { + NSLog(@"Received exception as expected: %@", theException.name); + } + + // Try to set parameters to nil for GRPCCall. This should cause an exception + @try { + GRPCCall *call = [[GRPCCall alloc] initWithHost:nil + path:nil + requestsWriter:nil]; + XCTFail(@"Did not receive an exception when parameters are nil"); + } @catch(NSException *theException) { + NSLog(@"Received exception as expected: %@", theException.name); + } + + + // Set state to Finished by force + GRXWriter *requestsWriter = [GRXWriter emptyWriter]; + [requestsWriter finishWithError:nil]; + @try { + GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress + path:kUnaryCallMethod.HTTPPath + requestsWriter:requestsWriter]; + XCTFail(@"Did not receive an exception when GRXWriter has incorrect state."); + } @catch(NSException *theException) { + NSLog(@"Received exception as expected: %@", theException.name); + } + +} + @end diff --git a/src/objective-c/tests/InteropTestsLocalSSL.m b/src/objective-c/tests/InteropTestsLocalSSL.m index 9d7afefbfe3cd37e4fa4f2940fbcab940375d1a0..155e334ecb2bec5ab0552293e7eb78e4c33b295f 100644 --- a/src/objective-c/tests/InteropTestsLocalSSL.m +++ b/src/objective-c/tests/InteropTestsLocalSSL.m @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,4 +57,15 @@ static NSString * const kLocalSSLHost = @"localhost:5051"; [super setUp]; } +- (void)testExceptions { + // Try to set userAgentPrefix for host that is nil. This should cause + // an exception. + @try { + [GRPCCall useTestCertsPath:nil testName:nil forHost:nil]; + XCTFail(@"Did not receive an exception when parameters are nil"); + } @catch(NSException *theException) { + NSLog(@"Received exception as expected: %@", theException.name); + } +} + @end diff --git a/src/objective-c/tests/RxLibraryUnitTests.m b/src/objective-c/tests/RxLibraryUnitTests.m index a67a4c6cd937a19ec486bba732e85401d30210fa..d34266281412d4dd24eff9a75db0b0cf0bc14a05 100644 --- a/src/objective-c/tests/RxLibraryUnitTests.m +++ b/src/objective-c/tests/RxLibraryUnitTests.m @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -137,4 +137,24 @@ XCTAssertEqualObjects(handler.errorOrNil, anyError); } +- (void)testBufferedPipeFinishWriteWhilePaused { + // Given: + CapturingSingleValueHandler *handler = [CapturingSingleValueHandler handler]; + id<GRXWriteable> writeable = [GRXWriteable writeableWithSingleHandler:handler.block]; + id anyValue = @7; + + // If: + GRXBufferedPipe *pipe = [GRXBufferedPipe pipe]; + // Write something, then finish + [pipe writeValue:anyValue]; + [pipe writesFinishedWithError:nil]; + // then start the writeable + [pipe startWithWriteable:writeable]; + + // Then: + XCTAssertEqual(handler.timesCalled, 1); + XCTAssertEqualObjects(handler.value, anyValue); + XCTAssertEqualObjects(handler.errorOrNil, nil); +} + @end diff --git a/src/proto/grpc/health/v1alpha/health.proto b/src/proto/grpc/health/v1/health.proto similarity index 93% rename from src/proto/grpc/health/v1alpha/health.proto rename to src/proto/grpc/health/v1/health.proto index 05f837dd9904ad7f9ea043abe59e1866dec7a99d..6e27606d1b6fdb4f3e658e0ff4b07d21f1bbc017 100644 --- a/src/proto/grpc/health/v1alpha/health.proto +++ b/src/proto/grpc/health/v1/health.proto @@ -29,12 +29,11 @@ syntax = "proto3"; -package grpc.health.v1alpha; -option csharp_namespace = "Grpc.Health.V1Alpha"; +package grpc.health.v1; +option csharp_namespace = "Grpc.Health.V1"; message HealthCheckRequest { - string host = 1; - string service = 2; + string service = 1; } message HealthCheckResponse { diff --git a/src/python/grpcio/precompiled.py b/src/python/grpcio/precompiled.py index 05c651b506f9b5785a9125a77420eb733a8cf9a3..ae2a0c835a0786867c14bb5c8974cf06642adb97 100644 --- a/src/python/grpcio/precompiled.py +++ b/src/python/grpcio/precompiled.py @@ -100,3 +100,5 @@ def update_setup_arguments(setup_arguments): sys.stderr.write( 'could not write precompiled extension to directory: {} -> {}\n' .format(url, target_path)) + return + setup_arguments['package_data']['grpc._cython'].append('cygrpc.so') diff --git a/src/python/grpcio_health_checking/grpc/health/v1alpha/__init__.py b/src/python/grpcio_health_checking/grpc/health/v1/__init__.py similarity index 97% rename from src/python/grpcio_health_checking/grpc/health/v1alpha/__init__.py rename to src/python/grpcio_health_checking/grpc/health/v1/__init__.py index 708651910607ffb686d781713f6893567821b9fd..13aac79160b8db0fd6863590a4d044464b72dbcc 100644 --- a/src/python/grpcio_health_checking/grpc/health/v1alpha/__init__.py +++ b/src/python/grpcio_health_checking/grpc/health/v1/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/src/python/grpcio_health_checking/grpc/health/v1alpha/health.proto b/src/python/grpcio_health_checking/grpc/health/v1/health.proto similarity index 96% rename from src/python/grpcio_health_checking/grpc/health/v1alpha/health.proto rename to src/python/grpcio_health_checking/grpc/health/v1/health.proto index 57f4aaa9c08d9bbc81aa755cf6b0b3efb76d8adb..de10719b6ced765117e2a4c5672af8a010fa2bd3 100644 --- a/src/python/grpcio_health_checking/grpc/health/v1alpha/health.proto +++ b/src/python/grpcio_health_checking/grpc/health/v1/health.proto @@ -1,4 +1,4 @@ -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ syntax = "proto3"; -package grpc.health.v1alpha; +package grpc.health.v1; message HealthCheckRequest { string service = 1; diff --git a/src/python/grpcio_health_checking/grpc/health/v1alpha/health.py b/src/python/grpcio_health_checking/grpc/health/v1/health.py similarity index 96% rename from src/python/grpcio_health_checking/grpc/health/v1alpha/health.py rename to src/python/grpcio_health_checking/grpc/health/v1/health.py index 9dfcd962f06142a6f6f85dee8dde2338635d4c58..60cbd644330b2ac48126fed40c58768de087c007 100644 --- a/src/python/grpcio_health_checking/grpc/health/v1alpha/health.py +++ b/src/python/grpcio_health_checking/grpc/health/v1/health.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ import abc import enum import threading -from grpc.health.v1alpha import health_pb2 +from grpc.health.v1 import health_pb2 @enum.unique @@ -64,7 +64,7 @@ class _HealthServicer(health_pb2.EarlyAdopterHealthServicer): def set(service, status): if not isinstance(status, HealthStatus): - raise TypeError('expected grpc.health.v1alpha.health.HealthStatus ' + raise TypeError('expected grpc.health.v1.health.HealthStatus ' 'for argument `status` but got {}'.format(status)) with self._server_status_lock: self._server_status[service] = status diff --git a/src/ruby/.rubocop.yml b/src/ruby/.rubocop.yml index dd57ab60828bc0bf6902ae6ef571992feb4f957d..ff5cf8db83190a6fab07d6c37cbf4f626a2fb29e 100644 --- a/src/ruby/.rubocop.yml +++ b/src/ruby/.rubocop.yml @@ -7,7 +7,7 @@ AllCops: - 'bin/apis/**/*' - 'bin/math.rb' - 'bin/math_services.rb' - - 'pb/grpc/health/v1alpha/*' + - 'pb/grpc/health/v1/*' - 'pb/test/**/*' Metrics/CyclomaticComplexity: diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index eefdb93d6734b7c30afdca549301f0e0cdce2822..0f9b18fa212a44278d80222f653bc59f483d44d1 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -269,20 +269,9 @@ static void Init_grpc_time_consts() { id_tv_nsec = rb_intern("tv_nsec"); } -/* - TODO: find an alternative to ruby_vm_at_exit that is ok in Ruby 2.0 where - RUBY_TYPED_FREE_IMMEDIATELY is not defined. - - At the moment, registering a function using ruby_vm_at_exit segfaults in Ruby - 2.0. This is not an issue with the gRPC handler. More likely, this was an - in issue with 2.0 that got resolved in 2.1 and has not been backported. -*/ -#ifdef RUBY_TYPED_FREE_IMMEDIATELY -static void grpc_rb_shutdown(ruby_vm_t *vm) { - (void)vm; +static void grpc_rb_shutdown(void) { grpc_shutdown(); } -#endif /* Initialize the GRPC module structs */ @@ -300,18 +289,30 @@ VALUE sym_code = Qundef; VALUE sym_details = Qundef; VALUE sym_metadata = Qundef; +static gpr_once g_once_init = GPR_ONCE_INIT; + +static void grpc_ruby_once_init() { + grpc_init(); + atexit(grpc_rb_shutdown); +} + void Init_grpc_c() { if (!grpc_rb_load_core()) { rb_raise(rb_eLoadError, "Couldn't find or load gRPC's dynamic C core"); return; } - grpc_init(); - -/* TODO: find alternative to ruby_vm_at_exit that is ok in Ruby 2.0 */ -#ifdef RUBY_TYPED_FREE_IMMEDIATELY - ruby_vm_at_exit(grpc_rb_shutdown); -#endif + /* ruby_vm_at_exit doesn't seem to be working. It would crash once every + * blue moon, and some users are getting it repeatedly. See the discussions + * - https://github.com/grpc/grpc/pull/5337 + * - https://bugs.ruby-lang.org/issues/12095 + * + * In order to still be able to handle the (unlikely) situation where the + * extension is loaded by a first Ruby VM that is subsequently destroyed, + * then loaded again by another VM within the same process, we need to + * schedule our initialization and destruction only once. + */ + gpr_once_init(&g_once_init, grpc_ruby_once_init); grpc_rb_mGRPC = rb_define_module("GRPC"); grpc_rb_mGrpcCore = rb_define_module_under(grpc_rb_mGRPC, "Core"); diff --git a/src/ruby/lib/grpc/core/time_consts.rb b/src/ruby/lib/grpc/core/time_consts.rb index e6dae7b08a065c9999dec3bbbe3a33a4f3521d19..c8eae7806b349b78affbcb279cc46210740d4c44 100644 --- a/src/ruby/lib/grpc/core/time_consts.rb +++ b/src/ruby/lib/grpc/core/time_consts.rb @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -require 'grpc' +require 'grpc/grpc' # GRPC contains the General RPC module. module GRPC diff --git a/src/ruby/lib/grpc/errors.rb b/src/ruby/lib/grpc/errors.rb index f1201c17040737c350552aad505ea2fca455bd5f..2227ee1f12b503d3ee92b89e11ad042412cda5c4 100644 --- a/src/ruby/lib/grpc/errors.rb +++ b/src/ruby/lib/grpc/errors.rb @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -require 'grpc' +require 'grpc/grpc' # GRPC contains the General RPC module. module GRPC diff --git a/src/ruby/pb/README.md b/src/ruby/pb/README.md index e04aef185caaa51720922dbd73e02c82da147450..d9e30bbc854434947bb9560d4115d448170ef64a 100644 --- a/src/ruby/pb/README.md +++ b/src/ruby/pb/README.md @@ -11,7 +11,7 @@ The code is is generated using the protoc (> 3.0.0.alpha.1) and the grpc_ruby_plugin. These must be installed to regenerate the IDL defined classes, but that's not necessary just to use them. -health_check/v1alpha +health_check/v1 -------------------- This package defines the surface of a simple health check service that gRPC @@ -20,7 +20,7 @@ re-generate the surface. ```bash $ # (from this directory) -$ protoc -I ../../proto ../../proto/grpc/health/v1alpha/health.proto \ +$ protoc -I ../../proto ../../proto/grpc/health/v1/health.proto \ --grpc_out=. \ --ruby_out=. \ --plugin=protoc-gen-grpc=`which grpc_ruby_plugin` diff --git a/src/ruby/pb/generate_proto_ruby.sh b/src/ruby/pb/generate_proto_ruby.sh index 576b1c08d300f0a1bf97388a38ae71e18b91524f..86c082099d98304859e4ab55f5a6512b0116f8ab 100755 --- a/src/ruby/pb/generate_proto_ruby.sh +++ b/src/ruby/pb/generate_proto_ruby.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -35,7 +35,7 @@ cd $(dirname $0)/../../.. PROTOC=bins/opt/protobuf/protoc PLUGIN=protoc-gen-grpc=bins/opt/grpc_ruby_plugin -$PROTOC -I src/proto src/proto/grpc/health/v1alpha/health.proto \ +$PROTOC -I src/proto src/proto/grpc/health/v1/health.proto \ --grpc_out=src/ruby/pb \ --ruby_out=src/ruby/pb \ --plugin=$PLUGIN diff --git a/src/ruby/pb/grpc/health/checker.rb b/src/ruby/pb/grpc/health/checker.rb index 8c692e74f900bbc78b15685e4df41274f358a8ba..9f1ee65c41935164c322cde79e7412265010df0e 100644 --- a/src/ruby/pb/grpc/health/checker.rb +++ b/src/ruby/pb/grpc/health/checker.rb @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/health/v1alpha/health_services' +require 'grpc/health/v1/health_services' require 'thread' module Grpc @@ -36,9 +36,9 @@ module Grpc # service. module Health # Checker is implementation of the schema-specified health checking service. - class Checker < V1alpha::Health::Service + class Checker < V1::Health::Service StatusCodes = GRPC::Core::StatusCodes - HealthCheckResponse = V1alpha::HealthCheckResponse + HealthCheckResponse = V1::HealthCheckResponse # Initializes the statuses of participating services def initialize @@ -50,20 +50,20 @@ module Grpc def check(req, _call) status = nil @status_mutex.synchronize do - status = @statuses["#{req.host}/#{req.service}"] + status = @statuses["#{req.service}"] end fail GRPC::BadStatus, StatusCodes::NOT_FOUND if status.nil? HealthCheckResponse.new(status: status) end - # Adds the health status for a given host and service. - def add_status(host, service, status) - @status_mutex.synchronize { @statuses["#{host}/#{service}"] = status } + # Adds the health status for a given service. + def add_status(service, status) + @status_mutex.synchronize { @statuses["#{service}"] = status } end - # Clears the status for the given host or service. - def clear_status(host, service) - @status_mutex.synchronize { @statuses.delete("#{host}/#{service}") } + # Clears the status for the given service. + def clear_status(service) + @status_mutex.synchronize { @statuses.delete("#{service}") } end # Clears alls the statuses. diff --git a/src/ruby/pb/grpc/health/v1/health.rb b/src/ruby/pb/grpc/health/v1/health.rb new file mode 100644 index 0000000000000000000000000000000000000000..aa87a93918b123f6af2f91f58fc7f004b91481b0 --- /dev/null +++ b/src/ruby/pb/grpc/health/v1/health.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: grpc/health/v1/health.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.health.v1.HealthCheckRequest" do + optional :service, :string, 1 + end + add_message "grpc.health.v1.HealthCheckResponse" do + optional :status, :enum, 1, "grpc.health.v1.HealthCheckResponse.ServingStatus" + end + add_enum "grpc.health.v1.HealthCheckResponse.ServingStatus" do + value :UNKNOWN, 0 + value :SERVING, 1 + value :NOT_SERVING, 2 + end +end + +module Grpc + module Health + module V1 + HealthCheckRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckRequest").msgclass + HealthCheckResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse").msgclass + HealthCheckResponse::ServingStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse.ServingStatus").enummodule + end + end +end diff --git a/src/ruby/pb/grpc/health/v1alpha/health_services.rb b/src/ruby/pb/grpc/health/v1/health_services.rb similarity index 71% rename from src/ruby/pb/grpc/health/v1alpha/health_services.rb rename to src/ruby/pb/grpc/health/v1/health_services.rb index d5cba2e9ec71c22555c3ebb7c4f739e6bb3c6ed8..cb79b20437f573b40f9c3f6265eec722db4e87c7 100644 --- a/src/ruby/pb/grpc/health/v1alpha/health_services.rb +++ b/src/ruby/pb/grpc/health/v1/health_services.rb @@ -1,12 +1,12 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: grpc/health/v1alpha/health.proto for package 'grpc.health.v1alpha' +# Source: grpc/health/v1/health.proto for package 'grpc.health.v1' require 'grpc' -require 'grpc/health/v1alpha/health' +require 'grpc/health/v1/health' module Grpc module Health - module V1alpha + module V1 module Health # TODO: add proto service documentation here @@ -16,7 +16,7 @@ module Grpc self.marshal_class_method = :encode self.unmarshal_class_method = :decode - self.service_name = 'grpc.health.v1alpha.Health' + self.service_name = 'grpc.health.v1.Health' rpc :Check, HealthCheckRequest, HealthCheckResponse end diff --git a/src/ruby/pb/grpc/health/v1alpha/health.rb b/src/ruby/pb/grpc/health/v1alpha/health.rb deleted file mode 100644 index 9c04298ea54394cda76b9953b15bfae08755f8ce..0000000000000000000000000000000000000000 --- a/src/ruby/pb/grpc/health/v1alpha/health.rb +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: grpc/health/v1alpha/health.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.health.v1alpha.HealthCheckRequest" do - optional :host, :string, 1 - optional :service, :string, 2 - end - add_message "grpc.health.v1alpha.HealthCheckResponse" do - optional :status, :enum, 1, "grpc.health.v1alpha.HealthCheckResponse.ServingStatus" - end - add_enum "grpc.health.v1alpha.HealthCheckResponse.ServingStatus" do - value :UNKNOWN, 0 - value :SERVING, 1 - value :NOT_SERVING, 2 - end -end - -module Grpc - module Health - module V1alpha - HealthCheckRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1alpha.HealthCheckRequest").msgclass - HealthCheckResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1alpha.HealthCheckResponse").msgclass - HealthCheckResponse::ServingStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1alpha.HealthCheckResponse.ServingStatus").enummodule - end - end -end diff --git a/src/ruby/spec/pb/health/checker_spec.rb b/src/ruby/spec/pb/health/checker_spec.rb index c1decd822a76062a58ea9dda0e83a18ec7776590..9bb79bb4cae057c8a5ebab92467570d570076e2d 100644 --- a/src/ruby/spec/pb/health/checker_spec.rb +++ b/src/ruby/spec/pb/health/checker_spec.rb @@ -28,7 +28,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/health/v1alpha/health' +require 'grpc/health/v1/health' require 'grpc/health/checker' require 'open3' require 'tmpdir' @@ -43,7 +43,7 @@ describe 'Health protobuf code generation' do skip 'protoc || grpc_ruby_plugin missing, cannot verify health code-gen' else it 'should already be loaded indirectly i.e, used by the other specs' do - expect(require('grpc/health/v1alpha/health_services')).to be(false) + expect(require('grpc/health/v1/health_services')).to be(false) end it 'should have the same content as created by code generation' do @@ -52,7 +52,7 @@ describe 'Health protobuf code generation' do # Get the current content service_path = File.join(root_dir, 'ruby', 'pb', 'grpc', - 'health', 'v1alpha', 'health_services.rb') + 'health', 'v1', 'health_services.rb') want = nil File.open(service_path) { |f| want = f.read } @@ -61,12 +61,12 @@ describe 'Health protobuf code generation' do plugin = plugin.strip got = nil Dir.mktmpdir do |tmp_dir| - gen_out = File.join(tmp_dir, 'grpc', 'health', 'v1alpha', + gen_out = File.join(tmp_dir, 'grpc', 'health', 'v1', 'health_services.rb') pid = spawn( 'protoc', '-I.', - 'grpc/health/v1alpha/health.proto', + 'grpc/health/v1/health.proto', "--grpc_out=#{tmp_dir}", "--plugin=protoc-gen-grpc=#{plugin}", chdir: pb_dir) @@ -81,27 +81,17 @@ end describe Grpc::Health::Checker do StatusCodes = GRPC::Core::StatusCodes - ServingStatus = Grpc::Health::V1alpha::HealthCheckResponse::ServingStatus - HCResp = Grpc::Health::V1alpha::HealthCheckResponse - HCReq = Grpc::Health::V1alpha::HealthCheckRequest + ServingStatus = Grpc::Health::V1::HealthCheckResponse::ServingStatus + HCResp = Grpc::Health::V1::HealthCheckResponse + HCReq = Grpc::Health::V1::HealthCheckRequest success_tests = [ { - desc: 'neither host or service are specified', - host: '', + desc: 'the service is not specified', service: '' }, { - desc: 'only the host is specified', - host: 'test-fake-host', - service: '' - }, { - desc: 'the host and service are specified', - host: 'test-fake-host', + desc: 'the service is specified', service: 'fake-service-1' - }, { - desc: 'only the service is specified', - host: '', - service: 'fake-service-2' } ] @@ -114,9 +104,8 @@ describe Grpc::Health::Checker do context 'method `add_status` and `check`' do success_tests.each do |t| it "should succeed when #{t[:desc]}" do - subject.add_status(t[:host], t[:service], ServingStatus::NOT_SERVING) - got = subject.check(HCReq.new(host: t[:host], service: t[:service]), - nil) + subject.add_status(t[:service], ServingStatus::NOT_SERVING) + got = subject.check(HCReq.new(service: t[:service]), nil) want = HCResp.new(status: ServingStatus::NOT_SERVING) expect(got).to eq(want) end @@ -127,7 +116,7 @@ describe Grpc::Health::Checker do success_tests.each do |t| it "should fail with NOT_FOUND when #{t[:desc]}" do blk = proc do - subject.check(HCReq.new(host: t[:host], service: t[:service]), nil) + subject.check(HCReq.new(service: t[:service]), nil) end expected_msg = /#{StatusCodes::NOT_FOUND}/ expect(&blk).to raise_error GRPC::BadStatus, expected_msg @@ -138,16 +127,14 @@ describe Grpc::Health::Checker do context 'method `clear_status`' do success_tests.each do |t| it "should fail after clearing status when #{t[:desc]}" do - subject.add_status(t[:host], t[:service], ServingStatus::NOT_SERVING) - got = subject.check(HCReq.new(host: t[:host], service: t[:service]), - nil) + subject.add_status(t[:service], ServingStatus::NOT_SERVING) + got = subject.check(HCReq.new(service: t[:service]), nil) want = HCResp.new(status: ServingStatus::NOT_SERVING) expect(got).to eq(want) - subject.clear_status(t[:host], t[:service]) + subject.clear_status(t[:service]) blk = proc do - subject.check(HCReq.new(host: t[:host], service: t[:service]), - nil) + subject.check(HCReq.new(service: t[:service]), nil) end expected_msg = /#{StatusCodes::NOT_FOUND}/ expect(&blk).to raise_error GRPC::BadStatus, expected_msg @@ -158,9 +145,8 @@ describe Grpc::Health::Checker do context 'method `clear_all`' do it 'should return NOT_FOUND after being invoked' do success_tests.each do |t| - subject.add_status(t[:host], t[:service], ServingStatus::NOT_SERVING) - got = subject.check(HCReq.new(host: t[:host], service: t[:service]), - nil) + subject.add_status(t[:service], ServingStatus::NOT_SERVING) + got = subject.check(HCReq.new(service: t[:service]), nil) want = HCResp.new(status: ServingStatus::NOT_SERVING) expect(got).to eq(want) end @@ -169,7 +155,7 @@ describe Grpc::Health::Checker do success_tests.each do |t| blk = proc do - subject.check(HCReq.new(host: t[:host], service: t[:service]), nil) + subject.check(HCReq.new(service: t[:service]), nil) end expected_msg = /#{StatusCodes::NOT_FOUND}/ expect(&blk).to raise_error GRPC::BadStatus, expected_msg @@ -203,7 +189,7 @@ describe Grpc::Health::Checker do it 'should receive the correct status', server: true do @srv.handle(subject) - subject.add_status('', '', ServingStatus::NOT_SERVING) + subject.add_status('', ServingStatus::NOT_SERVING) t = Thread.new { @srv.run } @srv.wait_till_running @@ -221,7 +207,7 @@ describe Grpc::Health::Checker do @srv.wait_till_running blk = proc do stub = CheckerStub.new(@host, :this_channel_is_insecure, **@client_opts) - stub.check(HCReq.new(host: 'unknown', service: 'unknown')) + stub.check(HCReq.new(service: 'unknown')) end expected_msg = /#{StatusCodes::NOT_FOUND}/ expect(&blk).to raise_error GRPC::BadStatus, expected_msg diff --git a/templates/Makefile.template b/templates/Makefile.template index 7aa6ad71e26a2e1a18c950f350ddcc20e75d7a65..c54c146620fb4e2d90fc8bd0f0f68f18cb08b51f 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -187,6 +187,12 @@ CXX11_CHECK_CMD = $(CXX) -std=c++11 -o $(TMPOUT) -c test/build/c++11.cc HAS_CXX11 = $(shell $(CXX11_CHECK_CMD) 2> /dev/null && echo true || echo false) + CHECK_SHADOW_WORKS_CMD = $(CC) -std=c99 -Werror -Wshadow -o $(TMPOUT) -c test/build/shadow.c + HAS_WORKING_SHADOW = $(shell $(CHECK_SHADOW_WORKS_CMD) 2> /dev/null && echo true || echo false) + ifeq ($(HAS_WORKING_SHADOW),true) + W_SHADOW=-Wshadow + endif + CHECK_NO_SHIFT_NEGATIVE_VALUE_CMD = $(CC) -std=c99 -Werror -Wno-shift-negative-value -o $(TMPOUT) -c test/build/empty.c HAS_NO_SHIFT_NEGATIVE_VALUE = $(shell $(CHECK_NO_SHIFT_NEGATIVE_VALUE_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_NO_SHIFT_NEGATIVE_VALUE),true) @@ -207,7 +213,7 @@ DEFINES += $(EXTRA_DEFINES) endif - CFLAGS += -std=c99 -Wsign-conversion -Wconversion -Wshadow + CFLAGS += -std=c99 -Wsign-conversion -Wconversion $(W_SHADOW) ifeq ($(HAS_CXX11),true) CXXFLAGS += -std=c++11 else @@ -352,6 +358,7 @@ OPENSSL_ALPN_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) OPENSSL_NPN_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/openssl-npn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) + BORINGSSL_COMPILE_CHECK_CMD = $(CC) $(CPPFLAGS) ${defaults.boringssl.CPPFLAGS} $(CFLAGS) ${defaults.boringssl.CFLAGS} -o $(TMPOUT) test/build/boringssl.c $(LDFLAGS) ZLIB_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS) PROTOBUF_CHECK_CMD = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS) @@ -436,10 +443,13 @@ # Note that for testing purposes, one can do: # make HAS_EMBEDDED_OPENSSL_ALPN=false # to emulate the fact we do not have OpenSSL in the third_party folder. - ifeq ($(wildcard third_party/boringssl/include/openssl/ssl.h),) + ifneq ($(wildcard third_party/${openssl_fallback.extraction_dir}/libssl.a),) + HAS_EMBEDDED_OPENSSL_ALPN = third_party/${openssl_fallback.extraction_dir} + else ifeq ($(wildcard third_party/boringssl/include/openssl/ssl.h),) HAS_EMBEDDED_OPENSSL_ALPN = false else - HAS_EMBEDDED_OPENSSL_ALPN = true + CAN_COMPILE_EMBEDDED_OPENSSL ?= $(shell $(BORINGSSL_COMPILE_CHECK_CMD) 2> /dev/null && echo true || echo false) + HAS_EMBEDDED_OPENSSL_ALPN = $(CAN_COMPILE_EMBEDDED_OPENSSL) endif ifeq ($(wildcard third_party/zlib/zlib.h),) @@ -498,8 +508,8 @@ EMBED_OPENSSL ?= false NO_SECURE ?= false else # HAS_SYSTEM_OPENSSL_ALPN=false - ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true) - EMBED_OPENSSL ?= true + ifneq ($(HAS_EMBEDDED_OPENSSL_ALPN),false) + EMBED_OPENSSL ?= $(HAS_EMBEDDED_OPENSSL_ALPN) NO_SECURE ?= false else # HAS_EMBEDDED_OPENSSL_ALPN=false ifeq ($(HAS_SYSTEM_OPENSSL_NPN),true) @@ -520,6 +530,12 @@ OPENSSL_MERGE_OBJS += $(LIBBORINGSSL_OBJS) # need to prefix these to ensure overriding system libraries CPPFLAGS := -Ithird_party/boringssl/include $(CPPFLAGS) + else ifneq ($(EMBED_OPENSSL),false) + OPENSSL_DEP += $(EMBED_OPENSSL)/libssl.a $(EMBED_OPENSSL)/libcrypto.a + OPENSSL_MERGE_LIBS += $(EMBED_OPENSSL)/libssl.a $(EMBED_OPENSSL)/libcrypto.a + OPENSSL_MERGE_OBJS += $(wildcard $(EMBED_OPENSSL)/grpc_obj/*.o) + # need to prefix these to ensure overriding system libraries + CPPFLAGS := -I$(EMBED_OPENSSL)/include $(CPPFLAGS) else # EMBED_OPENSSL=false ifeq ($(HAS_PKG_CONFIG),true) OPENSSL_PKG_CONFIG = true @@ -706,8 +722,9 @@ @echo @echo "DEPENDENCY ERROR" @echo - @echo "The target you are trying to run requires OpenSSL." - @echo "Your system doesn't have it, and neither does the third_party directory." + @echo "The target you are trying to run requires an OpenSSL implementation." + @echo "Your system doesn't have one, and either the third_party directory" + @echo "doesn't have it, or your compiler can't build BoringSSL." @echo @echo "Please consult INSTALL to get more information." @echo @@ -1846,3 +1863,9 @@ strip_cxx strip-shared_cxx strip-static_cxx \ dep_c dep_cxx bins_dep_c bins_dep_cxx \ clean + + .PHONY: printvars + printvars: + @$(foreach V,$(sort $(.VARIABLES)), \ + $(if $(filter-out environment% default automatic, \ + $(origin $V)),$(warning $V=$($V) ($(value $V))))) diff --git a/templates/config.m4.template b/templates/config.m4.template index dbc12188dc00cd65525f429f566848b920deb6b8..5e73901efa9b758729916a021dd92862990d354d 100644 --- a/templates/config.m4.template +++ b/templates/config.m4.template @@ -41,4 +41,18 @@ , $ext_shared, , -Wall -Werror -std=c11 ${"\\"} -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN ${"\\"} -D_HAS_EXCEPTIONS=0 -DNOMINMAX) + + PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc) + <% + dirs = {} + for lib in libs: + if lib.name in php_config_m4.get('deps', []): + for source in lib.src: + dirs[source[:source.rfind('/')]] = 1 + dirs = dirs.keys() + dirs.sort() + %> + % for dir in dirs: + PHP_ADD_BUILD_DIR($ext_builddir/${dir}) + % endfor fi diff --git a/templates/package.xml.template b/templates/package.xml.template index 455b002e64a0a4788943c13667391b02696172c9..067c8839d5a849f20c14a0919f53ab00217b3793 100644 --- a/templates/package.xml.template +++ b/templates/package.xml.template @@ -12,7 +12,7 @@ <email>grpc-packages@google.com</email> <active>yes</active> </lead> - <%! from time import strftime %><date>${"%Y-%m-%d" | strftime}</date> + <date>2016-02-24</date> <time>16:06:07</time> <version> <release>0.8.0</release> @@ -149,7 +149,7 @@ <release>beta</release> <api>beta</api> </stability> - <date>${"%Y-%m-%d" | strftime}</date> + <date>2016-02-24</date> <license>BSD</license> <notes> - Simplify gRPC PHP installation #4517 diff --git a/templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template index 294ae00b4c7ad2eb33713fc73325d54a0e2d82a6..49371aaa3bbc6abbff53f510528304e81c2e22e2 100644 --- a/templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template @@ -1,6 +1,6 @@ %YAML 1.2 --- | - # Copyright 2015-2016, Google Inc. + # Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,18 +28,21 @@ # 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. - + FROM debian:squeeze - + <%include file="../../apt_get_basic.include" args="skip_golang=True"/> - + # libgflags-dev is not available on squeezy RUN apt-get update && apt-get -y install libgtest-dev libc++-dev clang && apt-get clean - + RUN apt-get update && apt-get -y install python-pip && apt-get clean RUN pip install argparse - + + RUN wget ${openssl_fallback.base_uri + openssl_fallback.tarball} + + ENV POST_GIT_STEP tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh + <%include file="../../run_tests_addons.include" args="skip_zookeeper=True"/> # Define the default command. CMD ["bash"] - \ No newline at end of file diff --git a/templates/tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh.template b/templates/tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh.template new file mode 100644 index 0000000000000000000000000000000000000000..b885101748410804cef50dfc6aa7a7d2e5bfff64 --- /dev/null +++ b/templates/tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh.template @@ -0,0 +1,37 @@ +%YAML 1.2 +--- | + #!/bin/bash + # Copyright 2016, 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. + + set -ex + + cd /var/local/git/grpc + cp /${openssl_fallback.tarball} third_party + ./tools/openssl/use_openssl.sh diff --git a/templates/tools/openssl/use_openssl.sh.template b/templates/tools/openssl/use_openssl.sh.template new file mode 100644 index 0000000000000000000000000000000000000000..5fb377154a1b18fbd14a9090f74e34cb9574dd1c --- /dev/null +++ b/templates/tools/openssl/use_openssl.sh.template @@ -0,0 +1,63 @@ +%YAML 1.2 +--- | + #!/bin/bash + + # Copyright 2015-2016, 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. + + set -ex + + cd $(dirname $0)/../.. + set root=`pwd` + CC=${"${CC:-cc}"} + + # allow openssl to be pre-downloaded + if [ ! -e third_party/${openssl_fallback.tarball} ] + then + echo "Downloading ${openssl_fallback.base_uri + openssl_fallback.tarball} to third_party/${openssl_fallback.tarball}" + wget ${openssl_fallback.base_uri + openssl_fallback.tarball} -O third_party/${openssl_fallback.tarball} + fi + + # clean openssl directory + rm -rf third_party/${openssl_fallback.extraction_dir} + + # extract archive + cd third_party + tar xfz ${openssl_fallback.tarball} + + # build openssl + cd ${openssl_fallback.extraction_dir} + CC="$CC -fPIC -fvisibility=hidden" ./config no-asm + make + + # generate the 'grpc_obj' directory needed by the makefile + mkdir grpc_obj + cd grpc_obj + ar x ../libcrypto.a + ar x ../libssl.a diff --git a/templates/tools/run_tests/tests.json.template b/templates/tools/run_tests/tests.json.template index 9a84783467ac3abe4b70e5ee301e98214234a4ab..5690874415a585fa70fbc557e7fc2e5070082cf2 100644 --- a/templates/tools/run_tests/tests.json.template +++ b/templates/tools/run_tests/tests.json.template @@ -3,11 +3,12 @@ <%! import json %> - + ${json.dumps([{"name": tgt.name, "language": tgt.language, "platforms": tgt.platforms, "ci_platforms": tgt.ci_platforms, + "gtest": tgt.gtest, "exclude_configs": tgt.get("exclude_configs", []), "args": [], "flaky": tgt.flaky, diff --git a/test/build/boringssl.c b/test/build/boringssl.c new file mode 100644 index 0000000000000000000000000000000000000000..a31d4bf3964df7d86cb73409aa543777712663c6 --- /dev/null +++ b/test/build/boringssl.c @@ -0,0 +1,51 @@ +/* + * + * Copyright 2016, 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. + * + */ + +// Check that boringssl is going to compile + +#include <stdio.h> +#include <unistd.h> + +// boringssl uses anonymous unions +struct foo { + union { + int a; + int b; + }; +}; + +int main(void) { + const char *close = "this should not shadow"; + printf("%s\n", close); + return 0; +} diff --git a/test/build/shadow.c b/test/build/shadow.c new file mode 100644 index 0000000000000000000000000000000000000000..51d4f9e3852bd0ca9ecf72f5d66d2d99c5f51b37 --- /dev/null +++ b/test/build/shadow.c @@ -0,0 +1,43 @@ +/* + * + * Copyright 2016, 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. + * + */ + +// Check that boringssl is going to compile + +#include <stdio.h> +#include <unistd.h> + +int main(void) { + const char *close = "this should not shadow"; + printf("%s\n", close); + return 0; +} diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index ce8e4d2a109762ac28c70135bfdd4200debda87f..42757974b22e97a0c627d3942c8f6b4e6527a3d6 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -904,9 +904,9 @@ TEST_P(End2endTest, SimultaneousReadWritesDone) { std::thread reader_thread(ReaderThreadFunc, stream.get(), &ev); gpr_event_wait(&ev, gpr_inf_future(GPR_CLOCK_REALTIME)); stream->WritesDone(); + reader_thread.join(); Status s = stream->Finish(); EXPECT_TRUE(s.ok()); - reader_thread.join(); } TEST_P(End2endTest, ChannelState) { diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index aecbae95f9e079f3a8debe3ac62012f3d7b2ea6c..2dc83f0f29292a0042201300b5fb26f1f16562e9 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -112,12 +112,12 @@ class ClientRequestCreator<ByteBuffer> { class Client { public: - Client() : timer_(new Timer), interarrival_timer_() {} + Client() : timer_(new UsageTimer), interarrival_timer_() {} virtual ~Client() {} ClientStats Mark(bool reset) { Histogram latencies; - Timer::Result timer_result; + UsageTimer::Result timer_result; // avoid std::vector for old compilers that expect a copy constructor if (reset) { @@ -125,7 +125,7 @@ class Client { for (size_t i = 0; i < threads_.size(); i++) { threads_[i]->BeginSwap(&to_merge[i]); } - std::unique_ptr<Timer> timer(new Timer); + std::unique_ptr<UsageTimer> timer(new UsageTimer); timer_.swap(timer); for (size_t i = 0; i < threads_.size(); i++) { threads_[i]->EndSwap(); @@ -294,7 +294,7 @@ class Client { }; std::vector<std::unique_ptr<Thread>> threads_; - std::unique_ptr<Timer> timer_; + std::unique_ptr<UsageTimer> timer_; InterarrivalTimer interarrival_timer_; std::vector<gpr_timespec> next_time_; diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index b3b2f926db93abb685c274ef6c140d64d475c387..9e9da9909af54512ab75adc358d753b9fb4b3d5d 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -107,14 +107,14 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { bool RunNextState(bool ok, Histogram* hist) GRPC_OVERRIDE { switch (next_state_) { case State::READY: - start_ = Timer::Now(); + start_ = UsageTimer::Now(); response_reader_ = start_req_(stub_, &context_, req_, cq_); response_reader_->Finish(&response_, &status_, ClientRpcContext::tag(this)); next_state_ = State::RESP_DONE; return true; case State::RESP_DONE: - hist->Add((Timer::Now() - start_) * 1e9); + hist->Add((UsageTimer::Now() - start_) * 1e9); callback_(status_, &response_); next_state_ = State::INVALID; return false; @@ -287,8 +287,7 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext { next_state_(State::INVALID), callback_(on_done), next_issue_(next_issue), - start_req_(start_req), - start_(Timer::Now()) {} + start_req_(start_req) {} ~ClientRpcContextStreamingImpl() GRPC_OVERRIDE {} void Start(CompletionQueue* cq) GRPC_OVERRIDE { cq_ = cq; @@ -314,7 +313,7 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext { if (!ok) { return false; } - start_ = Timer::Now(); + start_ = UsageTimer::Now(); next_state_ = State::WRITE_DONE; stream_->Write(req_, ClientRpcContext::tag(this)); return true; @@ -327,7 +326,7 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext { return true; break; case State::READ_DONE: - hist->Add((Timer::Now() - start_) * 1e9); + hist->Add((UsageTimer::Now() - start_) * 1e9); callback_(status_, &response_); next_state_ = State::STREAM_IDLE; break; // loop around @@ -415,8 +414,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { next_state_(State::INVALID), callback_(on_done), next_issue_(next_issue), - start_req_(start_req), - start_(Timer::Now()) {} + start_req_(start_req) {} ~ClientRpcContextGenericStreamingImpl() GRPC_OVERRIDE {} void Start(CompletionQueue* cq) GRPC_OVERRIDE { cq_ = cq; @@ -445,7 +443,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { if (!ok) { return false; } - start_ = Timer::Now(); + start_ = UsageTimer::Now(); next_state_ = State::WRITE_DONE; stream_->Write(req_, ClientRpcContext::tag(this)); return true; @@ -458,7 +456,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { return true; break; case State::READ_DONE: - hist->Add((Timer::Now() - start_) * 1e9); + hist->Add((UsageTimer::Now() - start_) * 1e9); callback_(status_, &response_); next_state_ = State::STREAM_IDLE; break; // loop around diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index e39768b49810adb785938c74b638f420bef51e60..4284e07bd4ca109ac62ef2e15fb1b41ad6e22135 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -104,12 +104,12 @@ class SynchronousUnaryClient GRPC_FINAL : public SynchronousClient { bool ThreadFunc(Histogram* histogram, size_t thread_idx) GRPC_OVERRIDE { WaitToIssue(thread_idx); auto* stub = channels_[thread_idx % channels_.size()].get_stub(); - double start = Timer::Now(); + double start = UsageTimer::Now(); GPR_TIMER_SCOPE("SynchronousUnaryClient::ThreadFunc", 0); grpc::ClientContext context; grpc::Status s = stub->UnaryCall(&context, request_, &responses_[thread_idx]); - histogram->Add((Timer::Now() - start) * 1e9); + histogram->Add((UsageTimer::Now() - start) * 1e9); return s.ok(); } }; @@ -143,10 +143,10 @@ class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient { bool ThreadFunc(Histogram* histogram, size_t thread_idx) GRPC_OVERRIDE { WaitToIssue(thread_idx); GPR_TIMER_SCOPE("SynchronousStreamingClient::ThreadFunc", 0); - double start = Timer::Now(); + double start = UsageTimer::Now(); if (stream_[thread_idx]->Write(request_) && stream_[thread_idx]->Read(&responses_[thread_idx])) { - histogram->Add((Timer::Now() - start) * 1e9); + histogram->Add((UsageTimer::Now() - start) * 1e9); return true; } return false; diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h index 3227347e3ffc167a037719f8d3e0bde2825153ab..de46452c3d8eb0161563abd8a41d305e3b108eb2 100644 --- a/test/cpp/qps/server.h +++ b/test/cpp/qps/server.h @@ -50,7 +50,7 @@ namespace testing { class Server { public: - explicit Server(const ServerConfig& config) : timer_(new Timer) { + explicit Server(const ServerConfig& config) : timer_(new UsageTimer) { cores_ = LimitCores(config.core_list().data(), config.core_list_size()); if (config.port()) { port_ = config.port(); @@ -62,9 +62,9 @@ class Server { virtual ~Server() {} ServerStats Mark(bool reset) { - Timer::Result timer_result; + UsageTimer::Result timer_result; if (reset) { - std::unique_ptr<Timer> timer(new Timer); + std::unique_ptr<UsageTimer> timer(new UsageTimer); timer.swap(timer_); timer_result = timer->Mark(); } else { @@ -108,7 +108,7 @@ class Server { private: int port_; int cores_; - std::unique_ptr<Timer> timer_; + std::unique_ptr<UsageTimer> timer_; }; std::unique_ptr<Server> CreateSynchronousServer(const ServerConfig& config); diff --git a/test/cpp/qps/usage_timer.cc b/test/cpp/qps/usage_timer.cc index ee64537fedff0619eaf0db8f46785478eeed36c8..6663a9ac1036b65727dadaf491bd5823b03626ff 100644 --- a/test/cpp/qps/usage_timer.cc +++ b/test/cpp/qps/usage_timer.cc @@ -37,9 +37,9 @@ #include <sys/resource.h> #include <sys/time.h> -Timer::Timer() : start_(Sample()) {} +UsageTimer::UsageTimer() : start_(Sample()) {} -double Timer::Now() { +double UsageTimer::Now() { auto ts = gpr_now(GPR_CLOCK_REALTIME); return ts.tv_sec + 1e-9 * ts.tv_nsec; } @@ -48,7 +48,7 @@ static double time_double(struct timeval* tv) { return tv->tv_sec + 1e-6 * tv->tv_usec; } -Timer::Result Timer::Sample() { +UsageTimer::Result UsageTimer::Sample() { struct rusage usage; struct timeval tv; gettimeofday(&tv, NULL); @@ -61,7 +61,7 @@ Timer::Result Timer::Sample() { return r; } -Timer::Result Timer::Mark() const { +UsageTimer::Result UsageTimer::Mark() const { Result s = Sample(); Result r; r.wall = s.wall - start_.wall; diff --git a/test/cpp/qps/usage_timer.h b/test/cpp/qps/usage_timer.h index d5470dba590bd54ff98c23e7049f0ed5950e29dc..d19f8205649e0ef6db6844c8b646e852e53ef71f 100644 --- a/test/cpp/qps/usage_timer.h +++ b/test/cpp/qps/usage_timer.h @@ -36,7 +36,7 @@ class UsageTimer { public: - Timer(); + UsageTimer(); struct Result { double wall; diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index 1086e14258b0c54c69a649a0507a0f655246227b..7e1eb0d501c4883cce2de3d105d8c01a7edf3f7b 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -34,48 +34,110 @@ #include "test/cpp/util/test_credentials_provider.h" +#include <grpc/support/sync.h> +#include <grpc++/impl/sync.h> + #include "test/core/end2end/data/ssl_test_data.h" +namespace { + +using grpc::ChannelArguments; +using grpc::ChannelCredentials; +using grpc::InsecureChannelCredentials; +using grpc::InsecureServerCredentials; +using grpc::ServerCredentials; +using grpc::SslCredentialsOptions; +using grpc::SslServerCredentialsOptions; +using grpc::testing::CredentialsProvider; + +class DefaultCredentialsProvider : public CredentialsProvider { + public: + ~DefaultCredentialsProvider() override {} + + std::shared_ptr<ChannelCredentials> GetChannelCredentials( + const grpc::string& type, ChannelArguments* args) override { + if (type == grpc::testing::kInsecureCredentialsType) { + return InsecureChannelCredentials(); + } else if (type == grpc::testing::kTlsCredentialsType) { + SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; + args->SetSslTargetNameOverride("foo.test.google.fr"); + return SslCredentials(ssl_opts); + } else { + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + } + return nullptr; + } + + std::shared_ptr<ServerCredentials> GetServerCredentials( + const grpc::string& type) override { + if (type == grpc::testing::kInsecureCredentialsType) { + return InsecureServerCredentials(); + } else if (type == grpc::testing::kTlsCredentialsType) { + SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, + test_server1_cert}; + SslServerCredentialsOptions ssl_opts; + ssl_opts.pem_root_certs = ""; + ssl_opts.pem_key_cert_pairs.push_back(pkcp); + return SslServerCredentials(ssl_opts); + } else { + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + } + return nullptr; + } + std::vector<grpc::string> GetSecureCredentialsTypeList() override { + std::vector<grpc::string> types; + types.push_back(grpc::testing::kTlsCredentialsType); + return types; + } +}; + +gpr_once g_once_init_provider_mu = GPR_ONCE_INIT; +grpc::mutex* g_provider_mu = nullptr; +CredentialsProvider* g_provider = nullptr; + +void InitProviderMu() { g_provider_mu = new grpc::mutex; } + +grpc::mutex& GetMu() { + gpr_once_init(&g_once_init_provider_mu, &InitProviderMu); + return *g_provider_mu; +} + +CredentialsProvider* GetProvider() { + grpc::unique_lock<grpc::mutex> lock(GetMu()); + if (g_provider == nullptr) { + g_provider = new DefaultCredentialsProvider; + } + return g_provider; +} + +} // namespace + namespace grpc { namespace testing { -const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; +// Note that it is not thread-safe to set a provider while concurrently using +// the previously set provider, as this deletes and replaces it. nullptr may be +// given to reset to the default. +void SetTestCredentialsProvider(std::unique_ptr<CredentialsProvider> provider) { + grpc::unique_lock<grpc::mutex> lock(GetMu()); + if (g_provider != nullptr) { + delete g_provider; + } + g_provider = provider.release(); +} std::shared_ptr<ChannelCredentials> GetChannelCredentials( const grpc::string& type, ChannelArguments* args) { - if (type == kInsecureCredentialsType) { - return InsecureChannelCredentials(); - } else if (type == kTlsCredentialsType) { - SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; - args->SetSslTargetNameOverride("foo.test.google.fr"); - return SslCredentials(ssl_opts); - } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); - } - return nullptr; + return GetProvider()->GetChannelCredentials(type, args); } std::shared_ptr<ServerCredentials> GetServerCredentials( const grpc::string& type) { - if (type == kInsecureCredentialsType) { - return InsecureServerCredentials(); - } else if (type == kTlsCredentialsType) { - SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, - test_server1_cert}; - SslServerCredentialsOptions ssl_opts; - ssl_opts.pem_root_certs = ""; - ssl_opts.pem_key_cert_pairs.push_back(pkcp); - return SslServerCredentials(ssl_opts); - } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); - } - return nullptr; + return GetProvider()->GetServerCredentials(type); } std::vector<grpc::string> GetSecureCredentialsTypeList() { - std::vector<grpc::string> types; - types.push_back(kTlsCredentialsType); - return types; + return GetProvider()->GetSecureCredentialsTypeList(); } } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index f7253051a97dd7c3f6f296a0ee77ccaec717708e..a6b547cb07040527e328b25599c8c73312f3df77 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -44,6 +44,22 @@ namespace grpc { namespace testing { const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; +const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; + +class CredentialsProvider { + public: + virtual ~CredentialsProvider() {} + + virtual std::shared_ptr<ChannelCredentials> GetChannelCredentials( + const grpc::string& type, ChannelArguments* args) = 0; + virtual std::shared_ptr<ServerCredentials> GetServerCredentials( + const grpc::string& type) = 0; + virtual std::vector<grpc::string> GetSecureCredentialsTypeList() = 0; +}; + +// Set the CredentialsProvider used by the other functions in this file. If this +// is not set, a default provider will be used. +void SetTestCredentialsProvider(std::unique_ptr<CredentialsProvider> provider); // Provide channel credentials according to the given type. Alter the channel // arguments if needed. diff --git a/test/distrib/php/distribtest.php b/test/distrib/php/distribtest.php index 318c6f9cf08f2dc5f4af681aa1106f66bb00bb23..4c34cd674b47a14db935d243cd3b450ccbef2b50 100644 --- a/test/distrib/php/distribtest.php +++ b/test/distrib/php/distribtest.php @@ -1,4 +1,36 @@ <?php +/* + * + * Copyright 2016, 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. + * + */ $channel = new Grpc\Channel('localhost:1000', [ 'credentials' => Grpc\ChannelCredentials::createInsecure() diff --git a/tools/buildgen/build-cleaner.py b/tools/buildgen/build-cleaner.py index 49a364412350c0aa6bb02e61c1b426ce9bc8fc29..12054da238eeb992ad5b67a9b23a4d3f1ac39387 100755 --- a/tools/buildgen/build-cleaner.py +++ b/tools/buildgen/build-cleaner.py @@ -40,6 +40,7 @@ TEST = (os.environ.get('TEST', 'false') == 'true') _TOP_LEVEL_KEYS = ['settings', 'proto_deps', 'filegroups', 'libs', 'targets', 'vspackages'] _ELEM_KEYS = [ 'name', + 'gtest', 'cpu_cost', 'flaky', 'build', @@ -98,4 +99,3 @@ for filename in sys.argv[1:]: else: with open(filename, 'w') as f: f.write(output) - diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py index 965dd292afbc88942e84ec6f165c9248d5454c92..0602d93e56347a9474d0266216d594467f3d1eed 100755 --- a/tools/buildgen/generate_projects.py +++ b/tools/buildgen/generate_projects.py @@ -45,12 +45,12 @@ import jobset os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..', '..')) argp = argparse.ArgumentParser() -argp.add_argument('json', nargs='+') +argp.add_argument('build_files', nargs='+', default=[]) argp.add_argument('--templates', nargs='+', default=[]) argp.add_argument('--jobs', '-j', default=multiprocessing.cpu_count(), type=int) args = argp.parse_args() -json = args.json +json = args.build_files test = {} if 'TEST' in os.environ else None @@ -62,21 +62,31 @@ if not templates: for f in files: templates.append(os.path.join(root, f)) +pre_jobs = [] +base_cmd = ['python2.7', 'tools/buildgen/mako_renderer.py'] +cmd = base_cmd[:] +for plugin in plugins: + cmd.append('-p') + cmd.append(plugin) +for js in json: + cmd.append('-d') + cmd.append(js) +cmd.append('-w') +preprocessed_build = '.preprocessed_build' +cmd.append(preprocessed_build) +pre_jobs.append(jobset.JobSpec(cmd, shortname='preprocess', timeout_seconds=None)) + jobs = [] -for template in templates: +for template in reversed(sorted(templates)): root, f = os.path.split(template) if os.path.splitext(f)[1] == '.template': out_dir = '.' + root[len('templates'):] out = out_dir + '/' + os.path.splitext(f)[0] if not os.path.exists(out_dir): os.makedirs(out_dir) - cmd = ['python2.7', 'tools/buildgen/mako_renderer.py'] - for plugin in plugins: - cmd.append('-p') - cmd.append(plugin) - for js in json: - cmd.append('-d') - cmd.append(js) + cmd = base_cmd[:] + cmd.append('-P') + cmd.append(preprocessed_build) cmd.append('-o') if test is None: cmd.append(out) @@ -88,6 +98,7 @@ for template in templates: cmd.append(root + '/' + f) jobs.append(jobset.JobSpec(cmd, shortname=out, timeout_seconds=None)) +jobset.run(pre_jobs, maxjobs=args.jobs) jobset.run(jobs, maxjobs=args.jobs) if test is not None: diff --git a/tools/buildgen/mako_renderer.py b/tools/buildgen/mako_renderer.py index f1b28d352e7e34d56cbab43b39fed792063dd22d..5f23f123c2df11b39c15fe4f16e37d8e58701c24 100755 --- a/tools/buildgen/mako_renderer.py +++ b/tools/buildgen/mako_renderer.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2.7 -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -38,6 +38,7 @@ Just a wrapper around the mako rendering library. import getopt import imp import os +import cPickle as pickle import shutil import sys @@ -66,21 +67,23 @@ def out(msg): def showhelp(): - out('mako-renderer.py [-o out] [-m cache] [-d dict] [-d dict...] template') + out('mako-renderer.py [-o out] [-m cache] [-P preprocessed_input] [-d dict] [-d dict...]' + ' [-t template] [-w preprocessed_output]') def main(argv): got_input = False module_directory = None + preprocessed_output = None dictionary = {} json_dict = {} got_output = False - output_file = sys.stdout plugins = [] output_name = None + got_preprocessed_input = False try: - opts, args = getopt.getopt(argv, 'hm:d:o:p:') + opts, args = getopt.getopt(argv, 'hm:d:o:p:t:P:w:') except getopt.GetoptError: out('Unknown option') showhelp() @@ -104,18 +107,31 @@ def main(argv): showhelp() sys.exit(4) module_directory = arg + elif opt == '-P': + assert not got_preprocessed_input + assert json_dict == {} + sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), 'plugins'))) + with open(arg, 'r') as dict_file: + dictionary = pickle.load(dict_file) + got_preprocessed_input = True elif opt == '-d': - dict_file = open(arg, 'r') - bunch.merge_json(json_dict, yaml.load(dict_file.read())) - dict_file.close() + assert not got_preprocessed_input + with open(arg, 'r') as dict_file: + bunch.merge_json(json_dict, yaml.load(dict_file.read())) elif opt == '-p': plugins.append(import_plugin(arg)) + elif opt == '-w': + preprocessed_output = arg - for plugin in plugins: - plugin.mako_plugin(json_dict) + if not got_preprocessed_input: + for plugin in plugins: + plugin.mako_plugin(json_dict) + for k, v in json_dict.items(): + dictionary[k] = bunch.to_bunch(v) - for k, v in json_dict.items(): - dictionary[k] = bunch.to_bunch(v) + if preprocessed_output: + with open(preprocessed_output, 'w') as dict_file: + pickle.dump(dictionary, dict_file) cleared_dir = False for arg in args: @@ -168,11 +184,9 @@ def main(argv): with open(item_output_name, 'w') as output_file: template.render_context(Context(output_file, **args)) - if not got_input: + if not got_input and not preprocessed_output: out('Got nothing to do') showhelp() - output_file.close() - if __name__ == '__main__': main(sys.argv[1:]) diff --git a/tools/buildgen/plugins/expand_bin_attrs.py b/tools/buildgen/plugins/expand_bin_attrs.py index 735c60ea9959a573c6192595567f5d237f2f8b3f..c30df2ad892753959bca62af17ef1710be903aa3 100755 --- a/tools/buildgen/plugins/expand_bin_attrs.py +++ b/tools/buildgen/plugins/expand_bin_attrs.py @@ -52,6 +52,7 @@ def mako_plugin(dictionary): tgt['ci_platforms'] = sorted(tgt.get('ci_platforms', tgt['platforms'])) tgt['boringssl'] = tgt.get('boringssl', False) tgt['zlib'] = tgt.get('zlib', False) + tgt['gtest'] = tgt.get('gtest', False) libs = dictionary.get('libs') for lib in libs: diff --git a/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile b/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile index 08488874347797e4c666cfb4fa70e9509ca3ff73..b7f95aaa8d98a6a3f6f6bc18238fd72c01b2be8c 100644 --- a/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015-2016, Google Inc. +# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -69,6 +69,10 @@ RUN apt-get update && apt-get -y install libgtest-dev libc++-dev clang && apt-ge RUN apt-get update && apt-get -y install python-pip && apt-get clean RUN pip install argparse +RUN wget http://openssl.org/source/openssl-1.0.2f.tar.gz + +ENV POST_GIT_STEP tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh + # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc RUN ln -s /usr/bin/ccache /usr/local/bin/g++ diff --git a/examples/python/helloworld/run_client.sh b/tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh similarity index 84% rename from examples/python/helloworld/run_client.sh rename to tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh index 1c0ce020ee2f3617edbe47a0b3fb0a2b38f43f59..dfde93b1bd253a619696551bb1f2d289733427e6 100755 --- a/examples/python/helloworld/run_client.sh +++ b/tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,9 +28,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# This is where you have cloned out the https://github.com/grpc/grpc repository -# And built gRPC Python. -# ADJUST THIS PATH TO WHERE YOUR ACTUAL LOCATION IS -GRPC_ROOT=~/github/grpc +set -ex -$GRPC_ROOT/python2.7_virtual_environment/bin/python greeter_client.py +cd /var/local/git/grpc +cp /openssl-1.0.2f.tar.gz third_party +./tools/openssl/use_openssl.sh diff --git a/tools/jenkins/docker_run.sh b/tools/jenkins/docker_run.sh index df7b6571d7a455a0a2f02498d300371a17579d0d..f04b1cfb55be69e017ec4b200fa9d6daf9b03207 100755 --- a/tools/jenkins/docker_run.sh +++ b/tools/jenkins/docker_run.sh @@ -42,6 +42,8 @@ else cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH" fi +$POST_GIT_STEP + if [ -x "$(command -v rvm)" ] then rvm use ruby-2.1 diff --git a/tools/jenkins/docker_run_tests.sh b/tools/jenkins/docker_run_tests.sh index 2e40f8fd65a79911246fb18800d448cef20c1b38..8d6c42cd9bf4710524eb025456b455a8892c2c67 100755 --- a/tools/jenkins/docker_run_tests.sh +++ b/tools/jenkins/docker_run_tests.sh @@ -45,6 +45,8 @@ git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc mkdir -p reports +$POST_GIT_STEP + exit_code=0 $RUN_TESTS_COMMAND || exit_code=$? @@ -60,6 +62,6 @@ echo '</body></html>' >> index.html cd .. zip -r reports.zip reports -find . -name reports.xml | xargs zip reports.zip +find . -name report.xml | xargs zip reports.zip exit $exit_code diff --git a/examples/python/helloworld/run_server.sh b/tools/openssl/use_openssl.sh similarity index 67% rename from examples/python/helloworld/run_server.sh rename to tools/openssl/use_openssl.sh index 82ebb1f86867e8c8a9770d90ef12dcc62b3aedb6..3098217ec1b54a4cf2f677994fedcf03730b052d 100755 --- a/examples/python/helloworld/run_server.sh +++ b/tools/openssl/use_openssl.sh @@ -1,5 +1,6 @@ #!/bin/bash -# Copyright 2015, Google Inc. + +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,10 +29,33 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# This is where you have cloned out the https://github.com/grpc/grpc repository -# And built gRPC Python. -# ADJUST THIS PATH TO WHERE YOUR ACTUAL LOCATION IS -GRPC_ROOT=~/github/grpc +set -ex + +cd $(dirname $0)/../.. +set root=`pwd` +CC=${CC:-cc} + +# allow openssl to be pre-downloaded +if [ ! -e third_party/openssl-1.0.2f.tar.gz ] +then + echo "Downloading http://openssl.org/source/openssl-1.0.2f.tar.gz to third_party/openssl-1.0.2f.tar.gz" + wget http://openssl.org/source/openssl-1.0.2f.tar.gz -O third_party/openssl-1.0.2f.tar.gz +fi + +# clean openssl directory +rm -rf third_party/openssl-1.0.2f + +# extract archive +cd third_party +tar xfz openssl-1.0.2f.tar.gz -$GRPC_ROOT/python2.7_virtual_environment/bin/python greeter_server.py +# build openssl +cd openssl-1.0.2f +CC="$CC -fPIC -fvisibility=hidden" ./config no-asm +make +# generate the 'grpc_obj' directory needed by the makefile +mkdir grpc_obj +cd grpc_obj +ar x ../libcrypto.a +ar x ../libssl.a diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index 803d3d106b21532521712c393b76854c49466c45..288a3f01542304b467ef94f69ef6242ea93cfcc1 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -254,10 +254,14 @@ class PHPArtifact: return [] def build_jobspec(self): - return create_docker_jobspec( - self.name, - 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), - 'tools/run_tests/build_artifact_php.sh') + if self.platform == 'linux': + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), + 'tools/run_tests/build_artifact_php.sh') + else: + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_php.sh']) class ProtocArtifact: """Builds protoc and protoc-plugin artifacts""" diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh index 6e7ab911d5bb5215fe0eccc9ebfd0a23a18bf774..7ba04d75463f3ef0dc26da70e759bf0bec60fcf2 100755 --- a/tools/run_tests/build_artifact_python.sh +++ b/tools/run_tests/build_artifact_python.sh @@ -39,6 +39,14 @@ then pip install -rrequirements.txt fi +# Build the source distribution first because MANIFEST.in cannot override +# exclusion of built shared objects among package resources (for some +# inexplicable reason). +GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ +GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ +${SETARCH_CMD} python setup.py \ + sdist + # The bdist_wheel_grpc_custom command is finicky about command output ordering # and thus ought to be run in a shell command separate of others. Further, it # trashes the actual bdist_wheel output, so it should be run first so that @@ -48,11 +56,12 @@ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ ${SETARCH_CMD} python setup.py \ build_tagged_ext +# Wheel has a bug where directories don't get excluded. +# https://bitbucket.org/pypa/wheel/issues/99/cannot-exclude-directory GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ ${SETARCH_CMD} python setup.py \ - bdist_wheel \ - sdist + bdist_wheel mkdir -p artifacts diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py index 0c02344d90d6e038bbaa404394f21209f98b9a09..933103f0a0598ba63e99004aaa537c0b12b5f8eb 100644 --- a/tools/run_tests/distribtest_targets.py +++ b/tools/run_tests/distribtest_targets.py @@ -201,7 +201,7 @@ class RubyDistribTest(object): class PHPDistribTest(object): """Tests PHP package""" - def __init__(self, platform, arch, docker_suffix): + def __init__(self, platform, arch, docker_suffix=None): self.name = 'php_%s_%s_%s' % (platform, arch, docker_suffix) self.platform = platform self.arch = arch @@ -212,15 +212,19 @@ class PHPDistribTest(object): return [] def build_jobspec(self): - if not self.platform == 'linux': + if self.platform == 'linux': + return create_docker_jobspec(self.name, + 'tools/dockerfile/distribtest/php_%s_%s' % ( + self.docker_suffix, + self.arch), + 'test/distrib/php/run_distrib_test.sh') + elif self.platform == 'macos': + return create_jobspec(self.name, + ['test/distrib/php/run_distrib_test.sh'], + environ={'EXTERNAL_GIT_ROOT': '../../..'}) + else: raise Exception("Not supported yet.") - return create_docker_jobspec(self.name, - 'tools/dockerfile/distribtest/php_%s_%s' % ( - self.docker_suffix, - self.arch), - 'test/distrib/php/run_distrib_test.sh') - def __str__(self): return self.name @@ -271,6 +275,7 @@ def targets(): NodeDistribTest('macos', 'x64', None, '5'), NodeDistribTest('linux', 'x86', 'jessie', '4'), PHPDistribTest('linux', 'x64', 'jessie'), + PHPDistribTest('macos', 'x64'), ] + [ NodeDistribTest('linux', 'x64', os, version) for os in ('wheezy', 'jessie', 'ubuntu1204', 'ubuntu1404', diff --git a/tools/run_tests/run_node.bat b/tools/run_tests/run_node.bat index ad9ca14b8b9d5474331bc34f95a6a0e51eb04c1c..41777363568ae3387a3951d99730901fd0627cb1 100644 --- a/tools/run_tests/run_node.bat +++ b/tools/run_tests/run_node.bat @@ -27,6 +27,6 @@ @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 JUNIT_REPORT_PATH=src\node\reports.xml +set JUNIT_REPORT_PATH=src\node\report.xml set JUNIT_REPORT_STACK=1 .\node_modules\.bin\mocha.cmd --reporter mocha-jenkins-reporter --timeout 8000 src\node\test \ No newline at end of file diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index 178584ae8ed59f035b92b409de1a9101fbf53fbc..d33890068ddce5917198c4cc3883cf33a1318c7d 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.sh @@ -58,7 +58,7 @@ then echo '<html><head><meta http-equiv="refresh" content="0;URL=lcov-report/index.html"></head></html>' > \ ../reports/node_coverage/index.html else - JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 \ + JUNIT_REPORT_PATH=src/node/report.xml JUNIT_REPORT_STACK=1 \ ./node_modules/.bin/mocha --timeout $timeout \ --reporter mocha-jenkins-reporter $test_directory fi diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 7b2bc537162a1d0bee7110a12b4112bd2c85a108..75de4cb71d684c6891499520af864420fa1cb827 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -160,12 +160,38 @@ class CLanguage(object): else: binary = 'bins/%s/%s' % (self.config.build_config, target['name']) if os.path.isfile(binary): - cmdline = [binary] + target['args'] - out.append(self.config.job_spec(cmdline, [binary], - shortname=' '.join(cmdline), - cpu_cost=target['cpu_cost'], - environ={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH': - _ROOT + '/src/core/tsi/test_creds/ca.pem'})) + if 'gtest' in target and target['gtest']: + # here we parse the output of --gtest_list_tests to build up a + # complete list of the tests contained in a binary + # for each test, we then add a job to run, filtering for just that + # test + with open(os.devnull, 'w') as fnull: + tests = subprocess.check_output([binary, '--gtest_list_tests'], + stderr=fnull) + base = None + for line in tests.split('\n'): + i = line.find('#') + if i >= 0: line = line[:i] + if not line: continue + if line[0] != ' ': + base = line.strip() + else: + assert base is not None + assert line[1] == ' ' + test = base + line.strip() + cmdline = [binary] + ['--gtest_filter=%s' % test] + out.append(self.config.job_spec(cmdline, [binary], + shortname='%s:%s' % (binary, test), + cpu_cost=target['cpu_cost'], + environ={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH': + _ROOT + '/src/core/tsi/test_creds/ca.pem'})) + else: + cmdline = [binary] + target['args'] + out.append(self.config.job_spec(cmdline, [binary], + shortname=' '.join(cmdline), + cpu_cost=target['cpu_cost'], + environ={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH': + _ROOT + '/src/core/tsi/test_creds/ca.pem'})) elif self.args.regex == '.*' or self.platform == 'windows': print '\nWARNING: binary not found, skipping', binary return sorted(out) diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 742005c43efd2e3d9a77b55eaae7c1d5d22373df..d91245cd06ae73b3baa319cc92cb61b4337e852d 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -12,6 +12,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "alarm_test", "platforms": [ @@ -32,6 +33,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "algorithm_test", "platforms": [ @@ -52,6 +54,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "alloc_test", "platforms": [ @@ -72,6 +75,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "alpn_test", "platforms": [ @@ -92,6 +96,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "bin_encoder_test", "platforms": [ @@ -112,6 +117,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "census_context_test", "platforms": [ @@ -132,6 +138,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "channel_create_test", "platforms": [ @@ -152,6 +159,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "chttp2_hpack_encoder_test", "platforms": [ @@ -172,6 +180,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "chttp2_status_conversion_test", "platforms": [ @@ -192,6 +201,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "chttp2_stream_map_test", "platforms": [ @@ -212,6 +222,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "chttp2_varint_test", "platforms": [ @@ -232,6 +243,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "compression_test", "platforms": [ @@ -252,6 +264,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "dns_resolver_test", "platforms": [ @@ -271,6 +284,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "dualstack_socket_test", "platforms": [ @@ -290,6 +304,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "endpoint_pair_test", "platforms": [ @@ -309,6 +324,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "fd_conservation_posix_test", "platforms": [ @@ -327,6 +343,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "fd_posix_test", "platforms": [ @@ -345,6 +362,7 @@ "cpu_cost": 2, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "fling_stream_test", "platforms": [ @@ -363,6 +381,7 @@ "cpu_cost": 2, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "fling_test", "platforms": [ @@ -382,6 +401,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_avl_test", "platforms": [ @@ -402,6 +422,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_cmdline_test", "platforms": [ @@ -422,6 +443,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_cpu_test", "platforms": [ @@ -442,6 +464,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_env_test", "platforms": [ @@ -462,6 +485,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_histogram_test", "platforms": [ @@ -482,6 +506,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_host_port_test", "platforms": [ @@ -502,6 +527,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_load_file_test", "platforms": [ @@ -522,6 +548,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_log_test", "platforms": [ @@ -542,6 +569,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_slice_buffer_test", "platforms": [ @@ -562,6 +590,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_slice_test", "platforms": [ @@ -582,6 +611,7 @@ "cpu_cost": 10, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_stack_lockfree_test", "platforms": [ @@ -602,6 +632,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_string_test", "platforms": [ @@ -622,6 +653,7 @@ "cpu_cost": 10, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_sync_test", "platforms": [ @@ -642,6 +674,7 @@ "cpu_cost": 10, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_thd_test", "platforms": [ @@ -662,6 +695,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_time_test", "platforms": [ @@ -682,6 +716,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_tls_test", "platforms": [ @@ -702,6 +737,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "gpr_useful_test", "platforms": [ @@ -722,6 +758,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_auth_context_test", "platforms": [ @@ -742,6 +779,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_b64_test", "platforms": [ @@ -762,6 +800,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_byte_buffer_reader_test", "platforms": [ @@ -782,6 +821,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_channel_args_test", "platforms": [ @@ -802,6 +842,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_channel_stack_test", "platforms": [ @@ -822,6 +863,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_completion_queue_test", "platforms": [ @@ -842,6 +884,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_credentials_test", "platforms": [ @@ -862,6 +905,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_invalid_channel_args_test", "platforms": [ @@ -881,6 +925,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_json_token_test", "platforms": [ @@ -900,6 +945,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_jwt_verifier_test", "platforms": [ @@ -920,6 +966,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "grpc_security_connector_test", "platforms": [ @@ -940,6 +987,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "hpack_parser_test", "platforms": [ @@ -960,6 +1008,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "hpack_table_test", "platforms": [ @@ -980,6 +1029,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "httpcli_format_request_test", "platforms": [ @@ -1000,6 +1050,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "httpcli_parser_test", "platforms": [ @@ -1019,6 +1070,7 @@ "cpu_cost": 0.5, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "httpcli_test", "platforms": [ @@ -1035,6 +1087,7 @@ "cpu_cost": 0.5, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "httpscli_test", "platforms": [ @@ -1052,6 +1105,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "init_test", "platforms": [ @@ -1072,6 +1126,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "invalid_call_argument_test", "platforms": [ @@ -1092,6 +1147,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "json_rewrite_test", "platforms": [ @@ -1112,6 +1168,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "json_stream_error_test", "platforms": [ @@ -1132,6 +1189,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "json_test", "platforms": [ @@ -1152,6 +1210,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "lame_client_test", "platforms": [ @@ -1172,6 +1231,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "lb_policies_test", "platforms": [ @@ -1192,6 +1252,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "message_compress_test", "platforms": [ @@ -1212,6 +1273,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "mlog_test", "platforms": [ @@ -1232,6 +1294,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "multiple_server_queues_test", "platforms": [ @@ -1252,6 +1315,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "murmur_hash_test", "platforms": [ @@ -1272,6 +1336,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "no_server_test", "platforms": [ @@ -1292,6 +1357,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "resolve_address_test", "platforms": [ @@ -1312,6 +1378,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "secure_channel_create_test", "platforms": [ @@ -1332,6 +1399,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "secure_endpoint_test", "platforms": [ @@ -1352,6 +1420,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "server_chttp2_test", "platforms": [ @@ -1372,6 +1441,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "server_test", "platforms": [ @@ -1392,6 +1462,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "set_initial_connect_string_test", "platforms": [ @@ -1412,6 +1483,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "sockaddr_resolver_test", "platforms": [ @@ -1432,6 +1504,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "sockaddr_utils_test", "platforms": [ @@ -1451,6 +1524,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "socket_utils_test", "platforms": [ @@ -1469,6 +1543,7 @@ "cpu_cost": 0.5, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "tcp_client_posix_test", "platforms": [ @@ -1487,6 +1562,7 @@ "cpu_cost": 0.5, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "tcp_posix_test", "platforms": [ @@ -1505,6 +1581,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "tcp_server_posix_test", "platforms": [ @@ -1524,6 +1601,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "time_averaged_stats_test", "platforms": [ @@ -1544,6 +1622,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "timeout_encoding_test", "platforms": [ @@ -1564,6 +1643,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "timer_heap_test", "platforms": [ @@ -1584,6 +1664,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "timer_list_test", "platforms": [ @@ -1604,6 +1685,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "timers_test", "platforms": [ @@ -1624,6 +1706,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "transport_connectivity_state_test", "platforms": [ @@ -1644,6 +1727,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "transport_metadata_test", "platforms": [ @@ -1663,6 +1747,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "transport_security_test", "platforms": [ @@ -1681,6 +1766,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "udp_server_test", "platforms": [ @@ -1700,6 +1786,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "uri_parser_test", "platforms": [ @@ -1719,6 +1806,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "workqueue_test", "platforms": [ @@ -1738,6 +1826,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "alarm_cpp_test", "platforms": [ @@ -1758,6 +1847,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "async_end2end_test", "platforms": [ @@ -1777,6 +1867,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "async_streaming_ping_pong_test", "platforms": [ @@ -1795,6 +1886,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "async_unary_ping_pong_test", "platforms": [ @@ -1814,6 +1906,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "auth_property_iterator_test", "platforms": [ @@ -1834,6 +1927,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "channel_arguments_test", "platforms": [ @@ -1854,6 +1948,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "cli_call_test", "platforms": [ @@ -1873,6 +1968,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "client_crash_test", "platforms": [ @@ -1892,6 +1988,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "credentials_test", "platforms": [ @@ -1912,6 +2009,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "cxx_byte_buffer_test", "platforms": [ @@ -1932,6 +2030,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "cxx_slice_test", "platforms": [ @@ -1952,6 +2051,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "cxx_string_ref_test", "platforms": [ @@ -1972,6 +2072,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "cxx_time_test", "platforms": [ @@ -1992,6 +2093,7 @@ "cpu_cost": 0.5, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "end2end_test", "platforms": [ @@ -2011,6 +2113,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "generic_async_streaming_ping_pong_test", "platforms": [ @@ -2030,6 +2133,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "generic_end2end_test", "platforms": [ @@ -2050,6 +2154,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "grpclb_api_test", "platforms": [ @@ -2070,6 +2175,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "hybrid_end2end_test", "platforms": [ @@ -2089,6 +2195,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "interop_test", "platforms": [ @@ -2108,6 +2215,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "mock_test", "platforms": [ @@ -2127,6 +2235,7 @@ "cpu_cost": 10, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "qps_openloop_test", "platforms": [ @@ -2145,6 +2254,7 @@ "cpu_cost": 10, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "qps_test", "platforms": [ @@ -2164,6 +2274,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "secure_auth_context_test", "platforms": [ @@ -2183,6 +2294,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "secure_sync_unary_ping_pong_test", "platforms": [ @@ -2201,6 +2313,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "server_crash_test", "platforms": [ @@ -2220,6 +2333,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "shutdown_test", "platforms": [ @@ -2240,6 +2354,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "status_test", "platforms": [ @@ -2259,6 +2374,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "streaming_throughput_test", "platforms": [ @@ -2277,6 +2393,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "sync_streaming_ping_pong_test", "platforms": [ @@ -2295,6 +2412,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c++", "name": "sync_unary_ping_pong_test", "platforms": [ @@ -2314,6 +2432,7 @@ "cpu_cost": 100, "exclude_configs": [], "flaky": false, + "gtest": true, "language": "c++", "name": "thread_stress_test", "platforms": [ @@ -2334,6 +2453,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c89", "name": "public_headers_must_be_c89", "platforms": [ @@ -2354,6 +2474,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "badreq_bad_client_test", "platforms": [ @@ -2374,6 +2495,7 @@ "cpu_cost": 0.2, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "connection_prefix_bad_client_test", "platforms": [ @@ -2394,6 +2516,7 @@ "cpu_cost": 0.2, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "headers_bad_client_test", "platforms": [ @@ -2414,6 +2537,7 @@ "cpu_cost": 0.2, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "initial_settings_frame_bad_client_test", "platforms": [ @@ -2434,6 +2558,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "server_registered_method_bad_client_test", "platforms": [ @@ -2454,6 +2579,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "simple_request_bad_client_test", "platforms": [ @@ -2474,6 +2600,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "unknown_frame_bad_client_test", "platforms": [ @@ -2494,6 +2621,7 @@ "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "window_overflow_bad_client_test", "platforms": [ @@ -2513,6 +2641,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "bad_ssl_alpn_test", "platforms": [ @@ -2531,6 +2660,7 @@ "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, + "gtest": false, "language": "c", "name": "bad_ssl_cert_test", "platforms": [