-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-10658: [Python][Packaging] Wheel builds for Apple Silicon #10659
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
Closed
Closed
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
c0b0950
m1
db51c6e
e
4466493
produce working wheels
d203560
Cleanup
f2a01cc
Install python script
kszucs 778c9e6
Remove multibuild dependency
kszucs daf6ec4
vcpkg version
kszucs e0487b7
sudo install python and default simd level
kszucs 659e3c5
change order
kszucs bdac009
fix platform tag
kszucs 30500cf
fix platform tag
kszucs 476f135
crossbow conf
kszucs 332f5e6
crossbow conf
kszucs 668e9d1
crossbow conf
kszucs c2514c3
crossbow conf
kszucs 0b22e1f
crossbow conf
kszucs b2ade21
crossbow conf
kszucs 5ca4bf9
crossbow conf
kszucs a7ac3e8
crossbow conf
kszucs 8ed4511
crossbow conf
kszucs 244eb28
crossbow conf
kszucs 200bb84
crossbow conf
kszucs 0a9a3fb
crossbow conf
kszucs 14f9100
arch emulation
kszucs f56b34c
arch emulation
kszucs ce418c9
arch emulation
kszucs f7d2939
arch emulation
kszucs 14b75af
arch emulation
kszucs 042da1a
arch emulation
kszucs 6d94a5d
arch emulation
kszucs caa141a
arch emulation
kszucs 2fd9660
arch emulation
kszucs 57be580
cleanup
kszucs 65efea3
pin newer numpy
kszucs 63c2c92
fix requirements conditions
kszucs d592fcc
fix requirements conditions
kszucs 0487d29
fix requirements conditions
kszucs 47a4b79
artifact upload
kszucs 92789dd
reduce crossbow deps
kszucs b3ebdb4
templating
kszucs e369d49
cleanup
kszucs 8e5f156
remove unused scripts
kszucs f70e6b3
cmake format
kszucs 397b801
req files
kszucs 4b326fc
experiment with universal2
kszucs 34f40d0
fix requirements syntax
kszucs 4b3d740
experiment with universal2
kszucs 2e998d1
universal2 triplet for vcpkg
kszucs 8e1588b
universal2 triplet for vcpkg
kszucs 83db19a
universal2 triplet for vcpkg
kszucs f27245e
universal2 triplet for vcpkg
kszucs 8a2ef81
universal2 triplet for vcpkg
kszucs a9bd4f8
prefer universal2 numpy wheels
kszucs 4400459
universal2 platform tag
kszucs d38f62a
universal2 platform tag
kszucs 15dd7e7
universal2 platform tag
kszucs 95a83c4
universal2 platform tag
kszucs fcc25ff
cleanup
kszucs d04c202
install vcpkg with the latest deployment target
kszucs eb3dd85
limit cache scope
kszucs fdc8d87
temporarily push manylinux images
kszucs ec30559
fix build requirements file
kszucs 11d7df5
fix test requirements
kszucs 8bdb02f
fix build requirements file
kszucs 4eb6d2a
manually pack universal2 binary for libcrypto and libssl
kszucs 6c7f44a
redundant env variable
kszucs 00fc488
fix vcpkg build in the windows image
kszucs ce2562e
revert snappy alt
kszucs d5e4921
final touches
kszucs 893208a
restore branch condition in the crossbow templates
kszucs d29f104
don't pull cache_from images if --no-pull is passed
kszucs bb3b170
update delocate-listdeps regex pattern due to recent delocate release
kszucs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set -eu | ||
|
|
||
| declare -A platforms | ||
| platforms=([windows]=Windows | ||
| [macos]=MacOSX | ||
| [linux]=Linux) | ||
|
|
||
| declare -A versions | ||
| versions=([3.6]=3.6.8 | ||
| [3.7]=3.7.9 | ||
| [3.8]=3.8.9 | ||
| [3.9]=3.9.6) | ||
|
|
||
| if [ "$#" -ne 2 ]; then | ||
| echo "Usage: $0 <platform> <version>" | ||
| exit 1 | ||
| elif [[ -z ${platforms[$1]} ]]; then | ||
| echo "Unexpected platform: ${1}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| platform=${platforms[$1]} | ||
| version=$2 | ||
| full_version=${versions[$2]} | ||
|
|
||
| if [ $platform = "MacOSX" ]; then | ||
| echo "Downloading Python installer..." | ||
| if [ "$(uname -m)" = "arm64" ]; then | ||
| fname="python-${full_version}-macos11.pkg" | ||
| else | ||
| fname="python-${full_version}-macosx10.9.pkg" | ||
| fi | ||
| wget "https://www.python.org/ftp/python/${full_version}/${fname}" | ||
|
|
||
| echo "Installing Python..." | ||
| installer -pkg $fname -target / | ||
| rm $fname | ||
|
|
||
| echo "Installing Pip..." | ||
| python="/Library/Frameworks/Python.framework/Versions/${version}/bin/python${version}" | ||
| pip="${python} -m pip" | ||
|
|
||
| $python -m ensurepip | ||
| $pip install -U pip setuptools virtualenv | ||
| else | ||
| echo "Unsupported platform: $platform" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,9 @@ | |
|
|
||
| set -ex | ||
|
|
||
| source_dir=${1} | ||
| build_dir=${2} | ||
| arch=${1} | ||
| source_dir=${2} | ||
| build_dir=${3} | ||
|
|
||
| echo "=== (${PYTHON_VERSION}) Clear output directories and leftovers ===" | ||
| # Clear output directories and leftovers | ||
|
|
@@ -31,11 +32,32 @@ rm -rf ${source_dir}/python/repaired_wheels | |
| rm -rf ${source_dir}/python/pyarrow/*.so | ||
| rm -rf ${source_dir}/python/pyarrow/*.so.* | ||
|
|
||
| echo "=== (${PYTHON_VERSION}) Set OSX SDK and C flags ===" | ||
| # Arrow is 64-bit-only at the moment | ||
| export CFLAGS="-fPIC -arch x86_64 ${CFLAGS//-arch i386/}" | ||
| export CXXFLAGS="-fPIC -arch x86_64 ${CXXFLAGS//-arch i386} -std=c++11" | ||
| export SDKROOT="$(xcrun --show-sdk-path)" | ||
| echo "=== (${PYTHON_VERSION}) Set SDK, C++ and Wheel flags ===" | ||
| export _PYTHON_HOST_PLATFORM="macosx-${MACOSX_DEPLOYMENT_TARGET}-${arch}" | ||
| export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-10.9} | ||
| export SDKROOT=${SDKROOT:-$(xcrun --sdk macosx --show-sdk-path)} | ||
|
|
||
| if [ $arch = "arm64" ]; then | ||
| export CMAKE_OSX_ARCHITECTURES="arm64" | ||
| elif [ $arch = "x86_64" ]; then | ||
| export CMAKE_OSX_ARCHITECTURES="x86_64" | ||
| elif [ $arch = "universal2" ]; then | ||
| export CMAKE_OSX_ARCHITECTURES="x86_64;arm64" | ||
| else | ||
| echo "Unexpected architecture: $arch" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "=== (${PYTHON_VERSION}) Install Python build dependencies ===" | ||
| export PIP_SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])') | ||
| export PIP_TARGET_PLATFORM="macosx_${MACOSX_DEPLOYMENT_TARGET//./_}_${arch}" | ||
|
|
||
| pip install \ | ||
| --only-binary=:all: \ | ||
| --target $PIP_SITE_PACKAGES \ | ||
| --platform $PIP_TARGET_PLATFORM \ | ||
| -r ${source_dir}/python/requirements-wheel-build.txt | ||
| pip install "delocate>=0.9" | ||
|
|
||
| echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" | ||
| : ${ARROW_DATASET:=ON} | ||
|
|
@@ -48,6 +70,7 @@ echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" | |
| : ${ARROW_PARQUET:=ON} | ||
| : ${ARROW_PLASMA:=ON} | ||
| : ${ARROW_S3:=ON} | ||
| : ${ARROW_SIMD_LEVEL:="SSE4_2"} | ||
| : ${ARROW_TENSORFLOW:=ON} | ||
| : ${ARROW_WITH_BROTLI:=ON} | ||
| : ${ARROW_WITH_BZ2:=ON} | ||
|
|
@@ -57,19 +80,23 @@ echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" | |
| : ${ARROW_WITH_ZSTD:=ON} | ||
| : ${CMAKE_BUILD_TYPE:=release} | ||
| : ${CMAKE_GENERATOR:=Ninja} | ||
| : ${CMAKE_UNITY_BUILD:=ON} | ||
| : ${VCPKG_FEATURE_FLAGS:=-manifests} | ||
| : ${VCPKG_TARGET_TRIPLET:=${VCPKG_DEFAULT_TRIPLET:-x64-osx-static-${CMAKE_BUILD_TYPE}}} | ||
|
|
||
| mkdir -p ${build_dir}/build | ||
| pushd ${build_dir}/build | ||
|
|
||
| cmake \ | ||
| -DARROW_BUILD_SHARED=ON \ | ||
| -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 \ | ||
| -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} \ | ||
| -DARROW_BUILD_STATIC=OFF \ | ||
| -DARROW_BUILD_TESTS=OFF \ | ||
| -DARROW_DATASET=${ARROW_DATASET} \ | ||
| -DARROW_DEPENDENCY_SOURCE="VCPKG" \ | ||
| -DARROW_DEPENDENCY_USE_SHARED=OFF \ | ||
| -DARROW_FLIGHT==${ARROW_FLIGHT} \ | ||
| -DARROW_FLIGHT=${ARROW_FLIGHT} \ | ||
|
||
| -DARROW_GANDIVA=${ARROW_GANDIVA} \ | ||
| -DARROW_HDFS=${ARROW_HDFS} \ | ||
| -DARROW_JEMALLOC=${ARROW_JEMALLOC} \ | ||
|
|
@@ -81,6 +108,7 @@ cmake \ | |
| -DARROW_PYTHON=ON \ | ||
| -DARROW_RPATH_ORIGIN=ON \ | ||
| -DARROW_S3=${ARROW_S3} \ | ||
| -DARROW_SIMD_LEVEL=${ARROW_SIMD_LEVEL} \ | ||
| -DARROW_TENSORFLOW=${ARROW_TENSORFLOW} \ | ||
| -DARROW_USE_CCACHE=ON \ | ||
| -DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI} \ | ||
|
|
@@ -92,7 +120,7 @@ cmake \ | |
| -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ | ||
| -DCMAKE_INSTALL_LIBDIR=lib \ | ||
| -DCMAKE_INSTALL_PREFIX=${build_dir}/install \ | ||
| -DCMAKE_UNITY_BUILD=ON \ | ||
| -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} \ | ||
| -DOPENSSL_USE_STATIC_LIBS=ON \ | ||
| -DVCPKG_MANIFEST_MODE=OFF \ | ||
| -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \ | ||
|
|
@@ -101,9 +129,6 @@ cmake \ | |
| cmake --build . --target install | ||
| popd | ||
|
|
||
| # Check that we don't expose any unwanted symbols | ||
| # check_arrow_visibility | ||
|
|
||
| echo "=== (${PYTHON_VERSION}) Building wheel ===" | ||
| export PYARROW_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
| export PYARROW_BUNDLE_ARROW_CPP=1 | ||
|
|
@@ -117,8 +142,11 @@ export PYARROW_WITH_ORC=${ARROW_ORC} | |
| export PYARROW_WITH_PARQUET=${ARROW_PARQUET} | ||
| export PYARROW_WITH_PLASMA=${ARROW_PLASMA} | ||
| export PYARROW_WITH_S3=${ARROW_S3} | ||
| export PYARROW_CMAKE_OPTIONS="-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DARROW_SIMD_LEVEL=${ARROW_SIMD_LEVEL}" | ||
| # PyArrow build configuration | ||
| export PKG_CONFIG_PATH=/usr/lib/pkgconfig:${build_dir}/install/lib/pkgconfig | ||
| # Set PyArrow version explicitly | ||
| export SETUPTOOLS_SCM_PRETEND_VERSION=${PYARROW_VERSION} | ||
|
|
||
| pushd ${source_dir}/python | ||
| python setup.py bdist_wheel | ||
|
|
@@ -127,7 +155,7 @@ popd | |
| echo "=== (${PYTHON_VERSION}) Show dynamic libraries the wheel depend on ===" | ||
| deps=$(delocate-listdeps ${source_dir}/python/dist/*.whl) | ||
|
|
||
| if echo $deps | grep -v "^@rpath/lib\(arrow\|gandiva\|parquet\|plasma\)"; then | ||
| if echo $deps | grep -v "^pyarrow/lib\(arrow\|gandiva\|parquet\|plasma\)"; then | ||
| echo "There are non-bundled shared library dependencies." | ||
| exit 1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set(VCPKG_TARGET_ARCHITECTURE arm64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
| set(VCPKG_OSX_ARCHITECTURES arm64) | ||
|
|
||
| set(VCPKG_BUILD_TYPE debug) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set(VCPKG_TARGET_ARCHITECTURE arm64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
| set(VCPKG_OSX_ARCHITECTURES arm64) | ||
|
|
||
| set(VCPKG_BUILD_TYPE release) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set(VCPKG_TARGET_ARCHITECTURE arm64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
| set(VCPKG_OSX_ARCHITECTURES "x86_64\;arm64") | ||
|
|
||
| set(VCPKG_BUILD_TYPE debug) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set(VCPKG_TARGET_ARCHITECTURE arm64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
| set(VCPKG_OSX_ARCHITECTURES "x86_64\;arm64") | ||
|
|
||
| set(VCPKG_BUILD_TYPE release) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there is no universal2 installers for python < 3.9