Skip to content

Commit

Permalink
V5 - Fix sdist build and add CI job for testing it. (#2623)
Browse files Browse the repository at this point in the history
* Fix sdist build and add CI job for testing it.

* Temporarily set QEMU version to v8.1.5.
  • Loading branch information
Rot127 authored Feb 7, 2025
1 parent 5526125 commit eb33363
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/python-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
uses: docker/setup-qemu-action@v3
with:
platforms: all
# Temporary fix due to
# https://github.com/pypa/cibuildwheel/issues/2257
# https://github.com/docker/setup-qemu-action/issues/188
# https://github.com/tonistiigi/binfmt/issues/215
image: tonistiigi/binfmt:qemu-v8.1.5

- name: Build wheels
uses: pypa/[email protected]
Expand Down Expand Up @@ -62,6 +67,14 @@ jobs:
cd bindings/python
pipx run build --sdist
- name: Test build with sdist
run: |
TMP_DIR=$(mktemp -d)
tar -xf bindings/python/dist/*.tar.gz -C $TMP_DIR/
cd $TMP_DIR/*/src
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -B build
cmake --build build
- uses: actions/upload-artifact@v4
with:
path: bindings/python/dist/*.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -850,4 +850,4 @@ if(CAPSTONE_BUILD_CSTEST)
endif()

set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackConfig.cmake")
include(CPackConfig.txt)
include(CPackConfig.txt)
3 changes: 3 additions & 0 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def copy_sources():
shutil.copytree(os.path.join(BUILD_DIR, "include"), os.path.join(SRC_DIR, "include"))

src.extend(glob.glob(os.path.join(BUILD_DIR, "*.[ch]")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "*.in")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "*.mk")))

src.extend(glob.glob(os.path.join(BUILD_DIR, "Makefile")))
Expand All @@ -99,6 +100,8 @@ def copy_sources():
src.extend(glob.glob(os.path.join(BUILD_DIR, "make.sh")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "CMakeLists.txt")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "pkgconfig.mk")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "CPackConfig.txt")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "CPackConfig.cmake")))

for filename in src:
outpath = os.path.join(SRC_DIR, os.path.basename(filename))
Expand Down

0 comments on commit eb33363

Please sign in to comment.