aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-03-11 14:47:07 -0800
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-03-11 14:47:07 -0800
commit52676ba0c250f55828f9b590c0e215ec18a9344c (patch)
tree4138d2fda2bac9430632bdb53cbd02e1366291d2 /templates
parent4d52cca1ef29837c7610e31897240b6f4abd6991 (diff)
parentaad4156a0ba79d963bfa3cd37e48a1074f956809 (diff)
Merge pull request #5694 from nicolasnoble/pre-0.13.1-downmerge
Pre 0.13.1 downmerge
Diffstat (limited to 'templates')
-rw-r--r--templates/Makefile.template37
-rw-r--r--templates/README.md111
-rw-r--r--templates/package.xml.template25
-rw-r--r--templates/src/csharp/build_packages.bat.template17
-rw-r--r--templates/tools/dockerfile/apt_get_basic.include3
-rw-r--r--templates/tools/dockerfile/run_tests_addons.include3
-rw-r--r--templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template48
-rw-r--r--templates/tools/dockerfile/test/cxx_squeeze_x64/post-git-setup.sh.template37
-rw-r--r--templates/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template39
-rw-r--r--templates/tools/openssl/use_openssl.sh.template63
-rw-r--r--templates/tools/run_tests/sources_and_headers.json.template54
-rw-r--r--templates/tools/run_tests/tests.json.template3
-rw-r--r--templates/vsprojects/protoc.props.template3
13 files changed, 360 insertions, 83 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 7aa6ad71e2..c54c146620 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/README.md b/templates/README.md
index 6740972cfb..eedc6e9c09 100644
--- a/templates/README.md
+++ b/templates/README.md
@@ -6,78 +6,92 @@ was going to single handedly cover all of our usage cases.
So instead we decided to work the following way:
-* A build.json file at the root is the source of truth for listing all of the
-target and files needed to build grpc and its tests, as well as basic system
-dependencies description.
+* A `build.yaml` file at the root is the source of truth for listing all the
+targets and files needed to build grpc and its tests, as well as a basic system
+for dependency description.
* Each project file (Makefile, Visual Studio project files, Bazel's BUILD) is
-a plain-text template that uses the build.json file to generate the final
-output file.
+a [YAML](http://yaml.org) file used by the `build.yaml` file to generate the
+final output file.
This way we can maintain as many project system as we see fit, without having
to manually maintain them when we add or remove new code to the repository.
Only the structure of the project file is relevant to the template. The actual
list of source code and targets isn't.
-We currently have template files for GNU Make, Visual Studio 2010 to 2015,
-and Bazel. In the future, we would like to expand to generating gyp or cmake
-project files (or potentially both), XCode project files, and an Android.mk
-file to be able to compile gRPC using Android's NDK.
+We currently have template files for GNU Make, Visual Studio 2013,
+[Bazel](http://bazel.io) and [gyp](https://gyp.gsrc.io/) (albeit only for
+Node.js). In the future, we
+would like to expand to also generate [cmake](https://cmake.org)
+project files, XCode project files, and an Android.mk file allowing to compile
+gRPC using Android's NDK.
We'll gladly accept contribution that'd create additional project files
using that system.
-# Structure of build.json
+# Structure of `build.yaml`
-The build.json file has the following structure:
+The `build.yaml` file has the following structure:
```
-{
- "settings": { ... }, # global settings, such as version number
- "filegroups": [ ... ], # groups of file that is automatically expanded
- "libs": [ ... ], # list of libraries to build
- "targets": [ ... ], # list of targets to build
-}
+settings: # global settings, such as version number
+ ...
+filegroups: # groups of files that are automatically expanded
+ ...
+libs: # list of libraries to build
+ ...
+target: # list of targets to build
+ ...
```
The `filegroups` are helpful to re-use a subset of files in multiple targets.
One `filegroups` entry has the following structure:
```
-{
- "name": "arbitrary string", # the name of the filegroup
- "public_headers": [ ... ], # list of public headers defined in that filegroup
- "headers": [ ... ], # list of headers defined in that filegroup
- "src": [ ... ], # list of source files defined in that filegroup
-}
+- name: "arbitrary string", # the name of the filegroup
+ public_headers: # list of public headers defined in that filegroup
+ - ...
+ headers: # list of headers defined in that filegroup
+ - ...
+ src: # list of source files defined in that filegroup
+ - ...
```
-The `libs` array contains the list of all the libraries we describe. Some may be
+The `libs` collection contains the list of all the libraries we describe. Some may be
helper libraries for the tests. Some may be installable libraries. Some may be
helper libraries for installable binaries.
The `targets` array contains the list of all the binary targets we describe. Some may
be installable binaries.
-One `libs` or `targets` entry has the following structure:
+One `libs` or `targets` entry has the following structure (see below for
+details):
```
-{
- "name": "arbitrary string", # the name of the library
- "build": "build type", # in which situation we want that library to be
- # built and potentially installed
- "language": "...", # the language tag; "c" or "c++"
- "public_headers": [ ... ], # list of public headers to install
- "headers": [ ... ], # list of headers used by that target
- "src": [ ... ], # list of files to compile
- "secure": "...", # "yes", "no" or "check"
- "baselib": boolean, # this is a low level library that has system
- # dependencies
- "vs_project_guid: "...", # Visual Studio's unique guid for that project
- "filegroups": [ ... ], # list of filegroups to merge to that project
- # note that this will be expanded automatically
- "deps": [ ... ], # list of libraries this target depends on
-}
+name: "arbitrary string", # the name of the library
+build: "build type", # in which situation we want that library to be
+ # built and potentially installed (see below).
+language: "...", # the language tag; "c" or "c++"
+public_headers: # list of public headers to install
+headers: # list of headers used by that target
+src: # list of files to compile
+secure: boolean, # see below
+baselib: boolean, # this is a low level library that has system
+ # dependencies
+vs_project_guid: '{...}', # Visual Studio's unique guid for that project
+filegroups: # list of filegroups to merge to that project
+ # note that this will be expanded automatically
+deps: # list of libraries this target depends on
+deps_linkage: "..." # "static" or "dynamic". Used by the Makefile only to
+ # determine the way dependencies are linkned. Defaults
+ # to "dynamic".
+dll: "..." # see below.
+dll_def: "..." # Visual Studio's dll definition file.
+vs_props: # List of property sheets to attach to that project.
+vs_config_type: "..." # DynamicLibrary/StaticLibrary. Used only when
+ # creating a library. Specifies if we're building a
+ # static library or a dll. Use in conjunction with `dll_def`.
+vs_packages: # List of nuget packages this project depends on.
```
## The `"build"` tag
@@ -86,8 +100,9 @@ Currently, the "`build`" tag have these meanings:
* `"all"`: library to build on `"make all"`, and install on the system.
* `"protoc"`: a protoc plugin to build on `"make all"` and install on the system.
-* `"priviate"`: a library to only build for tests.
+* `"private"`: a library to only build for tests.
* `"test"`: a test binary to run on `"make test"`.
+* `"tool"`: a binary to be built upon `"make tools"`.
All of the targets should always be present in the generated project file, if
possible and applicable. But the build tag is what should group the targets
@@ -111,6 +126,18 @@ should merge OpenSSL, protobuf or zlib inside that library. That effect depends
on the `"language"` tag. OpenSSL and zlib are for `"c"` libraries, while
protobuf is for `"c++"` ones.
+## The `"dll"` tag
+
+Used only by Visual Studio's project files. "true" means the project will be
+built with both static and dynamic runtimes. "false" means it'll only be built
+with static runtime. "only" means it'll only be built with the dll runtime.
+
+## The `"dll_def"` tag
+
+Specifies the visual studio's dll definition file. When creating a DLL, you
+sometimes (not always) need a def file (see grpc.def).
+
+
# The template system
We're currently using the [mako templates](http://www.makotemplates.org/)
diff --git a/templates/package.xml.template b/templates/package.xml.template
index 058f506471..d309bfddbc 100644
--- a/templates/package.xml.template
+++ b/templates/package.xml.template
@@ -12,11 +12,11 @@
<email>grpc-packages@google.com</email>
<active>yes</active>
</lead>
- <date>2016-02-24</date>
+ <date>2016-03-01</date>
<time>16:06:07</time>
<version>
- <release>0.8.0</release>
- <api>0.8.0</api>
+ <release>0.14.0</release>
+ <api>0.14.0</api>
</version>
<stability>
<release>beta</release>
@@ -24,8 +24,7 @@
</stability>
<license>BSD</license>
<notes>
- - Simplify gRPC PHP installation #4517
- - Wrap gRPC core library version 0.13
+ - Increase unit test code coverage #5225
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@@ -154,7 +153,21 @@
<license>BSD</license>
<notes>
- Simplify gRPC PHP installation #4517
- - Wrap gRPC core library version 0.13
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>0.14.0</release>
+ <api>0.14.0</api>
+ </version>
+ <stability>
+ <release>beta</release>
+ <api>beta</api>
+ </stability>
+ <date>2016-03-01</date>
+ <license>BSD</license>
+ <notes>
+ - Increase unit test code coverage #5225
</notes>
</release>
</changelog>
diff --git a/templates/src/csharp/build_packages.bat.template b/templates/src/csharp/build_packages.bat.template
index b855126ae6..32455683be 100644
--- a/templates/src/csharp/build_packages.bat.template
+++ b/templates/src/csharp/build_packages.bat.template
@@ -21,6 +21,14 @@
xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* grpc.native.csharp\macosx_x86${"\\"}
xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* grpc.native.csharp\macosx_x64${"\\"}
+ @rem Collect protoc artifacts built by the previous build step
+ xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86${"\\"}
+ xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64${"\\"}
+ xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86${"\\"}
+ xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64${"\\"}
+ xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86${"\\"}
+ xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64${"\\"}
+
@rem Fetch all dependencies
%%NUGET% restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error
%%NUGET% restore Grpc.sln || goto :error
@@ -29,24 +37,19 @@
@call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86
- @rem We won't use the native libraries from this step, but without this Grpc.sln will fail.
+ @rem We won't use the native libraries from this step, but without this Grpc.sln will fail.
msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error
msbuild Grpc.sln /p:Configuration=ReleaseSigned || goto :error
endlocal
- @rem TODO(jtattermusch): re-enable protoc plugin building
- @rem @call ..\..\vsprojects\build_plugins.bat || goto :error
-
%%NUGET% pack grpc.native.csharp\grpc.native.csharp.nuspec -Version %VERSION% || goto :error
%%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
%%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error
%%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION_WITH_BETA% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
%%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error
-
- @rem TODO(jtattermusch): re-enable building Grpc.Tools package
- @rem %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
+ %%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
@rem copy resulting nuget packages to artifacts directory
xcopy /Y /I *.nupkg ..\..\artifacts${"\\"}
diff --git a/templates/tools/dockerfile/apt_get_basic.include b/templates/tools/dockerfile/apt_get_basic.include
index 9237e7dace..547ce01a30 100644
--- a/templates/tools/dockerfile/apt_get_basic.include
+++ b/templates/tools/dockerfile/apt_get_basic.include
@@ -1,3 +1,4 @@
+<%page args="skip_golang=False"/>\
# Install Git and basic packages.
RUN apt-get update && apt-get install -y ${'\\'}
autoconf ${'\\'}
@@ -9,7 +10,9 @@ RUN apt-get update && apt-get install -y ${'\\'}
gcc ${'\\'}
gcc-multilib ${'\\'}
git ${'\\'}
+% if not skip_golang:
golang ${'\\'}
+% endif
gyp ${'\\'}
lcov ${'\\'}
libc6 ${'\\'}
diff --git a/templates/tools/dockerfile/run_tests_addons.include b/templates/tools/dockerfile/run_tests_addons.include
index 27ac67f5d8..30d22be298 100644
--- a/templates/tools/dockerfile/run_tests_addons.include
+++ b/templates/tools/dockerfile/run_tests_addons.include
@@ -1,7 +1,10 @@
+<%page args="skip_zookeeper=False"/>\
<%include file="ccache_setup.include"/>
+% if not skip_zookeeper:
#======================
# Zookeeper dependencies
# TODO(jtattermusch): is zookeeper still needed?
RUN apt-get install -y libzookeeper-mt-dev
+% endif
RUN mkdir /var/local/jenkins
diff --git a/templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template
new file mode 100644
index 0000000000..49371aaa3b
--- /dev/null
+++ b/templates/tools/dockerfile/test/cxx_squeeze_x64/Dockerfile.template
@@ -0,0 +1,48 @@
+%YAML 1.2
+--- |
+ # 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.
+
+ 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"]
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 0000000000..b885101748
--- /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/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template
new file mode 100644
index 0000000000..6b30274892
--- /dev/null
+++ b/templates/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template
@@ -0,0 +1,39 @@
+%YAML 1.2
+--- |
+ # 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.
+
+ FROM ubuntu:16.04
+
+ <%include file="../../apt_get_basic.include"/>
+ <%include file="../../cxx_deps.include"/>
+ <%include file="../../run_tests_addons.include"/>
+ # Define the default command.
+ CMD ["bash"]
+ \ No newline at end of file
diff --git a/templates/tools/openssl/use_openssl.sh.template b/templates/tools/openssl/use_openssl.sh.template
new file mode 100644
index 0000000000..5fb377154a
--- /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/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template
index 04802772af..18b9bc2654 100644
--- a/templates/tools/run_tests/sources_and_headers.json.template
+++ b/templates/tools/run_tests/sources_and_headers.json.template
@@ -3,34 +3,48 @@
<%!
import json
import os
-
+
def proto_headers(src):
+ out = []
+ for f in src:
+ name, ext = os.path.splitext(f)
+ if ext == '.proto':
+ out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
+ return out
+
+ def all_targets(targets, libs):
+ for tgt in targets:
+ yield ('target', tgt)
+ for tgt in libs:
+ yield ('lib', tgt)
+
+ def no_protos_filter(src):
+ return os.path.splitext(src)[1] != '.proto'
+
+ def no_third_party_filter(src):
+ return not src.startswith('third_party/')
+
+ def filter_srcs(srcs, filters):
out = []
- for f in src:
- name, ext = os.path.splitext(f)
- if ext == '.proto':
- out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
- return out
-
- def no_protos(src):
- out = []
- for f in src:
- if os.path.splitext(f)[1] != '.proto':
- out.append(f)
+ for s in srcs:
+ filter_passes = (f(s) for f in filters)
+ if all(filter_passes):
+ out.append(s)
return out
%>
-
+
${json.dumps([{"name": tgt.name,
+ "type": typ,
"language": tgt.language,
+ "third_party": tgt.boringssl or tgt.zlib,
"src": sorted(
- no_protos(tgt.src) +
- tgt.get('public_headers', []) +
- tgt.get('headers', [])),
+ filter_srcs(tgt.src, (no_protos_filter, no_third_party_filter)) +
+ filter_srcs(tgt.get('public_headers', []), (no_protos_filter, no_third_party_filter)) +
+ filter_srcs(tgt.get('headers', []), (no_third_party_filter,))),
"headers": sorted(
- tgt.get('public_headers', []) +
- tgt.get('headers', []) +
+ tgt.get('public_headers', []) +
+ tgt.get('headers', []) +
proto_headers(tgt.src)),
"deps": sorted(tgt.get('deps', []))}
- for tgt in (targets + libs)
- if not tgt.boringssl and not tgt.zlib],
+ for typ, tgt in all_targets(targets, libs)],
sort_keys=True, indent=2)}
diff --git a/templates/tools/run_tests/tests.json.template b/templates/tools/run_tests/tests.json.template
index 9a84783467..5690874415 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/templates/vsprojects/protoc.props.template b/templates/vsprojects/protoc.props.template
index a869005dae..ced6028a4b 100644
--- a/templates/vsprojects/protoc.props.template
+++ b/templates/vsprojects/protoc.props.template
@@ -4,6 +4,9 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
+ <ClCompile>
+ <DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
<Link>
<AdditionalDependencies>libprotoc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>