From adb76ee1e6206e607f04993183a2ef46ff11e0f4 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 16 May 2017 08:50:55 -0700 Subject: [PATCH 1/4] Fix run_tests script for Mac --- tools/run_tests/run_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 196e26e1b60..1a16b093259 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -75,8 +75,9 @@ _FORCE_ENVIRON_FOR_WRAPPERS = { _POLLING_STRATEGIES = { - 'linux': ['epollsig', 'poll', 'poll-cv'] + 'linux': ['epollsig', 'poll', 'poll-cv'], # TODO(ctiller, sreecha): enable epoll1, epollex, epoll-thread-pool + 'mac': ['poll'], } From 9eef67d0e0f6a179011194322bdf4608fd3a5508 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 12 May 2017 09:43:32 +0200 Subject: [PATCH 2/4] fix python artifact build --- BUILD | 1 + build.yaml | 1 + src/core/lib/iomgr/ev_windows.c | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 src/core/lib/iomgr/ev_windows.c diff --git a/BUILD b/BUILD index 201b358f4dc..80cda32b15e 100644 --- a/BUILD +++ b/BUILD @@ -478,6 +478,7 @@ grpc_cc_library( "src/core/lib/iomgr/ev_epollsig_linux.c", "src/core/lib/iomgr/ev_poll_posix.c", "src/core/lib/iomgr/ev_posix.c", + "src/core/lib/iomgr/ev_windows.c", "src/core/lib/iomgr/exec_ctx.c", "src/core/lib/iomgr/executor.c", "src/core/lib/iomgr/iocp_windows.c", diff --git a/build.yaml b/build.yaml index 95f678805de..18fc37ff15d 100644 --- a/build.yaml +++ b/build.yaml @@ -316,6 +316,7 @@ filegroups: - src/core/lib/iomgr/ev_epollsig_linux.c - src/core/lib/iomgr/ev_poll_posix.c - src/core/lib/iomgr/ev_posix.c + - src/core/lib/iomgr/ev_windows.c - src/core/lib/iomgr/exec_ctx.c - src/core/lib/iomgr/executor.c - src/core/lib/iomgr/iocp_windows.c diff --git a/src/core/lib/iomgr/ev_windows.c b/src/core/lib/iomgr/ev_windows.c new file mode 100644 index 00000000000..7bf7327823a --- /dev/null +++ b/src/core/lib/iomgr/ev_windows.c @@ -0,0 +1,43 @@ +/* + * + * 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. + * + */ + +#include "src/core/lib/iomgr/port.h" + +#ifdef GRPC_WINSOCK_SOCKET + +#include "src/core/lib/debug/trace.h" + +grpc_tracer_flag grpc_polling_trace = + GRPC_TRACER_INITIALIZER(false); /* Disabled by default */ + +#endif // GRPC_WINSOCK_SOCKET From de030a35a2ab1c626883ce0d2ff380d4acb84ab6 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 16 May 2017 18:20:26 +0200 Subject: [PATCH 3/4] regenerate projects --- CMakeLists.txt | 7 +++++++ Makefile | 7 +++++++ binding.gyp | 1 + config.m4 | 1 + gRPC-Core.podspec | 1 + grpc.gemspec | 1 + package.xml | 1 + src/python/grpcio/grpc_core_dependencies.py | 1 + tools/dockerfile/push_testing_images.sh | 2 +- tools/doxygen/Doxyfile.c++.internal | 1 + tools/doxygen/Doxyfile.core.internal | 1 + tools/run_tests/generated/sources_and_headers.json | 1 + vsprojects/vcxproj/grpc++/grpc++.vcxproj | 2 ++ vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters | 3 +++ vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj | 2 ++ .../grpc++_unsecure/grpc++_unsecure.vcxproj.filters | 3 +++ vsprojects/vcxproj/grpc/grpc.vcxproj | 2 ++ vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 3 +++ vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj | 2 ++ .../vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters | 3 +++ vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 2 ++ .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters | 3 +++ 22 files changed, 49 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93f83939b9c..d82f3bfd3fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -945,6 +945,7 @@ add_library(grpc src/core/lib/iomgr/ev_epollsig_linux.c src/core/lib/iomgr/ev_poll_posix.c src/core/lib/iomgr/ev_posix.c + src/core/lib/iomgr/ev_windows.c src/core/lib/iomgr/exec_ctx.c src/core/lib/iomgr/executor.c src/core/lib/iomgr/iocp_windows.c @@ -1279,6 +1280,7 @@ add_library(grpc_cronet src/core/lib/iomgr/ev_epollsig_linux.c src/core/lib/iomgr/ev_poll_posix.c src/core/lib/iomgr/ev_posix.c + src/core/lib/iomgr/ev_windows.c src/core/lib/iomgr/exec_ctx.c src/core/lib/iomgr/executor.c src/core/lib/iomgr/iocp_windows.c @@ -1596,6 +1598,7 @@ add_library(grpc_test_util src/core/lib/iomgr/ev_epollsig_linux.c src/core/lib/iomgr/ev_poll_posix.c src/core/lib/iomgr/ev_posix.c + src/core/lib/iomgr/ev_windows.c src/core/lib/iomgr/exec_ctx.c src/core/lib/iomgr/executor.c src/core/lib/iomgr/iocp_windows.c @@ -1858,6 +1861,7 @@ add_library(grpc_unsecure src/core/lib/iomgr/ev_epollsig_linux.c src/core/lib/iomgr/ev_poll_posix.c src/core/lib/iomgr/ev_posix.c + src/core/lib/iomgr/ev_windows.c src/core/lib/iomgr/exec_ctx.c src/core/lib/iomgr/executor.c src/core/lib/iomgr/iocp_windows.c @@ -2285,6 +2289,7 @@ add_library(grpc++ src/core/lib/iomgr/ev_epollsig_linux.c src/core/lib/iomgr/ev_poll_posix.c src/core/lib/iomgr/ev_posix.c + src/core/lib/iomgr/ev_windows.c src/core/lib/iomgr/exec_ctx.c src/core/lib/iomgr/executor.c src/core/lib/iomgr/iocp_windows.c @@ -2616,6 +2621,7 @@ add_library(grpc++_cronet src/core/lib/iomgr/ev_epollsig_linux.c src/core/lib/iomgr/ev_poll_posix.c src/core/lib/iomgr/ev_posix.c + src/core/lib/iomgr/ev_windows.c src/core/lib/iomgr/exec_ctx.c src/core/lib/iomgr/executor.c src/core/lib/iomgr/iocp_windows.c @@ -3391,6 +3397,7 @@ add_library(grpc++_unsecure src/core/lib/iomgr/ev_epollsig_linux.c src/core/lib/iomgr/ev_poll_posix.c src/core/lib/iomgr/ev_posix.c + src/core/lib/iomgr/ev_windows.c src/core/lib/iomgr/exec_ctx.c src/core/lib/iomgr/executor.c src/core/lib/iomgr/iocp_windows.c diff --git a/Makefile b/Makefile index 5a5617e3c30..e62680a3cc8 100644 --- a/Makefile +++ b/Makefile @@ -2920,6 +2920,7 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ @@ -3252,6 +3253,7 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ @@ -3568,6 +3570,7 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ @@ -3802,6 +3805,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ @@ -4206,6 +4210,7 @@ LIBGRPC++_SRC = \ src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ @@ -4545,6 +4550,7 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ @@ -5310,6 +5316,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ diff --git a/binding.gyp b/binding.gyp index c47cd004405..99702eda2b1 100644 --- a/binding.gyp +++ b/binding.gyp @@ -680,6 +680,7 @@ 'src/core/lib/iomgr/ev_epollsig_linux.c', 'src/core/lib/iomgr/ev_poll_posix.c', 'src/core/lib/iomgr/ev_posix.c', + 'src/core/lib/iomgr/ev_windows.c', 'src/core/lib/iomgr/exec_ctx.c', 'src/core/lib/iomgr/executor.c', 'src/core/lib/iomgr/iocp_windows.c', diff --git a/config.m4 b/config.m4 index 99baebf2665..ace95d690e2 100644 --- a/config.m4 +++ b/config.m4 @@ -114,6 +114,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/ev_epollsig_linux.c \ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_posix.c \ + src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/executor.c \ src/core/lib/iomgr/iocp_windows.c \ diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index a6c083dabd9..f4a676f3b6a 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -500,6 +500,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/ev_epollsig_linux.c', 'src/core/lib/iomgr/ev_poll_posix.c', 'src/core/lib/iomgr/ev_posix.c', + 'src/core/lib/iomgr/ev_windows.c', 'src/core/lib/iomgr/exec_ctx.c', 'src/core/lib/iomgr/executor.c', 'src/core/lib/iomgr/iocp_windows.c', diff --git a/grpc.gemspec b/grpc.gemspec index 7fe4fe25790..8409c363ddc 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -416,6 +416,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/ev_epollsig_linux.c ) s.files += %w( src/core/lib/iomgr/ev_poll_posix.c ) s.files += %w( src/core/lib/iomgr/ev_posix.c ) + s.files += %w( src/core/lib/iomgr/ev_windows.c ) s.files += %w( src/core/lib/iomgr/exec_ctx.c ) s.files += %w( src/core/lib/iomgr/executor.c ) s.files += %w( src/core/lib/iomgr/iocp_windows.c ) diff --git a/package.xml b/package.xml index e70321a74ae..0e924399b82 100644 --- a/package.xml +++ b/package.xml @@ -425,6 +425,7 @@ + diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index dd2e550f729..5dfcd12b870 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -103,6 +103,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/ev_epollsig_linux.c', 'src/core/lib/iomgr/ev_poll_posix.c', 'src/core/lib/iomgr/ev_posix.c', + 'src/core/lib/iomgr/ev_windows.c', 'src/core/lib/iomgr/exec_ctx.c', 'src/core/lib/iomgr/executor.c', 'src/core/lib/iomgr/iocp_windows.c', diff --git a/tools/dockerfile/push_testing_images.sh b/tools/dockerfile/push_testing_images.sh index 973e045ffe4..16e43a111b6 100755 --- a/tools/dockerfile/push_testing_images.sh +++ b/tools/dockerfile/push_testing_images.sh @@ -44,7 +44,7 @@ cd - DOCKERHUB_ORGANIZATION=grpctesting -for DOCKERFILE_DIR in tools/dockerfile/test/* +for DOCKERFILE_DIR in tools/dockerfile/test/* tools/dockerfile/grpc_artifact_* do # Generate image name based on Dockerfile checksum. That works well as long # as can count on dockerfiles being written in a way that changing the logical diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index b881783ec77..2411cc269a8 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -954,6 +954,7 @@ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_poll_posix.h \ src/core/lib/iomgr/ev_posix.c \ src/core/lib/iomgr/ev_posix.h \ +src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/exec_ctx.h \ src/core/lib/iomgr/executor.c \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 5fb091e9f00..6086b92b00c 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1093,6 +1093,7 @@ src/core/lib/iomgr/ev_poll_posix.c \ src/core/lib/iomgr/ev_poll_posix.h \ src/core/lib/iomgr/ev_posix.c \ src/core/lib/iomgr/ev_posix.h \ +src/core/lib/iomgr/ev_windows.c \ src/core/lib/iomgr/exec_ctx.c \ src/core/lib/iomgr/exec_ctx.h \ src/core/lib/iomgr/executor.c \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index a488c15b05e..e7f459d5f88 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -7925,6 +7925,7 @@ "src/core/lib/iomgr/ev_poll_posix.h", "src/core/lib/iomgr/ev_posix.c", "src/core/lib/iomgr/ev_posix.h", + "src/core/lib/iomgr/ev_windows.c", "src/core/lib/iomgr/exec_ctx.c", "src/core/lib/iomgr/exec_ctx.h", "src/core/lib/iomgr/executor.c", diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index f8fae96d902..c33e06be9f8 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -629,6 +629,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index 73353752b5f..3e823862c72 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -202,6 +202,9 @@ src\core\lib\iomgr + + src\core\lib\iomgr + src\core\lib\iomgr diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index 02e3399f052..321df903798 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -613,6 +613,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index 5d7f082fdd1..06f6f9cd799 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -187,6 +187,9 @@ src\core\lib\iomgr + + src\core\lib\iomgr + src\core\lib\iomgr diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index d32958db384..37aabe46eda 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -570,6 +570,8 @@ + + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 14aa7d458a8..2c4ef4d3f2e 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -82,6 +82,9 @@ src\core\lib\iomgr + + src\core\lib\iomgr + src\core\lib\iomgr diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj index 2f245d55584..d3626247ed7 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj @@ -402,6 +402,8 @@ + + diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters index d2caf223a5e..659bad021b1 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters @@ -139,6 +139,9 @@ src\core\lib\iomgr + + src\core\lib\iomgr + src\core\lib\iomgr diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 88fa5b1318e..1dcd30023ec 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -537,6 +537,8 @@ + + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 87d7f53c87c..469325919f6 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -85,6 +85,9 @@ src\core\lib\iomgr + + src\core\lib\iomgr + src\core\lib\iomgr From 6e589c6a15da708a2081b1955170393321327878 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Tue, 16 May 2017 18:09:36 -0700 Subject: [PATCH 4/4] PHP: stop requiring google/protobuf PHP implementation --- composer.json | 7 +++++-- examples/php/composer.json | 3 ++- src/php/README.md | 22 ++++++++++++++++++++++ src/php/tests/qps/composer.json | 3 ++- templates/composer.json.template | 7 +++++-- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 284b57a8098..2cf3f17221a 100644 --- a/composer.json +++ b/composer.json @@ -6,12 +6,15 @@ "homepage": "http://grpc.io", "license": "BSD-3-Clause", "require": { - "php": ">=5.5.0", - "google/protobuf": "^v3.3.0" + "php": ">=5.5.0" }, "require-dev": { "google/auth": "v0.9" }, + "suggest": { + "ext-protobuf": "For better performance, install the protobuf C extension.", + "google/protobuf": "To get started using grpc quickly, install the native protobuf library." + }, "autoload": { "psr-4": { "Grpc\\": "src/php/lib/Grpc/" diff --git a/examples/php/composer.json b/examples/php/composer.json index f4b177c2713..9d900ebec1e 100644 --- a/examples/php/composer.json +++ b/examples/php/composer.json @@ -2,7 +2,8 @@ "name": "grpc/grpc-demo", "description": "gRPC example for PHP", "require": { - "grpc/grpc": "^v1.1.0" + "grpc/grpc": "^v1.3.0", + "google/protobuf": "^v3.3.0" }, "autoload": { "psr-4": { diff --git a/src/php/README.md b/src/php/README.md index f9f93ba8159..90c8cb386a0 100644 --- a/src/php/README.md +++ b/src/php/README.md @@ -174,6 +174,28 @@ $ sudo make install ``` +### Protobuf Runtime library + +There are two protobuf runtime libraries to choose from. They are idenfical in terms of APIs offered. + +1. C implementation (for better performance) + +``` sh +$ sudo pecl install protobuf +``` + +2. PHP implementation (for easier installation) + + +Add this to your `composer.json` file: + +``` + "require": { + "google/protobuf": "^v3.3.0" + } +``` + + ### PHP Protoc Plugin You need the gRPC PHP protoc plugin to generate the client stub classes. diff --git a/src/php/tests/qps/composer.json b/src/php/tests/qps/composer.json index 0fc87098f57..8c1e7b6c746 100644 --- a/src/php/tests/qps/composer.json +++ b/src/php/tests/qps/composer.json @@ -1,7 +1,8 @@ { "minimum-stability": "dev", "require": { - "grpc/grpc": "dev-master" + "grpc/grpc": "dev-master", + "google/protobuf": "^v3.3.0" }, "autoload": { "psr-4": { diff --git a/templates/composer.json.template b/templates/composer.json.template index 2d4cb119195..a18624db46a 100644 --- a/templates/composer.json.template +++ b/templates/composer.json.template @@ -8,12 +8,15 @@ "homepage": "http://grpc.io", "license": "BSD-3-Clause", "require": { - "php": ">=5.5.0", - "google/protobuf": "^v3.3.0" + "php": ">=5.5.0" }, "require-dev": { "google/auth": "v0.9" }, + "suggest": { + "ext-protobuf": "For better performance, install the protobuf C extension.", + "google/protobuf": "To get started using grpc quickly, install the native protobuf library." + }, "autoload": { "psr-4": { "Grpc\\": "src/php/lib/Grpc/"