Merge remote-tracking branch 'upstream/master' into spiffe1

pull/19778/head
Matthew Stevenson 5 years ago
commit 28bbf14b01
  1. 10
      CMakeLists.txt
  2. 3
      src/core/ext/filters/max_age/max_age_filter.cc
  3. 10
      src/core/ext/transport/inproc/inproc_transport.cc
  4. 2
      src/core/lib/iomgr/executor.cc
  5. 5792
      src/core/tsi/grpc_shadow_boringssl.h
  6. 4
      src/csharp/docfx/generate_reference_docs.sh
  7. 2
      src/csharp/experimental/build_native_ext_for_ios.sh
  8. 5804
      src/objective-c/BoringSSL-GRPC.podspec
  9. 5792
      src/objective-c/grpc_shadow_boringssl_symbol_list
  10. 10
      templates/CMakeLists.txt.template
  11. 34
      tools/distrib/generate_grpc_shadow_boringssl_symbol_list.sh
  12. 0
      tools/dockerfile/grpc_artifact_python_manylinux1_x64/Dockerfile
  13. 0
      tools/dockerfile/grpc_artifact_python_manylinux1_x86/Dockerfile
  14. 38
      tools/dockerfile/grpc_artifact_python_manylinux2010_x64/Dockerfile
  15. 41
      tools/run_tests/artifacts/artifact_targets.py
  16. 4
      tools/run_tests/artifacts/build_artifact_python.sh

@ -100,14 +100,16 @@ if (MSVC)
include(cmake/msvc_static_runtime.cmake)
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)
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4065 /wd4506")
# TODO(jtattermusch): revisit warnings that were silenced as part of upgrade to protobuf3.6.0
add_definitions(/wd4200 /wd4291 /wd4244)
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4200 /wd4291 /wd4244")
# TODO(jtattermusch): revisit C4267 occurrences throughout the code
add_definitions(/wd4267)
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267")
# TODO(jtattermusch): needed to build boringssl with VS2017, revisit later
add_definitions(/wd4987 /wd4774 /wd4819 /wd4996 /wd4619)
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}")
if (gRPC_USE_PROTO_LITE)
set(_gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf-lite")

@ -29,6 +29,9 @@
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/http2_errors.h"
/* If these settings change, make sure that we are not sending a GOAWAY for
* inproc transport, since a GOAWAY to inproc ends up destroying the transport.
*/
#define DEFAULT_MAX_CONNECTION_AGE_MS INT_MAX
#define DEFAULT_MAX_CONNECTION_AGE_GRACE_MS INT_MAX
#define DEFAULT_MAX_CONNECTION_IDLE_MS INT_MAX

@ -1226,10 +1226,15 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
grpc_core::ExecCtx exec_ctx;
const grpc_channel_args* server_args = grpc_server_get_channel_args(server);
// Remove max_connection_idle and max_connection_age channel arguments since
// those do not apply to inproc transports.
const char* args_to_remove[] = {GRPC_ARG_MAX_CONNECTION_IDLE_MS,
GRPC_ARG_MAX_CONNECTION_AGE_MS};
const grpc_channel_args* server_args = grpc_channel_args_copy_and_remove(
grpc_server_get_channel_args(server), args_to_remove,
GPR_ARRAY_SIZE(args_to_remove));
// Add a default authority channel argument for the client
grpc_arg default_authority_arg;
default_authority_arg.type = GRPC_ARG_STRING;
default_authority_arg.key = (char*)GRPC_ARG_DEFAULT_AUTHORITY;
@ -1249,6 +1254,7 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
"inproc", client_args, GRPC_CLIENT_DIRECT_CHANNEL, client_transport);
// Free up created channel args
grpc_channel_args_destroy(server_args);
grpc_channel_args_destroy(client_args);
// Now finish scheduled operations

@ -264,6 +264,8 @@ void Executor::ThreadMain(void* arg) {
grpc_core::ExecCtx::Get()->InvalidateNow();
subtract_depth = RunClosures(ts->name, closures);
}
// Clear the thread local after use.
gpr_tls_set(&g_this_thread_state, reinterpret_cast<intptr_t>(nullptr));
}
void Executor::Enqueue(grpc_closure* closure, grpc_error* error,

File diff suppressed because it is too large Load Diff

@ -20,9 +20,9 @@ cd $(dirname $0)
# cleanup temporary files
rm -rf html obj grpc-gh-pages
# generate into src/csharp/doc/html directory
# generate into src/csharp/docfx/html directory
cd ..
docker run --rm -v "$(pwd)":/work -w /work/doc --user "$(id -u):$(id -g)" -it tsgkadot/docker-docfx:latest docfx
docker run --rm -v "$(pwd)":/work -w /work/docfx --user "$(id -u):$(id -g)" -it tsgkadot/docker-docfx:latest docfx
cd docfx
# prepare a clone of "gh-pages" branch where the generated docs are stored

@ -28,7 +28,7 @@ function build {
PATH_CC="$(xcrun --sdk $SDK --find clang)"
PATH_CXX="$(xcrun --sdk $SDK --find clang++)"
CPPFLAGS="-O2 -Wframe-larger-than=16384 -arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -fembed-bitcode -mios-version-min=6.0 -DPB_NO_PACKED_STRUCTS=1"
CPPFLAGS="-O2 -Wframe-larger-than=16384 -arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -mios-version-min=6.0 -DPB_NO_PACKED_STRUCTS=1"
LDFLAGS="-arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -Wl,ios_version_min=6.0"
# TODO(jtattermusch): revisit the build arguments

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -149,14 +149,16 @@
include(cmake/msvc_static_runtime.cmake)
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)
set(_gRPC_C_CXX_FLAGS "<%text>${_gRPC_C_CXX_FLAGS}</%text> /wd4065 /wd4506")
# TODO(jtattermusch): revisit warnings that were silenced as part of upgrade to protobuf3.6.0
add_definitions(/wd4200 /wd4291 /wd4244)
set(_gRPC_C_CXX_FLAGS "<%text>${_gRPC_C_CXX_FLAGS}</%text> /wd4200 /wd4291 /wd4244")
# TODO(jtattermusch): revisit C4267 occurrences throughout the code
add_definitions(/wd4267)
set(_gRPC_C_CXX_FLAGS "<%text>${_gRPC_C_CXX_FLAGS}</%text> /wd4267")
# TODO(jtattermusch): needed to build boringssl with VS2017, revisit later
add_definitions(/wd4987 /wd4774 /wd4819 /wd4996 /wd4619)
set(_gRPC_C_CXX_FLAGS "<%text>${_gRPC_C_CXX_FLAGS}</%text> /wd4987 /wd4774 /wd4819 /wd4996 /wd4619")
endif()
set(CMAKE_C_FLAGS "<%text>${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}</%text>")
set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}</%text>")
if (gRPC_USE_PROTO_LITE)
set(_gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf-lite")

@ -25,16 +25,34 @@ ssl_lib='../../third_party/boringssl/build/ssl/libssl.a'
crypto_lib='../../third_party/boringssl/build/crypto/libcrypto.a'
# Generate boringssl archives
( cd ../../third_party/boringssl ; mkdir -p build ; cd build ; cmake .. ; make )
( cd ../../third_party/boringssl ; mkdir -p build ; cd build ; cmake .. ; make -j ssl crypto )
# Generate shadow_boringssl.h
outputs="$(nm -C $ssl_lib)"$'\n'"$(nm -C $crypto_lib)"
symbols=$(echo "$outputs" |
grep '^[0-9a-f]* [A-Z] ' | # Only public symbols
grep -v ' bssl::' | # Filter BoringSSL symbols since they are already namespaced
sed 's/(.*//g' | # Remove parenthesis from C++ symbols
grep '^[0-9a-f]* [A-Z] _' | # Filter symbols that is not prefixed with '_'
sed 's/[0-9a-f]* [A-Z] _\(.*\)/\1/g') # Extract the symbol names
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
outputs="$(nm $ssl_lib)"$'\n'"$(nm $crypto_lib)"
symbols=$(echo "$outputs" |
grep '^[0-9a-f]* [A-Z] ' | # Only public symbols
grep -v '^[0-9a-f]* [A-Z] _' | # Remove all symbols which look like for C++
sed 's/[0-9a-f]* [A-Z] \(.*\)/\1/g' | # Extract the symbol names
sort) # Sort symbol names
;;
Darwin*)
outputs="$(nm -C $ssl_lib)"$'\n'"$(nm -C $crypto_lib)"
symbols=$(echo "$outputs" |
grep '^[0-9a-f]* [A-Z] ' | # Only public symbols
grep -v ' bssl::' | # Filter BoringSSL symbols since they are already namespaced
sed 's/(.*//g' | # Remove parenthesis from C++ symbols
grep '^[0-9a-f]* [A-Z] _' | # Filter symbols that is not prefixed with '_'
sed 's/[0-9a-f]* [A-Z] _\(.*\)/\1/g' | # Extract the symbol names
sort) # Sort symbol names
;;
*)
echo "Supports only Linux and Darwin but this system is $unameOut"
exit 1
;;
esac
commit=$(git submodule | grep "boringssl " | awk '{print $1}' | head -n 1)

@ -0,0 +1,38 @@
# Copyright 2019 The 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.
# Docker file for building gRPC manylinux Python artifacts.
FROM quay.io/pypa/manylinux2010_x86_64
# Update the package manager
RUN yum update -y
RUN yum install -y curl-devel expat-devel gettext-devel linux-headers openssl-devel zlib-devel gcc
###################################
# Install Python build requirements
RUN /opt/python/cp27-cp27m/bin/pip install cython
RUN /opt/python/cp27-cp27mu/bin/pip install cython
RUN /opt/python/cp34-cp34m/bin/pip install cython
RUN /opt/python/cp35-cp35m/bin/pip install cython
RUN /opt/python/cp36-cp36m/bin/pip install cython
RUN /opt/python/cp37-cp37m/bin/pip install cython
####################################################
# Install auditwheel with fix for namespace packages
RUN git clone https://github.com/pypa/auditwheel /usr/local/src/auditwheel
RUN cd /usr/local/src/auditwheel && git checkout 2.1
RUN /opt/python/cp36-cp36m/bin/pip install /usr/local/src/auditwheel
RUN rm /usr/local/bin/auditwheel
RUN cd /usr/local/bin && ln -s /opt/python/cp36-cp36m/bin/auditwheel

@ -110,6 +110,8 @@ class PythonArtifact:
self.arch = arch
self.labels = ['artifact', 'python', platform, arch, py_version]
self.py_version = py_version
if 'manylinux' in platform:
self.labels.append('linux')
def pre_build_jobspecs(self):
return []
@ -135,7 +137,7 @@ class PythonArtifact:
timeout_seconds=60 * 60 * 5,
docker_base_image='quay.io/grpc/raspbian_{}'.format(self.arch),
extra_docker_args=extra_args)
elif self.platform == 'linux':
elif 'manylinux' in self.platform:
if self.arch == 'x86':
environ['SETARCH_CMD'] = 'linux32'
# Inside the manylinux container, the python installations are located in
@ -150,10 +152,11 @@ class PythonArtifact:
environ['CFLAGS'] = '-DGPR_MANYLINUX1=1'
environ['GRPC_BUILD_GRPCIO_TOOLS_DEPENDENTS'] = 'TRUE'
environ['GRPC_BUILD_MANYLINUX_WHEEL'] = 'TRUE'
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_python_manylinux_%s' %
self.arch,
'tools/dockerfile/grpc_artifact_python_%s_%s' % (self.platform,
self.arch),
'tools/run_tests/artifacts/build_artifact_python.sh',
environ=environ,
timeout_seconds=60 * 60,
@ -360,12 +363,14 @@ def targets():
CSharpExtArtifact('linux', 'android', arch_abi='armeabi-v7a'),
CSharpExtArtifact('linux', 'android', arch_abi='x86'),
CSharpExtArtifact('macos', 'ios'),
PythonArtifact('linux', 'x86', 'cp27-cp27m'),
PythonArtifact('linux', 'x86', 'cp27-cp27mu'),
PythonArtifact('linux', 'x86', 'cp34-cp34m'),
PythonArtifact('linux', 'x86', 'cp35-cp35m'),
PythonArtifact('linux', 'x86', 'cp36-cp36m'),
PythonArtifact('linux', 'x86', 'cp37-cp37m'),
# TODO(https://github.com/grpc/grpc/issues/20283)
# Add manylinux2010_x86 targets once this issue is resolved.
PythonArtifact('manylinux1', 'x86', 'cp27-cp27m'),
PythonArtifact('manylinux1', 'x86', 'cp27-cp27mu'),
PythonArtifact('manylinux1', 'x86', 'cp34-cp34m'),
PythonArtifact('manylinux1', 'x86', 'cp35-cp35m'),
PythonArtifact('manylinux1', 'x86', 'cp36-cp36m'),
PythonArtifact('manylinux1', 'x86', 'cp37-cp37m'),
PythonArtifact('linux_extra', 'armv7', '2.7'),
PythonArtifact('linux_extra', 'armv7', '3.4'),
PythonArtifact('linux_extra', 'armv7', '3.5'),
@ -374,12 +379,18 @@ def targets():
PythonArtifact('linux_extra', 'armv6', '3.4'),
PythonArtifact('linux_extra', 'armv6', '3.5'),
PythonArtifact('linux_extra', 'armv6', '3.6'),
PythonArtifact('linux', 'x64', 'cp27-cp27m'),
PythonArtifact('linux', 'x64', 'cp27-cp27mu'),
PythonArtifact('linux', 'x64', 'cp34-cp34m'),
PythonArtifact('linux', 'x64', 'cp35-cp35m'),
PythonArtifact('linux', 'x64', 'cp36-cp36m'),
PythonArtifact('linux', 'x64', 'cp37-cp37m'),
PythonArtifact('manylinux1', 'x64', 'cp27-cp27m'),
PythonArtifact('manylinux1', 'x64', 'cp27-cp27mu'),
PythonArtifact('manylinux1', 'x64', 'cp34-cp34m'),
PythonArtifact('manylinux1', 'x64', 'cp35-cp35m'),
PythonArtifact('manylinux1', 'x64', 'cp36-cp36m'),
PythonArtifact('manylinux1', 'x64', 'cp37-cp37m'),
PythonArtifact('manylinux2010', 'x64', 'cp27-cp27m'),
PythonArtifact('manylinux2010', 'x64', 'cp27-cp27mu'),
PythonArtifact('manylinux2010', 'x64', 'cp34-cp34m'),
PythonArtifact('manylinux2010', 'x64', 'cp35-cp35m'),
PythonArtifact('manylinux2010', 'x64', 'cp36-cp36m'),
PythonArtifact('manylinux2010', 'x64', 'cp37-cp37m'),
PythonArtifact('macos', 'x64', 'python2.7'),
PythonArtifact('macos', 'x64', 'python3.4'),
PythonArtifact('macos', 'x64', 'python3.5'),

@ -79,12 +79,12 @@ ${SETARCH_CMD} "${PYTHON}" tools/distrib/python/grpcio_tools/setup.py bdist_whee
if [ "$GRPC_BUILD_MANYLINUX_WHEEL" != "" ]
then
for wheel in dist/*.whl; do
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep \"manylinux1
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep -E -w 'manylinux(1|2010)_(x86_64|i686)'
"${AUDITWHEEL}" repair "$wheel" -w "$ARTIFACT_DIR"
rm "$wheel"
done
for wheel in tools/distrib/python/grpcio_tools/dist/*.whl; do
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep \"manylinux1
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep -E -w 'manylinux(1|2010)_(x86_64|i686)'
"${AUDITWHEEL}" repair "$wheel" -w "$ARTIFACT_DIR"
rm "$wheel"
done

Loading…
Cancel
Save