-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Python bindings: Use ABI3 wheels #2223
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
Open
Antelox
wants to merge
7
commits into
unicorn-engine:dev
Choose a base branch
from
Antelox:bindings/python
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e7e958e
Python bindings:
Antelox 5b9b81c
more memory
wtdcode f491759
revert to previous value
wtdcode 6b824b5
Smaller tcg buffer size for this test
wtdcode 1388158
Migrate the action
ReenigneArcher 79d76a9
Add concurrency control
wtdcode 41db67f
reduce because 32bit process may run-out-of virtual addresses
wtdcode 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
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 |
---|---|---|
|
@@ -11,14 +11,6 @@ on: | |
options: | ||
- '0' | ||
- '1' | ||
fullMode: | ||
description: 'Full Mode' | ||
required: false | ||
default: '' | ||
type: choice | ||
options: | ||
- '0' | ||
- '1' | ||
push: | ||
paths-ignore: | ||
- ".gitignore" | ||
|
@@ -32,13 +24,17 @@ on: | |
- "docs/**" | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Enable DEBUG flag either according to the tag release or manual override | ||
UNICORN_DEBUG: ${{ inputs.debugMode != '' && inputs.debugMode || (startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v')) && '0' || contains(github.event.head_commit.message, 'CI(release)') && '0' || '1' }} | ||
|
||
jobs: | ||
# job to be executed for every push - testing purpose | ||
build_wheels_python38_only: | ||
build_and_test_wheels: | ||
name: Building on ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.cibw_build }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
|
@@ -47,21 +43,21 @@ jobs: | |
include: | ||
# NOTE: Doing this to parallelize and speed up workflow | ||
# i686 - manylinux | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp38-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp*-manylinux*', cibw_skip: 'cp36*' } | ||
# i686 - musllinux | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp38-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp*-musllinux*', cibw_skip: 'cp36*' } | ||
# x86_64 - manylinux | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp38-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp*-manylinux*', cibw_skip: 'cp36*' } | ||
# x86_64 - musllinux | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp38-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp*-musllinux*', cibw_skip: 'cp36*' } | ||
# aarch64 - manylinux | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp38-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp*-manylinux*', cibw_skip: 'cp36*' } | ||
# aarch64 - musllinux | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp38-musllinux*', cibw_skip: '' } | ||
- { os: macos-13, arch: x86_64, cibw_build: 'cp38*', cibw_skip: '' } | ||
- { os: macos-latest, arch: arm64, cibw_build: 'cp38*', cibw_skip: '' } | ||
- { os: windows-2022, arch: AMD64, cibw_build: 'cp38*', cibw_skip: '' } | ||
- { os: windows-2022, arch: x86, cibw_build: 'cp38*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp*-musllinux*', cibw_skip: 'cp36*' } | ||
- { os: macos-13, arch: x86_64, cibw_build: 'cp*', cibw_skip: 'cp36*' } | ||
- { os: macos-latest, arch: arm64, cibw_build: 'cp*', cibw_skip: 'cp36* cp37*' } | ||
- { os: windows-2022, arch: AMD64, cibw_build: 'cp*', cibw_skip: 'cp36*' } | ||
- { os: windows-2022, arch: x86, cibw_build: 'cp*', cibw_skip: 'cp36*' } | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -113,7 +109,7 @@ jobs: | |
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: '🚧 cibuildwheel run' | ||
uses: pypa/cibuildwheel@v2.22.0 | ||
uses: pypa/cibuildwheel@v2.23.3 | ||
env: | ||
CIBW_BUILD_FRONTEND: build | ||
CIBW_BUILD: ${{ matrix.cibw_build }} | ||
|
@@ -136,10 +132,10 @@ jobs: | |
shell: bash | ||
run: | | ||
python3 -m pip install -U pip wheel | ||
python3 -m wheel tags --python-tag='py2' --abi-tag=none wheelhouse/*cp38*.whl | ||
python3 -m wheel tags --python-tag='py2' --abi-tag=none wheelhouse/*cp37*.whl | ||
|
||
- uses: LizardByte/[email protected] | ||
if: (runner.os == 'Linux' && (matrix.arch == 'x86_64' || matrix.arch == 'aarch64') && matrix.cibw_build == 'cp38-manylinux*') || (runner.os == 'macOS' && matrix.arch == 'arm64') || (runner.os == 'Windows' && matrix.arch == 'AMD64') | ||
- uses: LizardByte/actions/actions/[email protected] | ||
if: (runner.os == 'Linux' && (matrix.arch == 'x86_64' || matrix.arch == 'aarch64') && matrix.cibw_build == 'cp*-manylinux*') || (runner.os == 'macOS' && matrix.arch == 'arm64') || (runner.os == 'Windows' && matrix.arch == 'AMD64') | ||
with: | ||
python-version: 2.7 | ||
|
||
|
@@ -153,7 +149,7 @@ jobs: | |
|
||
# NOTE: no python2.7 support for macos-13: https://github.com/LizardByte/setup-python-action/issues/2 | ||
- name: 'Python 2.7 tests - Non-Windows' | ||
if: (runner.os == 'Linux' && (matrix.arch == 'x86_64' || matrix.arch == 'aarch64') && matrix.cibw_build == 'cp38-manylinux*') || (runner.os == 'macOS' && matrix.arch == 'arm64') | ||
if: (runner.os == 'Linux' && (matrix.arch == 'x86_64' || matrix.arch == 'aarch64') && matrix.cibw_build == 'cp*-manylinux*') || (runner.os == 'macOS' && matrix.arch == 'arm64') | ||
run: | | ||
python2 -m pip install capstone==4.0.2 wheelhouse/*py2*.whl | ||
python2 -m unittest discover tests/regress "*.py" | ||
|
@@ -163,125 +159,6 @@ jobs: | |
name: ${{ env.ARTIFACT_NAME }} | ||
path: ./wheelhouse/*.whl | ||
|
||
# Job to be executed to build all wheels for all platforms/architectures/python versions only for tag release | ||
build_wheels_all_versions: | ||
name: Building on ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.cibw_build }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# NOTE: Doing this to parallelize and speed up workflow | ||
# i686 - manylinux | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp37-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp39-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp310-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp311-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp312-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp313-manylinux*', cibw_skip: '' } | ||
# i686 - musllinux | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp37-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp39-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp310-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp311-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp312-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: i686, cibw_build: 'cp313-musllinux*', cibw_skip: '' } | ||
# x86_64 - manylinux | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp37-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp39-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp310-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp311-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp312-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp313-manylinux*', cibw_skip: '' } | ||
# x86_64 - musllinux | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp37-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp39-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp310-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp311-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp312-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp313-musllinux*', cibw_skip: '' } | ||
# aarch64 - manylinux | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp37-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp39-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp310-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp311-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp312-manylinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp313-manylinux*', cibw_skip: '' } | ||
# aarch64 - musllinux | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp37-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp39-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp310-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp311-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp312-musllinux*', cibw_skip: '' } | ||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp313-musllinux*', cibw_skip: '' } | ||
- { os: macos-13, arch: x86_64, cibw_build: 'cp*', cibw_skip: '*36* *38*' } | ||
- { os: macos-latest, arch: arm64, cibw_build: 'cp*', cibw_skip: '*36* *37* *38*' } | ||
- { os: windows-2022, arch: AMD64, cibw_build: 'cp*', cibw_skip: '*36* *38*' } | ||
- { os: windows-2022, arch: x86, cibw_build: 'cp*', cibw_skip: '*36* *38*' } | ||
if: ${{ inputs.fullMode == 1 || (startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v')) || contains(github.event.head_commit.message, 'CI(full)') }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# https://github.com/actions/upload-artifact/issues/22 | ||
- name: Prepare a unique name for Artifacts | ||
shell: bash | ||
run: | | ||
# replace not-allowed chars with dash | ||
name="cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cibw_build }}" | ||
name=$(echo -n "$name" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g' | sed -e 's/\-$//') | ||
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV | ||
|
||
- name: "Increase pagefile to avoid OOM" | ||
if: runner.os == 'Windows' | ||
uses: al-cheb/[email protected] | ||
with: | ||
minimum-size: 8GB | ||
disk-root: "C:" | ||
|
||
- name: '🛠️ Add msbuild to PATH' | ||
if: runner.os == 'Windows' | ||
uses: microsoft/setup-msbuild@v2 | ||
with: | ||
vs-version: '17' | ||
|
||
- name: '🛠️ Win MSVC 32 dev cmd setup' | ||
if: runner.os == 'Windows' && matrix.arch == 'x86' | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: x86 | ||
|
||
- name: '🛠️ Win MSVC 64 dev cmd setup' | ||
if: runner.os == 'Windows' && matrix.arch == 'AMD64' | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: x64 | ||
|
||
- name: '🛠️ Set up QEMU' | ||
if: runner.os == 'Linux' && matrix.arch == 'i686' | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: '🚧 cibuildwheel run' | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD_FRONTEND: build | ||
CIBW_BUILD: ${{ matrix.cibw_build }} | ||
CIBW_SKIP: ${{ matrix.cibw_skip }} | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
CIBW_ENVIRONMENT: DEBUG=${{ env.UNICORN_DEBUG }} GENERATORS='Visual Studio 17 2022' | ||
CIBW_ENVIRONMENT_PASS_LINUX: DEBUG | ||
CIBW_TEST_EXTRAS: test | ||
CIBW_TEST_COMMAND: 'python -m unittest discover -v {project}/tests/regress "*.py"' | ||
with: | ||
package-dir: bindings/python | ||
output-dir: wheelhouse | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.ARTIFACT_NAME }} | ||
path: ./wheelhouse/*.whl | ||
|
||
make_sdist: | ||
name: Make SDist | ||
runs-on: ubuntu-latest | ||
|
@@ -303,7 +180,7 @@ jobs: | |
path: bindings/python/dist/*.tar.gz | ||
|
||
publish: | ||
needs: [ build_wheels_python38_only, build_wheels_all_versions, make_sdist ] | ||
needs: [ build_and_test_wheels, make_sdist ] | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
|
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.