Skip to content

Commit

Permalink
apacheGH-45278: [Python][Packaging] Updated delvewheel install comman…
Browse files Browse the repository at this point in the history
…d and updated flags used with delvewheel repair (apache#45323)

### Rationale for this change

It is already explained in the issue.

### What changes are included in this PR?

This PR installs delvewheel by using its latest version instead of using a github branch. The new flag `--with-mangle` introduced in the latest version of delvewheel is used with `delvewheel repair` command. Removed comments that referred to the use of the github branch for delvewheel installation.

### Are these changes tested?

No, these changes are not tested because to run Windows containers I will need [Windows 11 Pro or Enterprise](https://docs.docker.com/desktop/setup/install/windows-install/#:~:text=To%20run%20Windows%20containers%2C%20you%20need%20Windows%2010%20or%20Windows%2011%20Professional%20or%20Enterprise%20edition.%20Windows%20Home%20or%20Education%20editions%20only%20allow%20you%20to%20run%20Linux%20containers.). I do not have a machine that satisfies this requirement. 

* GitHub Issue: apache#45278

Authored-by: anubhav <anubhavkoul01@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
  • Loading branch information
protokoul authored and lriggs committed Jan 30, 2025
1 parent 5d1d576 commit cd51eb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ci/scripts/python_wheel_validate_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def validate_wheel(path):
f = zipfile.ZipFile(wheels[0])
outliers = [
info.filename for info in f.filelist if not re.match(
r'(pyarrow/|pyarrow-[-.\w\d]+\.dist-info/)', info.filename
r'(pyarrow/|pyarrow-[-.\w\d]+\.dist-info/|pyarrow\.libs/)', info.filename
)
]
assert not outliers, f"Unexpected contents in wheel: {sorted(outliers)}"
Expand Down
15 changes: 2 additions & 13 deletions ci/scripts/python_wheel_windows_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ py -0p
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
@echo on

@REM Install a more recent msvcp140.dll in C:\Windows\System32
choco install -r -y --no-progress vcredist140
choco upgrade -r -y --no-progress vcredist140
dir C:\Windows\System32\msvcp140.dll

echo "=== (%PYTHON%) Clear output directories and leftovers ==="
del /s /q C:\arrow-build
del /s /q C:\arrow-dist
Expand Down Expand Up @@ -133,9 +128,6 @@ set CMAKE_PREFIX_PATH=C:\arrow-dist

pushd C:\arrow\python

@REM Bundle the C++ runtime
cp C:\Windows\System32\msvcp140.dll pyarrow\

@REM Build wheel
%PYTHON_CMD% setup.py bdist_wheel || exit /B 1

Expand All @@ -144,16 +136,13 @@ cp C:\Windows\System32\msvcp140.dll pyarrow\
@REM Since we bundled the Arrow C++ libraries ourselves, we only need to
@REM mangle msvcp140.dll so as to avoid ABI issues when msvcp140.dll is
@REM required by multiple Python libraries in the same process.
@REM
@REM For now this requires a custom version of delvewheel:
@REM https://github.com/adang1345/delvewheel/pull/59
%PYTHON_CMD% -m pip install https://github.com/pitrou/delvewheel/archive/refs/heads/fixes-for-arrow.zip || exit /B 1
%PYTHON_CMD% -m pip install delvewheel || exit /B 1

for /f %%i in ('dir dist\pyarrow-*.whl /B') do (set WHEEL_NAME=%cd%\dist\%%i) || exit /B 1
echo "Wheel name: %WHEEL_NAME%"

%PYTHON_CMD% -m delvewheel repair -vv ^
--mangle-only=msvcp140.dll --no-patch ^
--ignore-existing --with-mangle ^
-w repaired_wheels %WHEEL_NAME% || exit /B 1

popd

0 comments on commit cd51eb4

Please sign in to comment.