diff options
-rw-r--r-- | CMakeLists.txt | 53 | ||||
-rw-r--r-- | INSTALL.md | 23 | ||||
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | build.yaml | 7 | ||||
-rw-r--r-- | doc/environment_variables.md | 4 | ||||
-rw-r--r-- | src/ruby/spec/channel_credentials_spec.rb | 2 | ||||
-rw-r--r-- | templates/CMakeLists.txt.template | 45 | ||||
-rw-r--r-- | tools/cmake/gRPCConfig.cmake.in | 1 | ||||
-rwxr-xr-x | tools/gcp/utils/big_query_utils.py | 2 | ||||
-rw-r--r-- | tools/run_tests/generated/sources_and_headers.json | 7 | ||||
-rwxr-xr-x | tools/run_tests/python_utils/jobset.py | 2 | ||||
-rwxr-xr-x | tools/run_tests/run_tests_matrix.py | 2 | ||||
-rw-r--r-- | vsprojects/README.md | 8 | ||||
-rw-r--r-- | vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj | 3 | ||||
-rw-r--r-- | vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj | 3 | ||||
-rw-r--r-- | vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj | 3 | ||||
-rw-r--r-- | vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj | 3 | ||||
-rw-r--r-- | vsprojects/vcxproj/qps/qps.vcxproj | 3 | ||||
-rw-r--r-- | vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj | 3 |
19 files changed, 157 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a60786458b..710f1dc4e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,11 +33,13 @@ project(${PACKAGE_NAME} C CXX) # Options option(gRPC_BUILD_TESTS "Build tests" OFF) -if (NOT MSVC) - set(gRPC_INSTALL ON CACHE BOOL "Generate installation target") -else() - set(gRPC_INSTALL OFF CACHE BOOL "Generate installation target") +set(gRPC_INSTALL_default ON) +if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + # Disable gRPC_INSTALL by default if building as a submodule + set(gRPC_INSTALL_default OFF) endif() +set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL + "Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"") set(gRPC_ZLIB_PROVIDER "module" CACHE STRING "Provider of zlib library") set_property(CACHE gRPC_ZLIB_PROVIDER PROPERTY STRINGS "module" "package") @@ -103,6 +105,10 @@ if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_ZLIB_PROVIDER is \"module\" but ZLIB_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_ZLIB_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_ZLIB_PROVIDER}" STREQUAL "package") find_package(ZLIB) if(TARGET ZLIB::ZLIB) @@ -134,12 +140,16 @@ if("${gRPC_CARES_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_CARES_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_CARES_PROVIDER}" STREQUAL "package") - find_package(CARES) - if(TARGET CARES::CARES) - set(_gRPC_CARES_LIBRARIES CARES::CARES) + find_package(c-ares CONFIG) + if(TARGET c-ares::cares) + set(_gRPC_CARES_LIBRARIES c-ares::cares) endif() - set(_gRPC_FIND_CARES "if(NOT CARES_FOUND)\n find_package(CARES)\nendif()") + set(_gRPC_FIND_CARES "if(NOT c-ares_FOUND)\n find_package(c-ares CONFIG)\nendif()") endif() if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module") @@ -168,6 +178,10 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_PROTOBUF_PROVIDER is \"module\" but PROTOBUF_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_PROTOBUF_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package") find_package(protobuf CONFIG) if(protobuf_FOUND) @@ -201,6 +215,10 @@ if("${gRPC_SSL_PROVIDER}" STREQUAL "module") else() message(WARNING "gRPC_SSL_PROVIDER is \"module\" but BORINGSSL_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_SSL_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("${gRPC_SSL_PROVIDER}" STREQUAL "package") find_package(OpenSSL) if(TARGET OpenSSL::SSL) @@ -304,7 +322,7 @@ function(protobuf_generate_grpc_cpp) "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" - COMMAND ${_gRPC_PROTOBUF_PROTOC} + COMMAND $<TARGET_FILE:${_gRPC_PROTOBUF_PROTOC}> ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} --cpp_out=${_gRPC_PROTO_GENS_DIR} --plugin=protoc-gen-grpc=$<TARGET_FILE:grpc_cpp_plugin> @@ -1487,6 +1505,8 @@ target_include_directories(grpc_cronet target_link_libraries(grpc_cronet ${_gRPC_BASELIB_LIBRARIES} ${_gRPC_SSL_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_CARES_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} gpr ) @@ -2075,6 +2095,8 @@ target_include_directories(grpc_unsecure target_link_libraries(grpc_unsecure ${_gRPC_BASELIB_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_CARES_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} gpr ) @@ -2927,6 +2949,7 @@ target_link_libraries(grpc++_proto_reflection_desc_db ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ + grpc ) foreach(_hdr @@ -2985,6 +3008,7 @@ target_link_libraries(grpc++_reflection ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ + grpc ) foreach(_hdr @@ -3129,6 +3153,7 @@ target_link_libraries(grpc++_test_util ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ grpc_test_util + grpc ) foreach(_hdr @@ -3487,6 +3512,7 @@ target_link_libraries(grpc_cli_libs ${_gRPC_ALLTARGETS_LIBRARIES} grpc++_proto_reflection_desc_db grpc++ + grpc ) foreach(_hdr @@ -4025,6 +4051,7 @@ target_link_libraries(qps grpc_test_util grpc++_test_util grpc++ + grpc ) @@ -9987,6 +10014,7 @@ target_link_libraries(cxx_string_ref_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc++ + grpc ${_gRPC_GFLAGS_LIBRARIES} ) @@ -14183,6 +14211,13 @@ endif (gRPC_BUILD_TESTS) +if (gRPC_INSTALL) + install(EXPORT gRPCTargets + DESTINATION ${CMAKE_INSTALL_CMAKEDIR} + NAMESPACE gRPC:: + ) +endif() + foreach(_config gRPCConfig gRPCConfigVersion) configure_file(tools/cmake/${_config}.cmake.in ${_config}.cmake @ONLY) diff --git a/INSTALL.md b/INSTALL.md index 5406fec84d..9526a8637b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -89,17 +89,19 @@ gRPC C Core library. There are several ways to build under Windows, of varying complexity depending on experience with the tools involved. -### Pre-generated Visual Studio solution -The pre-generated VS projects & solution are checked into the repository under the [vsprojects](/vsprojects) directory. -### Building using CMake (with BoringSSL) +### Building using CMake (RECOMMENDED) + +Builds gRPC C and C++ with boringssl. - Install [CMake](https://cmake.org/download/). - Install [Active State Perl](http://www.activestate.com/activeperl/) (`choco install activeperl`) - Install [Ninja](https://ninja-build.org/) (`choco install ninja`) - Install [Go](https://golang.org/dl/) (`choco install golang`) - Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`) - Run these commands in the repo root directory + +Using Ninja (faster build, supports boringssl's assembly optimizations) ``` > md .build > cd .build @@ -107,7 +109,14 @@ The pre-generated VS projects & solution are checked into the repository under t > cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release > cmake --build . ``` -NOTE: Currently you can only use Ninja to build using cmake on Windows (because of the boringssl dependency). + +Using Visual Studio 2015 (can only build with OPENSSL_NO_ASM) +``` +> md .build +> cd .build +> cmake .. -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=Release +> cmake --build . +``` ### msys2 (with mingw) @@ -131,3 +140,9 @@ MINGW64$ make NOTE: While most of the make targets are buildable under Mingw, some haven't been ported to Windows yet and may fail to build (mostly trying to include POSIX headers not available on Mingw). + +### Pre-generated Visual Studio solution (DEPRECATED) + +*WARNING: This used to be the recommended way to build on Windows, but because of significant limitations (hard to build dependencies including boringssl, .proto codegen is hard to support, ..), it is no longer recommended. Use cmake to build on Windows instead.* + +The pre-generated VS projects & solution are checked into the repository under the [vsprojects](/vsprojects) directory. @@ -4924,18 +4924,18 @@ endif ifeq ($(SYSTEM),MINGW32) -$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(OPENSSL_DEP) +$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++$(SHARED_VERSION_CPP)-dll + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++$(SHARED_VERSION_CPP)-dll -lgrpc$(SHARED_VERSION_CORE)-dll else -$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT_CPP) $(OPENSSL_DEP) +$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` ifeq ($(SYSTEM),Darwin) - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ -lgrpc else - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_reflection.so.1 -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_reflection.so.1 -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++ -lgrpc $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so endif @@ -14370,16 +14370,16 @@ $(BINDIR)/$(CONFIG)/cxx_string_ref_test: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/cxx_string_ref_test: $(PROTOBUF_DEP) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a +$(BINDIR)/$(CONFIG)/cxx_string_ref_test: $(PROTOBUF_DEP) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cxx_string_ref_test + $(Q) $(LDXX) $(LDFLAGS) $(CXX_STRING_REF_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cxx_string_ref_test endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/util/string_ref_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a +$(OBJDIR)/$(CONFIG)/test/cpp/util/string_ref_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a deps_cxx_string_ref_test: $(CXX_STRING_REF_TEST_OBJS:.o=.dep) diff --git a/build.yaml b/build.yaml index 7ab1cee263..e55c4ca301 100644 --- a/build.yaml +++ b/build.yaml @@ -1037,6 +1037,7 @@ filegroups: - include/grpc++/test/server_context_test_spouse.h deps: - grpc++ + - grpc libs: - name: gpr build: all @@ -1287,6 +1288,7 @@ libs: - test/cpp/util/proto_reflection_descriptor_database.cc deps: - grpc++ + - grpc filegroups: - grpc++_reflection_proto - grpc++_config_proto @@ -1302,6 +1304,7 @@ libs: - src/cpp/ext/proto_server_reflection_plugin.cc deps: - grpc++ + - grpc filegroups: - grpc++_reflection_proto - name: grpc++_test_config @@ -1335,6 +1338,7 @@ libs: deps: - grpc++ - grpc_test_util + - grpc filegroups: - grpc++_codegen_base - grpc++_codegen_base_src @@ -1392,6 +1396,7 @@ libs: deps: - grpc++_proto_reflection_desc_db - grpc++ + - grpc filegroups: - grpc++_reflection_proto - grpc++_config_proto @@ -1556,6 +1561,7 @@ libs: - grpc_test_util - grpc++_test_util - grpc++ + - grpc - name: grpc_csharp_ext build: all language: csharp @@ -3726,6 +3732,7 @@ targets: - test/cpp/util/string_ref_test.cc deps: - grpc++ + - grpc - name: cxx_time_test gtest: true build: test diff --git a/doc/environment_variables.md b/doc/environment_variables.md index 47efb3a1d8..dce434ff30 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -4,6 +4,10 @@ gRPC environment variables gRPC C core based implementations (those contained in this repository) expose some configuration as environment variables that can be set. +* http_proxy + The URI of the proxy to use for HTTP CONNECT support. Does not currently + support username or password information in the URI. + * GRPC_ABORT_ON_LEAKS A debugging aid to cause a call to abort() when gRPC objects are leaked past grpc_shutdown(). Set to 1 to cause the abort, if unset or 0 it does not diff --git a/src/ruby/spec/channel_credentials_spec.rb b/src/ruby/spec/channel_credentials_spec.rb index 058168a473..e53f316208 100644 --- a/src/ruby/spec/channel_credentials_spec.rb +++ b/src/ruby/spec/channel_credentials_spec.rb @@ -20,7 +20,7 @@ describe GRPC::Core::ChannelCredentials do def load_test_certs test_root = File.join(File.dirname(__FILE__), 'testdata') - files = ['ca.pem', 'server1.pem', 'server1.key'] + files = ['ca.pem', 'server1.key', 'server1.pem'] files.map { |f| File.open(File.join(test_root, f)).read } end diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 71509c416b..ef0faccb2e 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -43,7 +43,7 @@ deps.append("${_gRPC_SSL_LIBRARIES}") if target_dict.language == 'c++': deps.append("${_gRPC_PROTOBUF_LIBRARIES}") - if target_dict['name'] in ['grpc']: + if target_dict['name'] in ['grpc', 'grpc_cronet', 'grpc_unsecure']: deps.append("${_gRPC_ZLIB_LIBRARIES}") deps.append("${_gRPC_CARES_LIBRARIES}") deps.append("${_gRPC_ALLTARGETS_LIBRARIES}") @@ -77,11 +77,13 @@ # Options option(gRPC_BUILD_TESTS "Build tests" OFF) - if (NOT MSVC) - set(gRPC_INSTALL ON CACHE BOOL "Generate installation target") - else() - set(gRPC_INSTALL OFF CACHE BOOL "Generate installation target") + set(gRPC_INSTALL_default ON) + if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + # Disable gRPC_INSTALL by default if building as a submodule + set(gRPC_INSTALL_default OFF) endif() + set(gRPC_INSTALL <%text>${gRPC_INSTALL_default}</%text> CACHE BOOL + "Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"") set(gRPC_ZLIB_PROVIDER "module" CACHE STRING "Provider of zlib library") set_property(CACHE gRPC_ZLIB_PROVIDER PROPERTY STRINGS "module" "package") @@ -148,6 +150,10 @@ else() message(WARNING "gRPC_ZLIB_PROVIDER is \"module\" but ZLIB_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_ZLIB_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_ZLIB_PROVIDER}</%text>" STREQUAL "package") find_package(ZLIB) if(TARGET ZLIB::ZLIB) @@ -179,12 +185,16 @@ else() message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_CARES_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_CARES_PROVIDER}</%text>" STREQUAL "package") - find_package(CARES) - if(TARGET CARES::CARES) - set(_gRPC_CARES_LIBRARIES CARES::CARES) + find_package(c-ares CONFIG) + if(TARGET c-ares::cares) + set(_gRPC_CARES_LIBRARIES c-ares::cares) endif() - set(_gRPC_FIND_CARES "if(NOT CARES_FOUND)\n find_package(CARES)\nendif()") + set(_gRPC_FIND_CARES "if(NOT c-ares_FOUND)\n find_package(c-ares CONFIG)\nendif()") endif() if("<%text>${gRPC_PROTOBUF_PROVIDER}</%text>" STREQUAL "module") @@ -213,6 +223,10 @@ else() message(WARNING "gRPC_PROTOBUF_PROVIDER is \"module\" but PROTOBUF_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_PROTOBUF_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_PROTOBUF_PROVIDER}</%text>" STREQUAL "package") find_package(protobuf CONFIG) if(protobuf_FOUND) @@ -246,6 +260,10 @@ else() message(WARNING "gRPC_SSL_PROVIDER is \"module\" but BORINGSSL_ROOT_DIR is wrong") endif() + if(gRPC_INSTALL) + message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_SSL_PROVIDER is \"module\"") + set(gRPC_INSTALL FALSE) + endif() elseif("<%text>${gRPC_SSL_PROVIDER}</%text>" STREQUAL "package") find_package(OpenSSL) if(TARGET OpenSSL::SSL) @@ -349,7 +367,7 @@ <%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h"</%text> <%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc"</%text> <%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h"</%text> - COMMAND <%text>${_gRPC_PROTOBUF_PROTOC}</%text> + COMMAND <%text>$<TARGET_FILE:${_gRPC_PROTOBUF_PROTOC}></%text> ARGS --grpc_out=<%text>generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}</%text> --cpp_out=<%text>${_gRPC_PROTO_GENS_DIR}</%text> --plugin=protoc-gen-grpc=$<TARGET_FILE:grpc_cpp_plugin> @@ -603,6 +621,13 @@ endif() </%def> + if (gRPC_INSTALL) + install(EXPORT gRPCTargets + DESTINATION <%text>${CMAKE_INSTALL_CMAKEDIR}</%text> + NAMESPACE gRPC:: + ) + endif() + foreach(_config gRPCConfig gRPCConfigVersion) configure_file(tools/cmake/<%text>${_config}</%text>.cmake.in <%text>${_config}</%text>.cmake @ONLY) diff --git a/tools/cmake/gRPCConfig.cmake.in b/tools/cmake/gRPCConfig.cmake.in index 48f0674579..1a0fa6a462 100644 --- a/tools/cmake/gRPCConfig.cmake.in +++ b/tools/cmake/gRPCConfig.cmake.in @@ -2,6 +2,7 @@ @_gRPC_FIND_ZLIB@
@_gRPC_FIND_PROTOBUF@
@_gRPC_FIND_SSL@
+@_gRPC_FIND_CARES@
# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
diff --git a/tools/gcp/utils/big_query_utils.py b/tools/gcp/utils/big_query_utils.py index efc5c1839f..76c86645b7 100755 --- a/tools/gcp/utils/big_query_utils.py +++ b/tools/gcp/utils/big_query_utils.py @@ -31,7 +31,7 @@ def create_big_query(): """Authenticates with cloud platform and gets a BiqQuery service object """ creds = GoogleCredentials.get_application_default() - return discovery.build('bigquery', 'v2', credentials=creds) + return discovery.build('bigquery', 'v2', credentials=creds, cache_discovery=False) def create_dataset(biq_query, project_id, dataset_id): diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 16ff417a27..956f45fc2d 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -3049,6 +3049,7 @@ }, { "deps": [ + "grpc", "grpc++" ], "headers": [], @@ -6080,6 +6081,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_config_proto", "grpc++_reflection_proto" @@ -6099,6 +6101,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_reflection_proto" ], @@ -6135,6 +6138,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_codegen_base", "grpc++_codegen_base_src", @@ -6229,6 +6233,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_config_proto", "grpc++_proto_reflection_desc_db", @@ -6480,6 +6485,7 @@ }, { "deps": [ + "grpc", "grpc++", "grpc++_test_util", "grpc_test_util" @@ -9336,6 +9342,7 @@ }, { "deps": [ + "grpc", "grpc++" ], "headers": [ diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py index b56cce1a50..044c6f3aa4 100755 --- a/tools/run_tests/python_utils/jobset.py +++ b/tools/run_tests/python_utils/jobset.py @@ -473,6 +473,8 @@ class Jobset(object): while self._running: if self.cancelled(): pass # poll cancellation self.reap() + if platform_string() != 'windows': + signal.alarm(0) return not self.cancelled() and self._failures == 0 diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 0fe3b37d4b..96e865b0c0 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -102,6 +102,8 @@ def _generate_jobs(languages, configs, platforms, iomgr_platform = 'native', name += '_%s_%s' % (arch, compiler) runtests_args += ['--arch', arch, '--compiler', compiler] + if '--build_only' in extra_args: + name += '_buildonly' for extra_env in extra_envs: name += '_%s_%s' % (extra_env, extra_envs[extra_env]) diff --git a/vsprojects/README.md b/vsprojects/README.md index 1f0cdc24ba..4b6608ba93 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -1,5 +1,13 @@ # Pre-generated MS Visual Studio project & solution files +**DEPRECATED, please use cmake instead (it can generate Visual Studio projects for you). We will continue providing pre-generated VS projects for a while, but we will likely get rid of them entirely at some point.** + +**Pre-generated MS Visual Studio projects used to be the recommended way to build on Windows, but there were some limitations:** +- **hard to build dependencies, expecially boringssl (deps usually support cmake quite well)** +- **the nuget-based openssl & zlib dependencies are hard to maintain and update. We've received issues indicating that they are flawed.** +- **.proto codegen is hard to support in Visual Studio directly (but we have a pretty decent support in cmake)** +- **It's a LOT of generated files. We prefer not to have too much generated code in our github repo.** + Versions 2013 and 2015 are both supported. You can use [their respective community editions](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). diff --git a/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj b/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj index 453b483fde..853b58455d 100644 --- a/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj +++ b/vsprojects/vcxproj/grpc++_proto_reflection_desc_db/grpc++_proto_reflection_desc_db.vcxproj @@ -168,6 +168,9 @@ <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj index da4c685776..91137c124c 100644 --- a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj +++ b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj @@ -170,6 +170,9 @@ <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj index 4958218821..ed9190dbe3 100644 --- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj @@ -261,6 +261,9 @@ <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc_test_util\grpc_test_util.vcxproj"> <Project>{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}</Project> </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj b/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj index c97c7dcb3d..ba97f97e1d 100644 --- a/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj +++ b/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj @@ -184,6 +184,9 @@ <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/vsprojects/vcxproj/qps/qps.vcxproj b/vsprojects/vcxproj/qps/qps.vcxproj index 6e290f4557..b7758952f1 100644 --- a/vsprojects/vcxproj/qps/qps.vcxproj +++ b/vsprojects/vcxproj/qps/qps.vcxproj @@ -231,6 +231,9 @@ <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj b/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj index 8d9989557f..18993f5e9a 100644 --- a/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj +++ b/vsprojects/vcxproj/test/cxx_string_ref_test/cxx_string_ref_test.vcxproj @@ -167,6 +167,9 @@ <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> </ItemGroup> <ItemGroup> <None Include="packages.config" /> |