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

pull/19778/head
Matthew Stevenson 5 years ago
commit 6d7e39ceca
  1. 4
      .gitignore
  2. 8
      Makefile
  3. 2
      build.yaml
  4. 6
      grpc.gyp
  5. 2
      src/python/grpcio/grpc/_cython/_cygrpc/arguments.pxd.pxi
  6. 8
      src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi
  7. 4
      src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi
  8. 1
      src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi
  9. 4
      src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
  10. 1
      src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi
  11. 5
      src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
  12. 1
      src/python/grpcio/grpc/_cython/_cygrpc/tag.pxd.pxi
  13. 5
      src/python/grpcio/grpc/_cython/_cygrpc/tag.pyx.pxi
  14. 5
      src/python/grpcio/grpc/_cython/_cygrpc/vtable.pxd.pxi
  15. 11
      src/python/grpcio/grpc/_cython/_cygrpc/vtable.pyx.pxi
  16. 2
      templates/Makefile.template
  17. 19
      test/build/no-unknown-warning-option.c

4
.gitignore vendored

@ -140,10 +140,6 @@ bm_*.json
# Visual Studio Code artifacts
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# Clion artifacts
cmake-build-debug/

@ -330,6 +330,12 @@ ifeq ($(HAS_WORKING_NO_MAYBE_UNINITIALIZED),true)
W_NO_MAYBE_UNINITIALIZED=-Wno-maybe-uninitialized
NO_W_NO_MAYBE_UNINITIALIZED=-Wmaybe-uninitialized
endif
CHECK_NO_UNKNOWN_WARNING_OPTION_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-unknown-warning-option -o $(TMPOUT) -c test/build/no-unknown-warning-option.c
HAS_WORKING_NO_UNKNOWN_WARNING_OPTION = $(shell $(CHECK_NO_UNKNOWN_WARNING_OPTION_WORKS_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_WORKING_NO_UNKNOWN_WARNING_OPTION),true)
W_NO_UNKNOWN_WARNING_OPTION=-Wno-unknown-warning-option
NO_W_NO_UNKNOWN_WARNING_OPTION=-Wunknown-warning-option
endif
# The HOST compiler settings are used to compile the protoc plugins.
# In most cases, you won't have to change anything, but if you are
@ -348,7 +354,7 @@ CXXFLAGS += -stdlib=libc++
LDFLAGS += -framework CoreFoundation
endif
CXXFLAGS += -Wnon-virtual-dtor
CPPFLAGS += -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated
CPPFLAGS += -g -Wall -Wextra -Werror $(W_NO_UNKNOWN_WARNING_OPTION) -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated
COREFLAGS += -fno-rtti -fno-exceptions
LDFLAGS += -g

@ -6204,7 +6204,7 @@ defaults:
CXXFLAGS: $(W_NO_CXX14_COMPAT)
global:
COREFLAGS: -fno-rtti -fno-exceptions
CPPFLAGS: -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long
CPPFLAGS: -g -Wall -Wextra -Werror $(W_NO_UNKNOWN_WARNING_OPTION) -Wno-long-long
-Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow
-Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers
-Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb

@ -55,7 +55,7 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'$(W_NO_UNKNOWN_WARNING_OPTION)',
'-Wno-long-long',
'-Wno-unused-parameter',
'-Wno-deprecated-declarations',
@ -146,7 +146,7 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'$(W_NO_UNKNOWN_WARNING_OPTION)',
'-Wno-long-long',
'-Wno-unused-parameter',
'-Wno-deprecated-declarations',
@ -168,7 +168,7 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'$(W_NO_UNKNOWN_WARNING_OPTION)',
'-Wno-long-long',
'-Wno-unused-parameter',
'-Wno-deprecated-declarations',

@ -23,7 +23,7 @@ cdef class _ChannelArg:
cdef grpc_arg c_argument
cdef void c(self, argument, _VTable vtable, references) except *
cdef void c(self, argument, references) except *
cdef class _ChannelArgs:

@ -33,7 +33,7 @@ cdef grpc_arg _unwrap_grpc_arg(tuple wrapped_arg):
cdef class _ChannelArg:
cdef void c(self, argument, _VTable vtable, references) except *:
cdef void c(self, argument, references) except *:
key, value = argument
cdef bytes encoded_key = _encode(key)
if encoded_key is not key:
@ -56,7 +56,7 @@ cdef class _ChannelArg:
# lifecycle of the pointer is fixed to the lifecycle of the
# python object wrapping it.
self.c_argument.type = GRPC_ARG_POINTER
self.c_argument.value.pointer.vtable = &vtable.c_vtable
self.c_argument.value.pointer.vtable = &default_vtable
self.c_argument.value.pointer.address = <void*>(<intptr_t>int(value))
else:
raise TypeError(
@ -65,7 +65,7 @@ cdef class _ChannelArg:
cdef class _ChannelArgs:
def __cinit__(self, arguments, _VTable vtable not None):
def __cinit__(self, arguments):
self._arguments = () if arguments is None else tuple(arguments)
self._channel_args = []
self._references = []
@ -75,7 +75,7 @@ cdef class _ChannelArgs:
self._c_arguments.arguments_length * sizeof(grpc_arg))
for index, argument in enumerate(self._arguments):
channel_arg = _ChannelArg()
channel_arg.c(argument, vtable, self._references)
channel_arg.c(argument, self._references)
self._c_arguments.arguments[index] = channel_arg.c_argument
self._channel_args.append(channel_arg)

@ -17,11 +17,11 @@ cimport cpython
cdef class Call:
def __cinit__(self, _VTable vtable not None):
def __cinit__(self):
# Create an *empty* call
fork_handlers_and_grpc_init()
self.c_call = NULL
self.references = [vtable]
self.references = []
def _start_batch(self, operations, tag, retain_self):
if not self.is_valid:

@ -69,7 +69,6 @@ cdef class SegregatedCall:
cdef class Channel:
cdef _ChannelState _state
cdef _VTable _vtable
# TODO(https://github.com/grpc/grpc/issues/15662): Eliminate this.
cdef tuple _arguments

@ -455,9 +455,7 @@ cdef class Channel:
self._state.c_connectivity_completion_queue = (
grpc_completion_queue_create_for_next(NULL))
self._arguments = arguments
self._vtable = _VTable()
cdef _ChannelArgs channel_args = _ChannelArgs(
arguments, self._vtable)
cdef _ChannelArgs channel_args = _ChannelArgs(arguments)
if channel_credentials is None:
self._state.c_channel = grpc_insecure_channel_create(
<char *>target, channel_args.c_args(), NULL)

@ -16,7 +16,6 @@ cdef class Server:
cdef grpc_server *c_server
cdef _VTable _vtable
cdef bint is_started # start has been called
cdef bint is_shutting_down # shutdown has been called
cdef bint is_shutdown # notification of complete shutdown received

@ -31,8 +31,7 @@ cdef class Server:
self.is_shutting_down = False
self.is_shutdown = False
self.c_server = NULL
self._vtable = _VTable()
cdef _ChannelArgs channel_args = _ChannelArgs(arguments, self._vtable)
cdef _ChannelArgs channel_args = _ChannelArgs(arguments)
self.c_server = grpc_server_create(channel_args.c_args(), NULL)
self.references.append(arguments)
@ -43,7 +42,7 @@ cdef class Server:
raise ValueError("server must be started and not shutting down")
if server_queue not in self.registered_completion_queues:
raise ValueError("server_queue must be a registered completion queue")
cdef _RequestCallTag request_call_tag = _RequestCallTag(tag, self._vtable)
cdef _RequestCallTag request_call_tag = _RequestCallTag(tag)
request_call_tag.prepare()
cpython.Py_INCREF(request_call_tag)
return grpc_server_request_call(

@ -29,7 +29,6 @@ cdef class _RequestCallTag(_Tag):
cdef readonly object _user_tag
cdef Call call
cdef _VTable _vtable
cdef CallDetails call_details
cdef grpc_metadata_array c_invocation_metadata

@ -30,14 +30,13 @@ cdef class _ConnectivityTag(_Tag):
cdef class _RequestCallTag(_Tag):
def __cinit__(self, user_tag, _VTable vtable not None):
def __cinit__(self, user_tag):
self._user_tag = user_tag
self.call = None
self.call_details = None
self._vtable = vtable
cdef void prepare(self) except *:
self.call = Call(self._vtable)
self.call = Call()
self.call_details = CallDetails()
grpc_metadata_array_init(&self.c_invocation_metadata)

@ -15,12 +15,9 @@
cdef void* _copy_pointer(void* pointer)
cdef void _destroy_pointer(void* pointer)
cdef int _compare_pointer(void* first_pointer, void* second_pointer)
cdef class _VTable:
cdef grpc_arg_pointer_vtable c_vtable
cdef grpc_arg_pointer_vtable default_vtable

@ -30,10 +30,7 @@ cdef int _compare_pointer(void* first_pointer, void* second_pointer):
else:
return 0
cdef class _VTable:
def __cinit__(self):
self.c_vtable.copy = &_copy_pointer
self.c_vtable.destroy = &_destroy_pointer
self.c_vtable.cmp = &_compare_pointer
cdef grpc_arg_pointer_vtable default_vtable
default_vtable.copy = &_copy_pointer
default_vtable.destroy = &_destroy_pointer
default_vtable.cmp = &_compare_pointer

@ -37,7 +37,7 @@
# warnings we'd like, but that dont exist in all compilers
PREFERRED_WARNINGS=['extra-semi']
CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable', 'no-maybe-uninitialized']
CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable', 'no-maybe-uninitialized', 'no-unknown-warning-option']
def warning_var(fmt, warning):
return fmt % warning.replace('-', '_').replace('+', 'X').upper()

@ -0,0 +1,19 @@
/*
*
* Copyright 2015 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.
*
*/
int main(void) {}
Loading…
Cancel
Save