Skip to content

Commit

Permalink
Define the allow pthread atfork macro for gRPC Python MacOS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgribkoff committed Aug 22, 2018
1 parent 46008f0 commit 0ff641a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/python/grpcio/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,17 @@ def build_extensions(self):
os.path.join(target_path, 'libgpr.a'),
os.path.join(target_path, 'libgrpc.a')
]
# Running make separately for Mac means we lose all
# Extension.define_macros configured in setup.py. Re-add the macro
# for gRPC Core's fork handlers.
# TODO(ericgribkoff) Decide what to do about the other missing core
# macros, including GRPC_ENABLE_FORK_SUPPORT, which defaults to 1
# on Linux but remains unset on Mac.
extra_defines = [
'EXTRA_DEFINES="GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1"'
]
make_process = subprocess.Popen(
['make'] + targets,
['make'] + extra_defines + targets,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
make_out, make_err = make_process.communicate()
Expand Down

0 comments on commit 0ff641a

Please sign in to comment.