Skip to content

Commit fe42499

Browse files
committed
[Python][Packaging] Set MACOSX_DEPLOYMENT_TARGET default before building wheel platform tag
In ci/scripts/python_wheel_macos_build.sh the wheel platform tag _PYTHON_HOST_PLATFORM was assembled from MACOSX_DEPLOYMENT_TARGET one line before that variable's :-12.0 default was applied. When the script runs without MACOSX_DEPLOYMENT_TARGET already exported (for example a manual or local macOS build), the interpolation yields a malformed tag with an empty version component (macosx--<arch>), while the C++ libraries and the wheel are actually built for 12.0. That produces an inconsistent, invalid platform tag on the built wheel. Swap the two lines so the default is set first and the platform tag is derived from the resolved value. When MACOSX_DEPLOYMENT_TARGET is already set (as in the packaging CI, which exports it as a top-level env var), the output is unchanged, so there is no behavior change for existing jobs. Verified the two lines in isolation with the variable unset: before the change _PYTHON_HOST_PLATFORM=macosx--x86_64, after the change macosx-12.0-x86_64. The full macOS wheel build was not run (no Arrow C++ toolchain available locally).
1 parent 6378639 commit fe42499

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ci/scripts/python_wheel_macos_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ rm -rf ${source_dir}/python/pyarrow/*.so
3333
rm -rf ${source_dir}/python/pyarrow/*.so.*
3434

3535
echo "=== (${PYTHON_VERSION}) Set SDK, C++ and Wheel flags ==="
36-
export _PYTHON_HOST_PLATFORM="macosx-${MACOSX_DEPLOYMENT_TARGET}-${arch}"
3736
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-12.0}
37+
export _PYTHON_HOST_PLATFORM="macosx-${MACOSX_DEPLOYMENT_TARGET}-${arch}"
3838
export SDKROOT=${SDKROOT:-$(xcrun --sdk macosx --show-sdk-path)}
3939

4040
if [ $arch = "arm64" ]; then

0 commit comments

Comments
 (0)