Merge commit '3621a6c08002c6b3e5b6f91bb0e20d8372613160' into dev

This commit is contained in:
Simone
2025-01-07 15:08:55 +00:00
1521 changed files with 323443 additions and 365407 deletions

View File

@@ -11,8 +11,8 @@ about: Create a report about incorrect disassembly.
| Questions | Answers
|------------------------------------------|--------------------
| OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
| Architecture | ppc, x86, cortexm, armv8 etc.
| System Capstone runs on OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
| Capstone module affected | ppc, x86, arm, aarch64 etc.
| Source of Capstone | `git clone`, brew, pip, release binaries etc.
| Version/git commit | v5.0.1, <commit hash>

View File

@@ -17,8 +17,8 @@ Please be as descriptive as possible
| Questions | Answers
|------------------------------------------|--------------------
| OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
| Architecture | ppc, x86, cortexm, armv8 etc.
| System Capstone runs on OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
| Capstone module affected | ppc, x86, arm, aarch64 etc.
| Source of Capstone | `git clone`, brew, pip, release binaries etc.
| Version/git commit | v5.0.1, <commit hash>
@@ -37,4 +37,4 @@ Please be as descriptive as possible
### Additional Logs, screenshots, source code, configuration dump, ...
Drag and drop zip archives containing the Additional info here, don't use external services or link.
Screenshots can be directly dropped here.
Screenshots can be directly dropped here.

View File

@@ -28,139 +28,161 @@ ARM:
- cstool/cstool_arm.c
- include/capstone/arm.h
- suite/MC/ARM/**
- tests/test_arm.c
- tests/MC/ARM/**
- tests/details/arm.yaml
AArch64:
- arch/AArch64/**
- cstool/cstool_aarch64.c
- include/capstone/aarch64.h
- include/capstone/arm64.h
- suite/MC/AArch64/**
- tests/test_aarch64.c
- tests/MC/AArch64/**
- tests/details/aarch64.yaml
Alpha:
- arch/Alpha/**
- cstool/cstool_alpha.c
- include/capstone/alpha.h
- suite/MC/Alpha/**
- tests/test_alpha.c
- tests/MC/Alpha/**
- tests/details/alpha.yaml
BPF:
- arch/BPF/**
- cstool/cstool_bpf.c
- include/capstone/bpf.h
- suite/MC/BPF/**
- tests/test_bpf.c
- tests/MC/BPF/**
- tests/details/bpf.yaml
EVM:
- arch/EVM/**
- cstool/cstool_evm.c
- include/capstone/evm.h
- tests/test_evm.c
- tests/details/evm.yaml
HPPA:
- arch/HPPA/**
- cstool/cstool_hppa.c
- include/capstone/hppa.h
- suite/MC/HPPA/**
- tests/test_hppa.c
- tests/MC/HPPA/**
- tests/details/hppa.yaml
LoongArch:
- arch/LoongArch/**
- cstool/cstool_loongarch.c
- include/capstone/loongarch.h
- suite/MC/LoongArch/**
- tests/test_loongarch.c
- tests/MC/LoongArch/**
- tests/details/loongarch.yaml
M680X:
- arch/M680X/**
- cstool/cstool_m680x.c
- include/capstone/m680x.h
- tests/test_m680x.c
- tests/details/m680x.yaml
M68K:
- arch/M68K/**
- cstool/cstool_m68k.c
- include/capstone/m68k.h
- tests/test_m68k.c
- tests/details/m68k.yaml
MOS65XX:
- arch/MOS65XX/**
- cstool/cstool_mos65xx.c
- include/capstone/mos65xx.h
- tests/test_mos65xx.c
- tests/details/mos65xx.yaml
Mips:
- arch/Mips/**
- cstool/cstool_mips.c
- include/capstone/mips.h
- suite/MC/Mips/**
- tests/test_mips.c
- tests/MC/Mips/**
- tests/details/mips.yaml
PowerPC:
- arch/PowerPC/**
- cstool/cstool_powerpc.c
- include/capstone/ppc.h
- suite/MC/PowerPC/**
- tests/test_powerpc.c
- tests/MC/PowerPC/**
- tests/details/ppc.yaml
RISCV:
- arch/RISCV/**
- cstool/cstool_riscv.c
- include/capstone/riscv.h
- suite/MC/RISCV/**
- tests/test_riscv.c
- tests/MC/RISCV/**
- tests/details/riscv.yaml
SH:
- arch/SH/**
- cstool/cstool_sh.c
- include/capstone/sh.h
- tests/test_sh.c
- tests/details/sh.yaml
Sparc:
- arch/Sparc/**
- cstool/cstool_sparc.c
- include/capstone/sparc.h
- suite/MC/Sparc/**
- tests/test_sparc.c
- tests/MC/Sparc/**
- tests/details/sparc.yaml
SystemZ:
- arch/SystemZ/**
- cstool/cstool_systemz.c
- include/capstone/systemz.h
- include/capstone/systemz_compatibility.h
- suite/MC/SystemZ/**
- tests/test_systemz.c
- tests/MC/SystemZ/**
- tests/details/systemz.yaml
TMS320C64x:
- arch/TMS320C6x/**
- cstool/cstool_tms320c64x.c
- include/capstone/tms320x64x.h
- tests/test_tms320c64x.c
- tests/details/tms320c64x.yaml
TriCore:
- arch/TriCore/**
- cstool/cstool_tricore.c
- include/capstone/tricore.h
- suite/MC/Tricore/**
- tests/test_tricore.c
- tests/MC/Tricore/**
- tests/details/tricore.yaml
WASM:
- arch/WASM/**
- cstool/cstool_wasm.c
- include/capstone/wasm.h
- tests/test_wasm.c
- tests/details/wasm.yaml
X86:
- arch/X86/**
- cstool/cstool_x86.c
- include/capstone/x86.h
- suite/MC/X86/**
- tests/test_x86.c
- tests/MC/X86/**
- tests/details/x86.yaml
XCore:
- arch/XCore/**
- cstool/cstool_xcore.c
- include/capstone/xcore.h
- tests/test_xcore.c
- tests/details/xcore.yaml
Xtensa:
- arch/Xtensa/**
- cstool/cstool_xtensa.c
- include/capstone/xtensa.h
- tests/MC/Xtensa/**
- tests/details/xtensa.yaml
python:
- bindings/python/**

View File

@@ -17,8 +17,16 @@ on:
- "TODO"
pull_request:
# Stop previous runs on the same branch on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
UBSAN_OPTIONS: "halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1"
ASAN_OPTIONS: "halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1"
LSAN_OPTIONS: "halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1"
jobs:
Linux:
@@ -54,10 +62,10 @@ jobs:
}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python-version }}
@@ -81,10 +89,10 @@ jobs:
mkdir build && cd build
# build static library
cmake -DCAPSTONE_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_ASAN=${asan} -DCAPSTONE_BUILD_DIET=${diet_build} ..
cmake --build . --config Release
cmake --build . --config Debug
# build shared library
cmake -DCAPSTONE_INSTALL=1 -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr -DCAPSTONE_BUILD_CSTEST=ON -DENABLE_ASAN=${asan} ..
sudo cmake --build . --config Release --target install
cmake -DCAPSTONE_INSTALL=1 -DCAPSTONE_BUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr -DCAPSTONE_BUILD_CSTEST=ON -DENABLE_ASAN=${asan} ..
sudo cmake --build . --config Debug --target install
- name: Lower number of KASL randomized address bits
run: |
@@ -130,6 +138,22 @@ jobs:
run: |
ctest --test-dir build --output-on-failure -R legacy*
- name: Valgrind cstest
if: startsWith(matrix.config.build-system, 'cmake') && startsWith(matrix.config.enable-asan, 'OFF')
run: |
sudo apt-get install valgrind
valgrind cstest tests
- name: Comaptibility header generation
if: startsWith(matrix.config.build-system, 'cmake')
run: |
cp ./include/capstone/arm64.h arm64_compat_current.h
cp ./include/capstone/systemz_compatibility.h systemz_compat_current.h
./suite/auto-sync/src/autosync/HeaderPatcher.py -c --v6 ./include/capstone/aarch64.h --v5 ./include/capstone/arm64.h
./suite/auto-sync/src/autosync/HeaderPatcher.py -c --v6 ./include/capstone/systemz.h --v5 ./include/capstone/systemz_compatibility.h
diff ./include/capstone/arm64.h arm64_compat_current.h &&
diff ./include/capstone/systemz_compatibility.h systemz_compat_current.h
Windows:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
@@ -145,7 +169,7 @@ jobs:
python-version: '3.9'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
name: Get CMake

View File

@@ -19,7 +19,7 @@ jobs:
working-directory: suite/auto-sync/
steps:
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
@@ -79,6 +79,8 @@ jobs:
./src/autosync/ASUpdater.py -d -a LoongArch -s IncGen
./src/autosync/ASUpdater.py -d -a Mips -s IncGen
./src/autosync/ASUpdater.py -d -a SystemZ -s IncGen
./src/autosync/ASUpdater.py -d -a Xtensa -s IncGen
./src/autosync/ASUpdater.py -d -a TriCore -s IncGen
- name: CppTranslator - Patch tests
run: |
@@ -96,3 +98,5 @@ jobs:
./src/autosync/ASUpdater.py --ci -d -a LoongArch -s Translate
./src/autosync/ASUpdater.py --ci -d -a Mips -s Translate
./src/autosync/ASUpdater.py --ci -d -a SystemZ -s Translate
./src/autosync/ASUpdater.py --ci -d -a Xtensa -s Translate
./src/autosync/ASUpdater.py --ci -d -a TriCore -s Translate

View File

@@ -0,0 +1,284 @@
# SPDX-FileCopyrightText: 2024 Antelox <anteloxrce@gmail.com>
# SPDX-License-Identifier: BSD-3
name: Build and publish wheels with cibuildwheel
on:
workflow_dispatch:
inputs:
debugMode:
description: 'Debug Mode'
required: false
default: ''
type: choice
options:
- '0'
- '1'
push:
paths-ignore:
- ".gitignore"
- "CREDITS.TXT"
- "ChangeLog"
- "README.md"
- "docs/**"
pull_request:
# Automatically cancel any previous running workflow on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
# Enable DEBUG flag either according to the tag release or manual override
CAPSTONE_DEBUG: ${{ inputs.debugMode != '' && inputs.debugMode || startsWith(github.ref, 'refs/tags') && '0' || '1' }}
jobs:
# job to be executed for every push - testing purpose
build_wheels_always:
name: Building on ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.cibw_build }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# NOTE: Making this to parallelize and speed up workflow
# i686 - manylinux
# - { os: ubuntu-latest, arch: i686, cibw_build: 'cp38-manylinux* cp313-manylinux*', cibw_skip: '' }
# i686 - musllinux
# - { os: ubuntu-latest, arch: i686, cibw_build: 'cp38-musllinux* cp313-musllinux*', cibw_skip: '' }
# x86_64 - manylinux
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp38-manylinux* cp313-manylinux*', cibw_skip: '' }
# x86_64 - musllinux
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp38-musllinux* cp313-musllinux*', cibw_skip: '' }
# aarch64 - manylinux
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp38-manylinux* cp313-manylinux*', cibw_skip: '' }
# aarch64 - musllinux
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp38-musllinux* cp313-musllinux*', cibw_skip: '' }
# macos - x86_64
- { os: macos-13, arch: x86_64, cibw_build: 'cp38* cp313*', cibw_skip: '' }
# macos - arm64
- { os: macos-latest, arch: arm64, cibw_build: 'cp38* cp313*', cibw_skip: '' }
- { os: macos-latest, arch: universal2, cibw_build: 'cp38* cp313*', cibw_skip: '' }
# windows - x86_64
- { os: windows-latest, arch: AMD64, cibw_build: 'cp38* cp313*', cibw_skip: '' }
# windows - amd64
# - { os: windows-latest, arch: x86, cibw_build: 'cp38* cp313*', cibw_skip: '' }
# windows - arm64
- { os: windows-latest, arch: ARM64, cibw_build: 'cp39* cp313*', cibw_skip: '' }
steps:
- uses: actions/checkout@v4
# 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
# https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64
- uses: actions/setup-python@v5
if: runner.os == 'macOS' && runner.arch == 'ARM64'
with:
python-version: 3.8
- 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: '🛠️ Win MSVC ARM64 dev cmd setup'
if: runner.os == 'Windows' && matrix.arch == 'ARM64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
- name: '🛠️ Set up QEMU'
if: runner.os == 'Linux' && matrix.arch != 'x86_64'
uses: docker/setup-qemu-action@v3
- name: '🚧 cibuildwheel run'
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD_FRONTEND: build
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_SKIP: ${{ matrix.cibw_skip }}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT: DEBUG=${{ env.CAPSTONE_DEBUG }}
CIBW_ENVIRONMENT_PASS_LINUX: DEBUG
# https://cibuildwheel.pypa.io/en/stable/faq/#windows-arm64
# https://github.com/pypa/cibuildwheel/pull/1169
CIBW_TEST_SKIP: "*-win_arm64 cp38-macosx_*:arm64"
CIBW_TEST_COMMAND: >
python -m pip install {package}/cstest_py &&
python {project}/suite/run_tests.py
with:
package-dir: bindings/python
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ./wheelhouse/*.whl
# To be executed only in case of a tag release
build_wheels_all:
name: Building on ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.cibw_build }}
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags')
strategy:
fail-fast: false
matrix:
include:
# NOTE: Making this to parallelize and speed up workflow
# i686 - manylinux
# - { 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: '' }
# i686 - musllinux
# - { 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: '' }
# x86_64 - manylinux
- { 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: '' }
# x86_64 - musllinux
- { 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: '' }
# aarch64 - manylinux
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp39-manylinux*', cibw_skip: '' }
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp310-manylinux*', cibw_skip: '' }
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp311-manylinux*', cibw_skip: '' }
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp312-manylinux*', cibw_skip: '' }
# aarch64 - musllinux
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp39-musllinux*', cibw_skip: '' }
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp310-musllinux*', cibw_skip: '' }
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp311-musllinux*', cibw_skip: '' }
- { os: ubuntu-latest, arch: aarch64, cibw_build: 'cp312-musllinux*', cibw_skip: '' }
# macos - x86_64
- { os: macos-13, arch: x86_64, cibw_build: 'cp*', cibw_skip: '*36* *37* *38* *313*' }
# macos - arm64
- { os: macos-latest, arch: arm64, cibw_build: 'cp*', cibw_skip: '*36* *37* *38* *313*' }
- { os: macos-latest, arch: universal2, cibw_build: 'cp*', cibw_skip: '*36* *37* *38* *39* *313*' }
# windows - amd64
- { os: windows-latest, arch: AMD64, cibw_build: 'cp*', cibw_skip: '*36* *37* *38* *313*' }
# windows - x86
# - { os: windows-latest, arch: x86, cibw_build: 'cp*', cibw_skip: '*36* *37* *38* *313*' }
# windows - arm64
- { os: windows-latest, arch: ARM64, cibw_build: 'cp*', cibw_skip: '*36* *37* *38* *39* *313*' }
steps:
- uses: actions/checkout@v4
# 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: '🛠️ 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: '🛠️ Win MSVC ARM64 dev cmd setup'
if: runner.os == 'Windows' && matrix.arch == 'ARM64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
- name: '🛠️ Set up QEMU'
if: runner.os == 'Linux' && matrix.arch != 'x86_64'
uses: docker/setup-qemu-action@v3
- name: '🚧 cibuildwheel run'
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD_FRONTEND: build
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_SKIP: ${{ matrix.cibw_skip }}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT: DEBUG=${{ env.CAPSTONE_DEBUG }}
CIBW_ENVIRONMENT_PASS_LINUX: DEBUG
# https://cibuildwheel.pypa.io/en/stable/faq/#windows-arm64
CIBW_TEST_SKIP: "*-win_arm64"
CIBW_TEST_COMMAND: >
python -m pip install {package}/cstest_py &&
python {project}/suite/run_tests.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
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Build SDist
run: |
cd bindings/python
python3 -m pip install -U pip build
python3 -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist-archive
path: bindings/python/dist/*.tar.gz
publish:
needs: [ build_wheels_always, build_wheels_all, make_sdist ]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Show downloaded artifacts
run: ls -laR dist
- name: '📦 Publish distribution to PyPI'
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ success() }}
with:
user: __token__
password: ${{ secrets.pypi_pass }}

View File

@@ -11,11 +11,34 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: archive
- name: Make setup.sh and check_capstone.sh are executable
run: |
chmod +x ./packages/deb/setup.sh
chmod +x ./packages/deb/check_capstone.sh
- name: Build Debian Package
working-directory: ./packages/deb
run: ./setup.sh ${{ github.event.release.tag_name }}
- name: Run sanity checks on the Debian package
working-directory: ./packages/deb
run: |
./check_capstone.sh ./libcapstone-dev_${{ github.event.release.tag_name }}_amd64.deb
- name: Upload debian package to release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.release.tag_name }}
files: |
./packages/deb/*.deb
- name: Create archive
id: archive
run: |
VERSION=${{ github.event.release.tag_name }}
@@ -27,24 +50,15 @@ jobs:
TARBALL=$PKGNAME.tar.xz
tar cJf $TARBALL $PKGNAME
sha256sum $TARBALL > $SHASUM
echo "::set-output name=tarball::$TARBALL"
echo "::set-output name=shasum::$SHASUM"
- name: upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
asset_content_type: application/gzip
echo "tarball=$TARBALL" >> $GITHUB_OUTPUT
echo "shasum=$SHASUM" >> $GITHUB_OUTPUT
- name: upload shasum
uses: actions/upload-release-asset@v1
- name: Upload tarball and shasum to release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.shasum }}
asset_name: ${{ steps.archive.outputs.shasum }}
asset_content_type: text/plain
tag_name: ${{ github.event.release.tag_name }}
files: |
${{ steps.archive.outputs.tarball }}
${{ steps.archive.outputs.shasum }}

View File

@@ -6,6 +6,11 @@ on:
- '**.h'
pull_request:
# Stop previous runs on the same branch on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
runs-on: ubuntu-24.04
@@ -22,7 +27,7 @@ jobs:
- name: Build
run: |
mkdir build && cd build
CC=clang cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=1 ..
CC=clang cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCAPSTONE_BUILD_SHARED_LIBS=1 ..
CC=clang sudo cmake --build . --config Release
cd ..

View File

@@ -16,7 +16,7 @@ jobs:
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: artifacts

View File

@@ -14,7 +14,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-22.04
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -1,90 +0,0 @@
name: RELEASE BUILD - PyPI 📦 Distribution
on: [push, pull_request, release, workflow_dispatch]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up MSVC x64
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
env:
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" # ppc64le s390x really slow
CIBW_ARCHS_WINDOWS: "AMD64" # ARM64 Seems ARM64 will rebuild amd64 wheel for unknow reason.
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
CIBW_SKIP: ""
with:
package-dir: bindings/python
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifacts-${{ matrix.os }}
- name: Check binaries (Windows)
if: matrix.os == 'windows-latest'
run: |
python3.exe suite/check_wheel_bin_arch.py ./wheelhouse/
- name: Check binaries (Unix)
if: matrix.os != 'windows-latest'
run: |
./suite/check_wheel_bin_arch.py ./wheelhouse/
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
submodules: true # Optional, use if you have submodules
- name: Build SDist
run: |
cd bindings/python
pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
path: bindings/python/dist/*.tar.gz
publish:
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.prerelease == false && github.event.action == 'published'
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Show downloaded artifacts
run: ls -laR dist
- name: Publish distribution 📦 to PyPI
if: ${{ success() }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
password: ${{ secrets.pypi_pass }}

View File

@@ -1,57 +0,0 @@
name: Python Package CI
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2022, macOS-14]
python-version: ["3.8", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Build and install capstone
run: pip install ./bindings/python
- name: Install cstest_py
run: pip install ./bindings/python/cstest_py
- name: Run legacy tests
run: python ./bindings/python/tests/test_all.py
- name: cstest_py integration tests
run: |
cd suite/cstest/test/
python3 ./integration_tests.py cstest_py
cd ../../../
- name: cstest_py MC
run: |
cstest_py tests/MC/
- name: cstest_py details
run: |
cstest_py tests/details/
- name: cstest_py issues
run: |
cstest_py tests/issues/
- name: cstest_py features
run: |
cstest_py tests/features/