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

Enable aarch64 Linux wheel builds, use cibuildwheel action directly #1472

Merged
merged 2 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions .github/install_bazel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if ! bazel version; then
dmah42 marked this conversation as resolved.
Show resolved Hide resolved
arch=$(uname -m)
if [ "$arch" == "aarch64" ]; then
arch="arm64"
fi
echo "Installing wget and downloading $arch Bazel binary from GitHub releases."
yum install -y wget
wget "https://github.com/bazelbuild/bazel/releases/download/5.2.0/bazel-5.2.0-linux-$arch" -O /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel
else
# bazel is installed for the correct architecture
exit 0
fi
22 changes: 9 additions & 13 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,23 @@ jobs:
- name: Check out Google Benchmark
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
python-version: 3.9
platforms: all

- name: Install and run cibuildwheel on ${{ matrix.os }}
- name: Build wheels on ${{ matrix.os }} using cibuildwheel
uses: pypa/cibuildwheel@v2.9.0
env:
CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*'
CIBW_SKIP: "cp37-*-arm64 *-musllinux_*"
# TODO: Build ppc64le, aarch64 using some other trick
CIBW_ARCHS_LINUX: x86_64
# TODO: Build ppc64le using some other trick
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_WINDOWS: AMD64
CIBW_BEFORE_ALL_LINUX: >
curl -O --retry-delay 5 --retry 5 https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo &&
cp vbatts-bazel-epel-7.repo /etc/yum.repos.d/bazel.repo &&
yum install -y bazel4
CIBW_BEFORE_ALL_LINUX: bash .github/install_bazel.sh
CIBW_TEST_COMMAND: python {project}/bindings/python/google_benchmark/example.py
run: |
pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse

- name: Upload Google Benchmark ${{ matrix.os }} wheels
uses: actions/upload-artifact@v3
Expand Down