|
20 | 20 | echo "Building windows wheel..."
|
21 | 21 |
|
22 | 22 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
| 23 | +@echo on |
| 24 | + |
| 25 | +@REM Install a more recent msvcp140.dll in C:\Windows\System32 |
| 26 | +choco install -r -y --no-progress vcredist140 |
| 27 | +choco upgrade -r -y --no-progress vcredist140 |
| 28 | +dir C:\Windows\System32\msvcp140.dll |
23 | 29 |
|
24 | 30 | echo "=== (%PYTHON_VERSION%) Clear output directories and leftovers ==="
|
25 | 31 | del /s /q C:\arrow-build
|
@@ -121,7 +127,27 @@ set ARROW_HOME=C:\arrow-dist
|
121 | 127 | set CMAKE_PREFIX_PATH=C:\arrow-dist
|
122 | 128 |
|
123 | 129 | pushd C:\arrow\python
|
124 |
| -@REM bundle the msvc runtime |
125 |
| -cp "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29325\x64\Microsoft.VC142.CRT\msvcp140.dll" pyarrow\ |
| 130 | + |
| 131 | +@REM Bundle the C++ runtime |
| 132 | +cp C:\Windows\System32\msvcp140.dll pyarrow\ |
| 133 | + |
| 134 | +@REM Build wheel |
126 | 135 | python setup.py bdist_wheel || exit /B 1
|
| 136 | + |
| 137 | +@REM Repair the wheel with delvewheel |
| 138 | +@REM |
| 139 | +@REM Since we bundled the Arrow C++ libraries ourselves, we only need to |
| 140 | +@REM mangle msvcp140.dll so as to avoid ABI issues when msvcp140.dll is |
| 141 | +@REM required by multiple Python libraries in the same process. |
| 142 | +@REM |
| 143 | +@REM For now this requires a custom version of delvewheel: |
| 144 | +@REM https://github.com/adang1345/delvewheel/pull/59 |
| 145 | +pip install https://github.com/pitrou/delvewheel/archive/refs/heads/fixes-for-arrow.zip || exit /B 1 |
| 146 | + |
| 147 | +for /f %%i in ('dir dist\pyarrow-*.whl /B') do (set WHEEL_NAME=%cd%\dist\%%i) || exit /B 1 |
| 148 | +echo "Wheel name: %WHEEL_NAME%" |
| 149 | + |
| 150 | +delvewheel repair -vv --mangle-only=msvcp140.dll --no-patch ^ |
| 151 | + -w repaired_wheels %WHEEL_NAME% || exit /B 1 |
| 152 | + |
127 | 153 | popd
|
0 commit comments