Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated grpcio c extension build for windows to use mingw. #7012

Merged
merged 1 commit into from
Jun 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions tools/run_tests/build_artifact_python.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ set NUGET=C:\nuget\nuget.exe

mkdir src\python\grpcio\grpc\_cython\_windows

@rem TODO(atash): maybe we could avoid the grpc_c.(32|64).python shim below if
@rem this used the right python build?
copy /Y vsprojects\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\grpc_c.32.python || goto :error
copy /Y vsprojects\x64\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\grpc_c.64.python || goto :error


set PATH=C:\%1;C:\%1\scripts;C:\msys64\mingw%2\bin;%PATH%

pip install --upgrade six
Expand All @@ -50,12 +51,6 @@ pip install -rrequirements.txt
set GRPC_PYTHON_USE_CUSTOM_BDIST=0
set GRPC_PYTHON_BUILD_WITH_CYTHON=1

@rem TODO(atash): maybe we could avoid the grpc_c.(32|64).python shim above if
@rem this used the right python build?
python setup.py bdist_wheel

@rem Build gRPC Python tools
@rem
@rem Because this is windows and *everything seems to hate Windows* we have to
@rem set all of these flags ourselves because Python won't help us (see the
@rem setup.py of the grpcio_tools project).
Expand All @@ -70,6 +65,18 @@ set GRPC_PYTHON_CFLAGS=-fno-wrapv -frtti -std=c++11
python -c "from distutils.cygwinccompiler import get_msvcr; print(get_msvcr()[0])" > temp.txt
set /p PYTHON_MSVCR=<temp.txt
set GRPC_PYTHON_LDFLAGS=-static-libgcc -static-libstdc++ -mcrtdll=%PYTHON_MSVCR% -static -lpthread


@rem Build gRPC
if %2 == 32 (
python setup.py build_ext -c mingw32
) else (
python setup.py build_ext -c mingw32 -DMS_WIN64
)
python setup.py bdist_wheel


@rem Build gRPC Python tools
python tools\distrib\python\make_grpcio_tools.py
if %2 == 32 (
python tools\distrib\python\grpcio_tools\setup.py build_ext -c mingw32
Expand Down