-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build wheels for more platforms (#50)
Enable i686 and aarch64 builds for Linux, and universal2 builds for macOS. Caught a couple portability problems in the process. I made a mighty effort trying to get musl and Windows working along the way but failed; musl is broken because of a bad interaction with cgo and is probably beyond fixing short of patching the Go compiler. Windows is suffering from what looks like garden-variety linker errors and is probably salvagable, but I probably need someone who knows more about building wheels on Windows to explain what I've done wrong before I'll be able to fix it.
- Loading branch information
Showing
7 changed files
with
78 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -10,59 +10,57 @@ jobs: | |
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
#os: [ubuntu-latest, windows-latest, macos-latest] | ||
# Windows isn't working right now: https://github.com/caketop/python-starlark-go/issues/4 | ||
# os: [ubuntu-latest, windows-latest, macos-latest] | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: '3.10' | ||
- uses: actions/setup-go@v2 | ||
if: runner.os != 'Linux' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade -r development.txt | ||
python -m pip install cibuildwheel==2.4.0 | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/[email protected] | ||
|
||
- name: Install Visual C++ for Python 2.7 | ||
if: runner.os == 'Windows' | ||
- name: Build sdist | ||
if: runner.os == 'Linux' | ||
run: | | ||
choco install vcpython27 -f -y | ||
choco install golang -f -y | ||
choco install mingw -f -y | ||
python setup.py sdist | ||
- name: Build Linux wheels and sdist | ||
- name: Build Linux wheels | ||
if: runner.os == 'Linux' | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BEFORE_ALL: 'pwd && ls && chmod +x ./scripts/setup-linux.sh && ./scripts/setup-linux.sh' | ||
CIBW_BEFORE_ALL: 'sh ./scripts/install-go.sh' | ||
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* | ||
CIBW_SKIP: "cp35-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x *-musllinux_*" | ||
run: | | ||
python setup.py sdist | ||
python3 -m cibuildwheel --output-dir wheelhouse | ||
CIBW_SKIP: "*-musllinux_*" | ||
CIBW_ARCHS: x86_64 i686 aarch64 | ||
|
||
- name: Build macOS wheels | ||
if: runner.os == 'macOS' | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BEFORE_ALL: 'pwd && ls && chmod +x ./scripts/setup-macos.sh && ./scripts/setup-macos.sh' | ||
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* | ||
CIBW_SKIP: "cp35-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x *-musllinux_*" | ||
run: | | ||
python3 -m cibuildwheel --output-dir wheelhouse | ||
CIBW_ARCHS: x86_64 universal2 | ||
|
||
- name: Build Windows wheels | ||
if: runner.os == 'Windows' | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* | ||
CIBW_SKIP: "cp35-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x *-musllinux_*" | ||
run: | | ||
go version | ||
python -m cibuildwheel --output-dir wheelhouse | ||
CIBW_BUILD: cp38-* cp39-* cp310-* | ||
CIBW_SKIP: cp37-* | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: | | ||
./wheelhouse/*.whl | ||
./dist/*.tar.gz | ||
# - name: Publish sdist | ||
# if: runner.os == 'Linux' | ||
|
@@ -73,11 +71,6 @@ jobs: | |
# twine check ./dist/*.tar.gz | ||
# twine upload --skip-existing ./dist/* | ||
|
||
# - uses: actions/upload-artifact@v2 | ||
# with: | ||
# path: | | ||
# ./wheelhouse/*.whl | ||
# ./dist/*.tar.gz | ||
|
||
# - name: Publish wheels | ||
# env: | ||
|
This file contains 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 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 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,40 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
GO_VERSION=1.18.1 | ||
|
||
if [ -e /etc/alpine-release ] && [ -z "$BASH_VERSION" ]; then | ||
apk add bash curl git go | ||
exit 0 | ||
fi | ||
|
||
if [ -z "$BASH_VERSION" ]; then | ||
exec bash "$0" | ||
fi | ||
|
||
set -eou pipefail | ||
|
||
if [ -e /etc/debian_version ]; then | ||
apt-get update | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y curl git | ||
fi | ||
|
||
install_go() { | ||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.0 | ||
|
||
# shellcheck disable=SC1090 | ||
. ~/.asdf/asdf.sh | ||
|
||
asdf plugin add golang | ||
asdf install golang "$GO_VERSION" | ||
|
||
ln -s ~/.asdf/installs/golang/${GO_VERSION}/go/bin/go /usr/local/bin/go | ||
ln -s ~/.asdf/installs/golang/${GO_VERSION}/go/bin/gofmt /usr/local/bin/gofmt | ||
} | ||
|
||
(install_go) | ||
|
||
go version | ||
|
||
env | sort |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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