diff --git a/src/python/grpcio/_spawn_patch.py b/src/python/grpcio/_spawn_patch.py index 377cc7a9f37..421c7dfee83 100644 --- a/src/python/grpcio/_spawn_patch.py +++ b/src/python/grpcio/_spawn_patch.py @@ -44,7 +44,10 @@ def _commandfile_spawn(self, command): escaped_args = [ '"' + arg.replace('\\', '\\\\') + '"' for arg in command[1:] ] - command_file.write(' '.join(escaped_args)) + # add each arg on a separate line to avoid hitting the + # "line in command file contains 131071 or more characters" error + # (can happen for extra long link commands) + command_file.write(' \n'.join(escaped_args)) modified_command = command[:1] + ['@{}'.format(command_filename)] try: _classic_spawn(self, modified_command) diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/main.cc b/tools/distrib/python/grpcio_tools/grpc_tools/main.cc index 12b40e8ab4a..d49edd323a9 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/main.cc +++ b/tools/distrib/python/grpcio_tools/grpc_tools/main.cc @@ -24,8 +24,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index bf09c0ae922..0b5dc69591f 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -203,7 +203,11 @@ GRPC_PYTHON_PROTO_RESOURCES_NAME = '_proto' DEFINE_MACROS = () if "win32" in sys.platform: - DEFINE_MACROS += (('WIN32_LEAN_AND_MEAN', 1),) + DEFINE_MACROS += ( + ('WIN32_LEAN_AND_MEAN', 1), + # avoid https://github.com/abseil/abseil-cpp/issues/1425 + ('NOMINMAX', 1), + ) if '64bit' in platform.architecture()[0]: DEFINE_MACROS += (('MS_WIN64', 1),) elif "linux" in sys.platform or "darwin" in sys.platform: