diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2018-08-13 15:15:33 +0200 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2018-08-13 15:15:33 +0200 |
commit | 4c75c245b7b07083abdb33dbde074f2b6eacaafb (patch) | |
tree | 3ef444b811edf44f1d9670df506d87703c568068 /templates | |
parent | 5f4dfaac9e8ad175cbd5ef074b08f087cc17a610 (diff) | |
parent | e495476b1e31023637259883aa735fcc716c6adc (diff) |
Merge remote-tracking branch 'upstream/master' into package-grpc-tools
Diffstat (limited to 'templates')
14 files changed, 140 insertions, 75 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index de13d02e2a..2a514ed7b6 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -149,6 +149,8 @@ add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) # needed to compile protobuf add_definitions(/wd4065 /wd4506) + # TODO(jtattermusch): revisit warnings that were silenced as part of upgrade to protobuf3.6.0 + add_definitions(/wd4200 /wd4291 /wd4244) # TODO(jtattermusch): revisit C4267 occurrences throughout the code add_definitions(/wd4267) # TODO(jtattermusch): needed to build boringssl with VS2017, revisit later diff --git a/templates/Makefile.template b/templates/Makefile.template index 4a04af122d..50b81e5f9f 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -37,10 +37,10 @@ # warnings we'd like, but that dont exist in all compilers PREFERRED_WARNINGS=['shadow', 'extra-semi'] - CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value'] + CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable', 'no-maybe-uninitialized'] def warning_var(fmt, warning): - return fmt % warning.replace('-', '_').upper() + return fmt % warning.replace('-', '_').replace('+', 'X').upper() def neg_warning(warning): if warning[0:3] == 'no-': @@ -191,6 +191,12 @@ TMPOUT = `mktemp /tmp/test-out-XXXXXX` endif + CHECK_NO_CXX14_COMPAT_WORKS_CMD = $(CC) -std=c++11 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.cc + HAS_WORKING_NO_CXX14_COMPAT = $(shell $(CHECK_NO_CXX14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) + ifeq ($(HAS_WORKING_NO_CXX14_COMPAT),true) + W_NO_CXX14_COMPAT=-Wno-c++14-compat + endif + %for warning in CHECK_WARNINGS: ${warning_var('CHECK_%s_WORKS_CMD', warning)} = $(CC) -std=c99 -Werror -W${warning} -o $(TMPOUT) -c test/build/${warning}.c ${warning_var('HAS_WORKING_%s', warning)} = $(shell $(${warning_var('CHECK_%s_WORKS_CMD', warning)}) 2> /dev/null && echo true || echo false) @@ -915,6 +921,16 @@ % endfor + static_csharp: static_c \ + % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): + % if lib.build == 'all' and lib.language == 'csharp': + $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ + % endif + % endif + % endfor + + shared: shared_c shared_cxx shared_c: pc_c pc_c_unsecure cache.mk\ @@ -1271,6 +1287,11 @@ $(Q) mkdir -p `dirname $@` $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + $(OBJDIR)/$(CONFIG)/%.o : %.cpp + $(E) "[CXX] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + install: install_c install_cxx install-plugins install-certs install_c: install-headers_c install-static_c install-shared_c diff --git a/templates/composer.json.template b/templates/composer.json.template index aa6cbb8bcb..a9cc6cca86 100644 --- a/templates/composer.json.template +++ b/templates/composer.json.template @@ -11,7 +11,7 @@ "php": ">=5.5.0" }, "require-dev": { - "google/auth": "v0.9" + "google/auth": "^v1.3.0" }, "suggest": { "ext-protobuf": "For better performance, install the protobuf C extension.", diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 2853bb63ab..cff252b3a9 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -49,6 +49,7 @@ out = grpc_lib_files(filegroups, ("grpc++_codegen_proto", "grpc++_config_proto"), ("headers", "src", "public_headers")) excl_files = grpc_lib_files(filegroups, ("grpc++_codegen_base",), ("headers", "src", "public_headers")) out = [file for file in out if file not in excl_files] + out = filter_grpcpp(out) return out def grpcpp_private_files(libs, filegroups): @@ -131,7 +132,7 @@ s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized # version = '${settings.version}' - version = '0.0.2' + version = '0.0.3' s.version = version s.summary = 'gRPC C++ library' s.homepage = 'https://grpc.io' @@ -195,6 +196,13 @@ ss.private_header_files = ${ruby_multiline_list(grpcpp_private_headers(libs, filegroups), 30)} end + s.subspec 'Protobuf' do |ss| + ss.header_mappings_dir = 'include/grpcpp' + ss.dependency "#{s.name}/Interface", version + + ss.source_files = ${ruby_multiline_list(grpcpp_proto_files(filegroups), 22)} + end + s.prepare_command = <<-END_OF_COMMAND find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g' find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm diff --git a/templates/src/csharp/Grpc.Core/Version.csproj.include.template b/templates/src/csharp/Grpc.Core/Version.csproj.include.template index 398b198dbd..0ec0a08c49 100755 --- a/templates/src/csharp/Grpc.Core/Version.csproj.include.template +++ b/templates/src/csharp/Grpc.Core/Version.csproj.include.template @@ -4,6 +4,6 @@ <Project> <PropertyGroup> <GrpcCsharpVersion>${settings.csharp_version}</GrpcCsharpVersion> - <GoogleProtobufVersion>3.5.1</GoogleProtobufVersion> + <GoogleProtobufVersion>3.6.1</GoogleProtobufVersion> </PropertyGroup> </Project> diff --git a/templates/src/csharp/build_packages_dotnetcli.bat.template b/templates/src/csharp/build_packages_dotnetcli.bat.template index cdadbba44f..877899c7bd 100755 --- a/templates/src/csharp/build_packages_dotnetcli.bat.template +++ b/templates/src/csharp/build_packages_dotnetcli.bat.template @@ -23,18 +23,12 @@ mkdir ..\..\artifacts - @rem Collect the artifacts built by the previous build step if running on Jenkins + @rem Collect the artifacts built by the previous build step mkdir nativelibs - @rem Jenkins flow (deprecated) - powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs" - @rem Kokoro flow powershell -Command "cp -r ..\..\input_artifacts\csharp_ext_* nativelibs" @rem Collect protoc artifacts built by the previous build step mkdir protoc_plugins - @rem Jenkins flow (deprecated) - powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins" - @rem Kokoro flow powershell -Command "cp -r ..\..\input_artifacts\protoc_* protoc_plugins" %%DOTNET% restore Grpc.sln || goto :error diff --git a/templates/src/csharp/build_packages_dotnetcli.sh.template b/templates/src/csharp/build_packages_dotnetcli.sh.template deleted file mode 100755 index 5eba62efab..0000000000 --- a/templates/src/csharp/build_packages_dotnetcli.sh.template +++ /dev/null @@ -1,54 +0,0 @@ -%YAML 1.2 ---- | - #!/bin/bash - # Copyright 2016 gRPC authors. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - - set -ex - - cd $(dirname $0) - - mkdir -p ../../artifacts/ - - # Collect the artifacts built by the previous build step - mkdir -p nativelibs - # Jenkins flow (deprecated) - cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/csharp_ext_* nativelibs || true - # Kokoro flow - cp -r $EXTERNAL_GIT_ROOT/input_artifacts/csharp_ext_* nativelibs || true - - # Collect protoc artifacts built by the previous build step - mkdir -p protoc_plugins - # Jenkins flow (deprecated) - cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/protoc_* protoc_plugins || true - # Kokoro flow - cp -r $EXTERNAL_GIT_ROOT/input_artifacts/protoc_* protoc_plugins || true - - dotnet restore Grpc.sln - - # To be able to build, we also need to put grpc_csharp_ext to its normal location - mkdir -p ../../libs/opt - cp nativelibs/csharp_ext_linux_x64/libgrpc_csharp_ext.so ../../libs/opt - - dotnet pack --configuration Release Grpc.Core --output ../../../artifacts - dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts - dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts - dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts - dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts - dotnet pack --configuration Release Grpc.Tools --output ../../../artifacts - - nuget pack Grpc.nuspec -Version "${settings.csharp_version}" -OutputDirectory ../../artifacts - nuget pack Grpc.Core.NativeDebug.nuspec -Version "${settings.csharp_version}" -OutputDirectory ../../artifacts - - (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/templates/src/csharp/build_unitypackage.bat.template b/templates/src/csharp/build_unitypackage.bat.template new file mode 100755 index 0000000000..76ec10dbd9 --- /dev/null +++ b/templates/src/csharp/build_unitypackage.bat.template @@ -0,0 +1,82 @@ +%YAML 1.2 +--- | + @rem Copyright 2018 The gRPC Authors + @rem + @rem Licensed under the Apache License, Version 2.0 (the "License"); + @rem you may not use this file except in compliance with the License. + @rem You may obtain a copy of the License at + @rem + @rem http://www.apache.org/licenses/LICENSE-2.0 + @rem + @rem Unless required by applicable law or agreed to in writing, software + @rem distributed under the License is distributed on an "AS IS" BASIS, + @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + @rem See the License for the specific language governing permissions and + @rem limitations under the License. + + @rem Current package versions + set VERSION=${settings.csharp_version} + + @rem Adjust the location of nuget.exe + set NUGET=C:\nuget\nuget.exe + set DOTNET=dotnet + + mkdir ..\..\artifacts + + @rem Collect the artifacts built by the previous build step + mkdir nativelibs + powershell -Command "cp -r ..\..\input_artifacts\csharp_ext_* nativelibs" + + @rem Collect protoc artifacts built by the previous build step + mkdir protoc_plugins + powershell -Command "cp -r ..\..\input_artifacts\protoc_* protoc_plugins" + + %%DOTNET% restore Grpc.sln || goto :error + + @rem To be able to build, we also need to put grpc_csharp_ext to its normal location + xcopy /Y /I nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release${"\\"} + + %%DOTNET% build --configuration Release Grpc.Core || goto :error + @rem build HealthCheck to get hold of Google.Protobuf.dll assembly + %%DOTNET% build --configuration Release Grpc.HealthCheck || goto :error + + @rem copy Grpc assemblies to the unity package skeleton + @rem TODO(jtattermusch): Add Grpc.Auth assembly and its dependencies + copy /Y Grpc.Core\bin\Release\net45\Grpc.Core.dll unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\lib\net45\Grpc.Core.dll || goto :error + copy /Y Grpc.Core\bin\Release\net45\Grpc.Core.pdb unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\lib\net45\Grpc.Core.pdb || goto :error + copy /Y Grpc.Core\bin\Release\net45\Grpc.Core.xml unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\lib\net45\Grpc.Core.xml || goto :error + + @rem copy desktop native libraries to the unity package skeleton + copy /Y nativelibs\csharp_ext_linux_x86\libgrpc_csharp_ext.so unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\linux\x86\libgrpc_csharp_ext.so || goto :error + copy /Y nativelibs\csharp_ext_linux_x64\libgrpc_csharp_ext.so unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\linux\x64\libgrpc_csharp_ext.so || goto :error + copy /Y nativelibs\csharp_ext_macos_x86\libgrpc_csharp_ext.dylib unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\osx\x86\grpc_csharp_ext.bundle || goto :error + copy /Y nativelibs\csharp_ext_macos_x64\libgrpc_csharp_ext.dylib unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\osx\x64\grpc_csharp_ext.bundle || goto :error + copy /Y nativelibs\csharp_ext_windows_x86\grpc_csharp_ext.dll unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\win\x86\grpc_csharp_ext.dll || goto :error + copy /Y nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\win\x64\grpc_csharp_ext.dll || goto :error + + @rem add Android and iOS native libraries + copy /Y nativelibs\csharp_ext_linux_android_armeabi-v7a\libgrpc_csharp_ext.so unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\android\armeabi-v7a\libgrpc_csharp_ext.so || goto :error + copy /Y nativelibs\csharp_ext_linux_android_arm64-v8a\libgrpc_csharp_ext.so unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\android\arm64-v8a\libgrpc_csharp_ext.so || goto :error + copy /Y nativelibs\csharp_ext_linux_android_x86\libgrpc_csharp_ext.so unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\android\x86\libgrpc_csharp_ext.so || goto :error + copy /Y nativelibs\csharp_ext_macos_ios\libgrpc_csharp_ext.a unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\ios\libgrpc_csharp_ext.a || goto :error + copy /Y nativelibs\csharp_ext_macos_ios\libgrpc.a unitypackage\unitypackage_skeleton\Plugins\Grpc.Core\runtimes\ios\libgrpc.a || goto :error + + @rem add gRPC dependencies + @rem TODO(jtattermusch): also include XMLdoc + copy /Y Grpc.Core\bin\Release\net45\System.Interactive.Async.dll unitypackage\unitypackage_skeleton\Plugins\System.Interactive.Async\lib\net45\System.Interactive.Async.dll || goto :error + + @rem add Google.Protobuf + @rem TODO(jtattermusch): also include XMLdoc + copy /Y Grpc.HealthCheck\bin\Release\net45\Google.Protobuf.dll unitypackage\unitypackage_skeleton\Plugins\Google.Protobuf\lib\net45\Google.Protobuf.dll || goto :error + + @rem create a zipfile that will act as a Unity package + cd unitypackage\unitypackage_skeleton + zip -r ..\..\grpc_unity_package.zip Plugins + cd ..\.. + copy /Y grpc_unity_package.zip ..\..\artifacts\grpc_unity_package.%VERSION%.zip || goto :error + + goto :EOF + + :error + echo Failed! + exit /b %errorlevel% diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template index 5c1358f7c3..30b6c5684c 100644 --- a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template +++ b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template @@ -103,7 +103,7 @@ s.preserve_paths = plugin # Restrict the protoc version to the one supported by this plugin. - s.dependency '!ProtoCompiler', '3.5.0' + s.dependency '!ProtoCompiler', '3.6.0' # For the Protobuf dependency not to complain: s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' diff --git a/templates/src/php/composer.json.template b/templates/src/php/composer.json.template index d647997113..3793634a2f 100644 --- a/templates/src/php/composer.json.template +++ b/templates/src/php/composer.json.template @@ -10,7 +10,7 @@ "google/protobuf": "^v3.3.0" }, "require-dev": { - "google/auth": "v0.9" + "google/auth": "^v1.3.0" }, "autoload": { "psr-4": { diff --git a/templates/test/cpp/naming/resolver_component_tests_defs.include b/templates/test/cpp/naming/resolver_component_tests_defs.include index bc981dc83e..b34845e01a 100644 --- a/templates/test/cpp/naming/resolver_component_tests_defs.include +++ b/templates/test/cpp/naming/resolver_component_tests_defs.include @@ -22,6 +22,7 @@ import tempfile import os import time import signal +import platform argp = argparse.ArgumentParser(description='Run c-ares resolver tests') @@ -43,6 +44,11 @@ args = argp.parse_args() def test_runner_log(msg): sys.stderr.write('\n%s: %s\n' % (__file__, msg)) +def python_args(arg_list): + if platform.system() == 'Windows': + return [sys.executable] + arg_list + return arg_list + cur_resolver = os.environ.get('GRPC_DNS_RESOLVER') if cur_resolver and cur_resolver != 'ares': test_runner_log(('WARNING: cur resolver set to %s. This set of tests ' @@ -50,26 +56,27 @@ if cur_resolver and cur_resolver != 'ares': test_runner_log('Exit 1 without running tests.') sys.exit(1) os.environ.update({'GRPC_DNS_RESOLVER': 'ares'}) +os.environ.update({'GRPC_TRACE': 'cares_resolver'}) def wait_until_dns_server_is_up(args, dns_server_subprocess, dns_server_subprocess_output): for i in range(0, 30): test_runner_log('Health check: attempt to connect to DNS server over TCP.') - tcp_connect_subprocess = subprocess.Popen([ + tcp_connect_subprocess = subprocess.Popen(python_args([ args.tcp_connect_bin_path, '--server_host', '127.0.0.1', '--server_port', str(args.dns_server_port), - '--timeout', str(1)]) + '--timeout', str(1)])) tcp_connect_subprocess.communicate() if tcp_connect_subprocess.returncode == 0: test_runner_log(('Health check: attempt to make an A-record ' 'query to DNS server.')) - dns_resolver_subprocess = subprocess.Popen([ + dns_resolver_subprocess = subprocess.Popen(python_args([ args.dns_resolver_bin_path, '--qname', 'health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp', '--server_host', '127.0.0.1', - '--server_port', str(args.dns_server_port)], + '--server_port', str(args.dns_server_port)]), stdout=subprocess.PIPE) dns_resolver_stdout, _ = dns_resolver_subprocess.communicate() if dns_resolver_subprocess.returncode == 0: @@ -91,10 +98,10 @@ def wait_until_dns_server_is_up(args, dns_server_subprocess_output = tempfile.mktemp() with open(dns_server_subprocess_output, 'w') as l: - dns_server_subprocess = subprocess.Popen([ + dns_server_subprocess = subprocess.Popen(python_args([ args.dns_server_bin_path, '--port', str(args.dns_server_port), - '--records_config_path', args.records_config_path], + '--records_config_path', args.records_config_path]), stdin=subprocess.PIPE, stdout=l, stderr=l) diff --git a/templates/tools/dockerfile/bazel.include b/templates/tools/dockerfile/bazel.include index 2c0f3825fc..ee4f9556af 100644 --- a/templates/tools/dockerfile/bazel.include +++ b/templates/tools/dockerfile/bazel.include @@ -2,4 +2,4 @@ # Bazel installation RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add - -RUN apt-get -y update && apt-get -y install bazel=0.13.1 && apt-get clean +RUN apt-get -y update && apt-get -y install bazel=0.15.0 && apt-get clean diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_dart/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_dart/Dockerfile.template index 8b71716dfb..4fb7b4642d 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_dart/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_dart/Dockerfile.template @@ -16,5 +16,8 @@ FROM google/dart:latest + # Upgrade Dart to version 2. + RUN apt-get update && apt-get upgrade -y dart + # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/bazel/Dockerfile.template b/templates/tools/dockerfile/test/bazel/Dockerfile.template index 8ef2f02e71..50aa72edb3 100644 --- a/templates/tools/dockerfile/test/bazel/Dockerfile.template +++ b/templates/tools/dockerfile/test/bazel/Dockerfile.template @@ -28,6 +28,8 @@ openjdk-8-jdk ${'\\'} vim + <%include file="../../python_deps.include"/> + <%include file="../../bazel.include"/> RUN mkdir -p /var/local/jenkins |