From 34e5ff453659b0b0f1acf3070b893dde8f8b8e49 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Wed, 11 Mar 2026 19:29:41 +0800 Subject: [PATCH 01/13] ci: re-enable free threaded build --- .github/workflows/wheels.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 569d8e9..365f839 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,4 +1,4 @@ -name: wheels +name: Build and publish wheels on: workflow_dispatch: @@ -48,7 +48,6 @@ jobs: uses: pypa/cibuildwheel@v3.4.0 env: CIBW_TEST_SKIP: "*" - CIBW_SKIP: "pp* cp3*t-*" - uses: actions/upload-artifact@v4 with: @@ -75,7 +74,7 @@ jobs: uses: pypa/cibuildwheel@v3.4.0 env: CIBW_TEST_SKIP: "*" - CIBW_SKIP: "pp* cp3*t-* *-musllinux*" + CIBW_SKIP: "*-musllinux*" - uses: actions/upload-artifact@v4 with: From a9f00f36ea58f19dccfea32544a0894f14f3c0a4 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 10:57:26 +0800 Subject: [PATCH 02/13] chore(cmake): update minimum CMake version to 3.32 and adjust Python ABI detection for cross-compilation --- CMakeLists.txt | 15 ++++++++++++++- pyproject.toml | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7897604..4615841 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.32) project(ark_fbs_python LANGUAGES CXX) option(ARK_FBS_VENDOR_FLATBUFFERS "Build with vendored flatbuffers source" ON) @@ -8,6 +8,19 @@ set(ARK_FBS_FLATBUFFERS_SOURCE_DIR "" CACHE PATH set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# CMake >= 3.30 excludes free-threaded Python (gil_disabled) from FindPython by +# default. scikit-build-core fails to pass this flag in Windows cross-compile +# scenarios (e.g. AMD64 host building ARM64 cp314t wheels), so the library is +# looked up as python314.lib instead of python314t.lib. Detect via SKBUILD_SOABI +# (set by scikit-build-core before CMake runs) and opt in explicitly. +if(DEFINED SKBUILD_SOABI) + string(REGEX MATCH "cp[0-9]+t-" _is_free_threaded "${SKBUILD_SOABI}") + if(_is_free_threaded) + set(Python_FIND_ABI "ANY" "ANY" "ANY" "ON") + endif() + unset(_is_free_threaded) +endif() + set(PYBIND11_FINDPYTHON ON) find_package(pybind11 CONFIG REQUIRED) diff --git a/pyproject.toml b/pyproject.toml index dd80b3e..b5dc81a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dev = [ ] [tool.scikit-build] -cmake.version = ">=3.15" +cmake.version = ">=3.32" cmake.build-type = "Release" wheel.packages = ["src/ark_fbs"] From 281e6d7d55667043c751fe8d61ae141e670cb567 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:04:25 +0800 Subject: [PATCH 03/13] chore(pyproject): limit build to cp313t and cp314t on windows for test --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index b5dc81a..bbff233 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ archs = ["x86_64", "arm64"] [tool.cibuildwheel.windows] archs = ["AMD64", "x86", "ARM64"] +build = ["cp313t-*", "cp314t-*"] [build-system] requires = [ From 60f9253f66592367416228117f767c368969b544 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:09:32 +0800 Subject: [PATCH 04/13] build: ci fail fast and remove invalid property --- .github/workflows/wheels.yml | 2 +- pyproject.toml | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 365f839..2c62442 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -35,7 +35,7 @@ jobs: runs-on: ${{ matrix.os }} needs: [build_sdist] strategy: - fail-fast: false + fail-fast: true matrix: os: [windows-latest, macos-latest] diff --git a/pyproject.toml b/pyproject.toml index bbff233..54f908d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,10 +17,7 @@ classifiers = [ "Bug Tracker" = "https://github.com/MooncellWiki/ArkFBS/issues" [dependency-groups] -dev = [ - "ruff >=0.15.0, <0.16.0", - "pre-commit >=4.0.0, <5.0.0", -] +dev = ["ruff >=0.15.0, <0.16.0", "pre-commit >=4.0.0, <5.0.0"] [tool.scikit-build] cmake.version = ">=3.32" @@ -38,11 +35,7 @@ archs = ["x86_64", "arm64"] [tool.cibuildwheel.windows] archs = ["AMD64", "x86", "ARM64"] -build = ["cp313t-*", "cp314t-*"] [build-system] -requires = [ - "scikit-build-core >=0.12", - "pybind11 >=3.0", -] -build-backend = "scikit_build_core.build" \ No newline at end of file +requires = ["scikit-build-core >=0.12", "pybind11 >=3.0"] +build-backend = "scikit_build_core.build" From 531218f81ac1407840d123892640d43eab852da5 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:28:12 +0800 Subject: [PATCH 05/13] ci: fast test win64 arm build --- .github/workflows/wheels.yml | 3 +++ CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2c62442..9efabf2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -48,6 +48,9 @@ jobs: uses: pypa/cibuildwheel@v3.4.0 env: CIBW_TEST_SKIP: "*" + CIBW_ENABLE: cpython-freethreading + CIBW_BUILD: cp314t-win_arm64 + CIBW_ARCHS_WINDOWS: ARM64 - uses: actions/upload-artifact@v4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 4615841..71c24a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # looked up as python314.lib instead of python314t.lib. Detect via SKBUILD_SOABI # (set by scikit-build-core before CMake runs) and opt in explicitly. if(DEFINED SKBUILD_SOABI) - string(REGEX MATCH "cp[0-9]+t-" _is_free_threaded "${SKBUILD_SOABI}") + string(REGEX MATCH "[0-9]+t[-.]" _is_free_threaded "${SKBUILD_SOABI}") if(_is_free_threaded) set(Python_FIND_ABI "ANY" "ANY" "ANY" "ON") endif() From 0a23f4716c9f4c0c9d1af383393d1b8a85004176 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:31:42 +0800 Subject: [PATCH 06/13] ci: test build --- .github/workflows/test-win-build.yml | 24 ++++++++++++++++++++++++ .github/workflows/wheels.yml | 3 --- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test-win-build.yml diff --git a/.github/workflows/test-win-build.yml b/.github/workflows/test-win-build.yml new file mode 100644 index 0000000..7c220d0 --- /dev/null +++ b/.github/workflows/test-win-build.yml @@ -0,0 +1,24 @@ +name: Test windows build + +on: + workflow_dispatch: + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + needs: [build_sdist] + strategy: + fail-fast: true + matrix: + os: [windows-latest] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Build wheels + uses: pypa/cibuildwheel@v3.4.0 + env: + CIBW_TEST_SKIP: "*" \ No newline at end of file diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9efabf2..2c62442 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -48,9 +48,6 @@ jobs: uses: pypa/cibuildwheel@v3.4.0 env: CIBW_TEST_SKIP: "*" - CIBW_ENABLE: cpython-freethreading - CIBW_BUILD: cp314t-win_arm64 - CIBW_ARCHS_WINDOWS: ARM64 - uses: actions/upload-artifact@v4 with: From 3fe25dd13228ae81ad016a6d85acece516fae3aa Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:33:02 +0800 Subject: [PATCH 07/13] ci: remove dependency on build_sdist in Windows wheels workflow --- .github/workflows/test-win-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-win-build.yml b/.github/workflows/test-win-build.yml index 7c220d0..2713b78 100644 --- a/.github/workflows/test-win-build.yml +++ b/.github/workflows/test-win-build.yml @@ -7,7 +7,6 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} - needs: [build_sdist] strategy: fail-fast: true matrix: From b616c57a58f02e49c95e7a364950b8df7be452de Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:33:44 +0800 Subject: [PATCH 08/13] ci: add push trigger to Windows build workflow --- .github/workflows/test-win-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-win-build.yml b/.github/workflows/test-win-build.yml index 2713b78..80edb95 100644 --- a/.github/workflows/test-win-build.yml +++ b/.github/workflows/test-win-build.yml @@ -1,6 +1,7 @@ name: Test windows build on: + push: workflow_dispatch: jobs: From 1753fd84427f7cfa3f7c58cc3be36d6c1735a95d Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:34:45 +0800 Subject: [PATCH 09/13] ci: update Windows build workflow to enable freethreading and ARM64 architecture --- .github/workflows/test-win-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-win-build.yml b/.github/workflows/test-win-build.yml index 80edb95..e588817 100644 --- a/.github/workflows/test-win-build.yml +++ b/.github/workflows/test-win-build.yml @@ -21,4 +21,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v3.4.0 env: - CIBW_TEST_SKIP: "*" \ No newline at end of file + CIBW_TEST_SKIP: "*" + CIBW_ENABLE: cpython-freethreading + CIBW_BUILD: cp314t-win_arm64 + CIBW_ARCHS_WINDOWS: ARM64 From 9caeb1853136a431c7293df104f25bf7c6d43683 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:40:34 +0800 Subject: [PATCH 10/13] chore(cmake): simplify Python ABI detection for Windows cross-compilation and add status messages --- CMakeLists.txt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71c24a2..53c6c72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,19 +8,17 @@ set(ARK_FBS_FLATBUFFERS_SOURCE_DIR "" CACHE PATH set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# CMake >= 3.30 excludes free-threaded Python (gil_disabled) from FindPython by -# default. scikit-build-core fails to pass this flag in Windows cross-compile -# scenarios (e.g. AMD64 host building ARM64 cp314t wheels), so the library is -# looked up as python314.lib instead of python314t.lib. Detect via SKBUILD_SOABI -# (set by scikit-build-core before CMake runs) and opt in explicitly. -if(DEFINED SKBUILD_SOABI) - string(REGEX MATCH "[0-9]+t[-.]" _is_free_threaded "${SKBUILD_SOABI}") - if(_is_free_threaded) - set(Python_FIND_ABI "ANY" "ANY" "ANY" "ON") - endif() - unset(_is_free_threaded) +# CMake excludes free-threaded Python from the default ABI search. On Windows +# cross-compilation, that leads FindPython to look for pythonXY.lib instead of +# pythonXYt.lib for cp3xyt targets. Allow either ABI and let FindPython choose +# the matching interpreter/development pair. +if(WIN32) + set(Python_FIND_ABI "ANY" "ANY" "ANY" "ANY") endif() +message(STATUS "SKBUILD_SOABI=${SKBUILD_SOABI}") +message(STATUS "Python_FIND_ABI=${Python_FIND_ABI}") + set(PYBIND11_FINDPYTHON ON) find_package(pybind11 CONFIG REQUIRED) From 5e3576a2d06e07cf7cb01ceca5fbf9353e848eca Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:45:52 +0800 Subject: [PATCH 11/13] chore(cmake): enhance Python ABI detection for Windows and add additional status messages --- CMakeLists.txt | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53c6c72..9a35bf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,32 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # CMake excludes free-threaded Python from the default ABI search. On Windows # cross-compilation, that leads FindPython to look for pythonXY.lib instead of -# pythonXYt.lib for cp3xyt targets. Allow either ABI and let FindPython choose -# the matching interpreter/development pair. +# pythonXYt.lib for cp3xyt targets. Allow either ABI, and if scikit-build-core +# already provided a target Python root, point FindPython directly at the +# free-threaded import library. if(WIN32) set(Python_FIND_ABI "ANY" "ANY" "ANY" "ANY") + + if(DEFINED SKBUILD_SOABI AND SKBUILD_SOABI MATCHES "^cp([0-9]+)t-") + if(NOT DEFINED Python_ROOT_DIR AND DEFINED ENV{pythonLocation}) + set(Python_ROOT_DIR "$ENV{pythonLocation}") + endif() + + if(DEFINED Python_ROOT_DIR) + set(_ark_fbs_python_ft_lib "${Python_ROOT_DIR}/libs/python${CMAKE_MATCH_1}t.lib") + if(EXISTS "${_ark_fbs_python_ft_lib}") + set(Python_LIBRARY "${_ark_fbs_python_ft_lib}") + set(Python_LIBRARY_RELEASE "${_ark_fbs_python_ft_lib}") + endif() + unset(_ark_fbs_python_ft_lib) + endif() + endif() endif() message(STATUS "SKBUILD_SOABI=${SKBUILD_SOABI}") +message(STATUS "Python_ROOT_DIR=${Python_ROOT_DIR}") +message(STATUS "Python_LIBRARY=${Python_LIBRARY}") +message(STATUS "Python_LIBRARY_RELEASE=${Python_LIBRARY_RELEASE}") message(STATUS "Python_FIND_ABI=${Python_FIND_ABI}") set(PYBIND11_FINDPYTHON ON) From 4ee876772a6736808eb78ace609f78dd220b7892 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:54:31 +0800 Subject: [PATCH 12/13] ci: refactor Windows build workflows to support multiple architectures and remove deprecated configurations --- .github/workflows/test-win-build.yml | 27 ------------- .github/workflows/wheels.yml | 58 +++++++++++++++++++++++----- CMakeLists.txt | 30 -------------- 3 files changed, 49 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/test-win-build.yml diff --git a/.github/workflows/test-win-build.yml b/.github/workflows/test-win-build.yml deleted file mode 100644 index e588817..0000000 --- a/.github/workflows/test-win-build.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test windows build - -on: - push: - workflow_dispatch: - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [windows-latest] - - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Build wheels - uses: pypa/cibuildwheel@v3.4.0 - env: - CIBW_TEST_SKIP: "*" - CIBW_ENABLE: cpython-freethreading - CIBW_BUILD: cp314t-win_arm64 - CIBW_ARCHS_WINDOWS: ARM64 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2c62442..98bb25d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -30,14 +30,10 @@ jobs: name: sdist path: dist/*.tar.gz - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} + build_wheels_windows: + name: Build wheels on windows-latest + runs-on: windows-latest needs: [build_sdist] - strategy: - fail-fast: true - matrix: - os: [windows-latest, macos-latest] steps: - uses: actions/checkout@v4 @@ -48,10 +44,54 @@ jobs: uses: pypa/cibuildwheel@v3.4.0 env: CIBW_TEST_SKIP: "*" + CIBW_ARCHS_WINDOWS: "AMD64 x86" - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }} + name: windows + path: ./wheelhouse/*.whl + retention-days: 1 + + build_wheels_windows_arm64: + name: Build wheels on windows-11-arm + runs-on: windows-11-arm + needs: [build_sdist] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Build wheels + uses: pypa/cibuildwheel@v3.4.0 + env: + CIBW_TEST_SKIP: "*" + CIBW_ARCHS_WINDOWS: "ARM64" + + - uses: actions/upload-artifact@v4 + with: + name: windows-arm64 + path: ./wheelhouse/*.whl + retention-days: 1 + + build_wheels_macos: + name: Build wheels on macos-latest + runs-on: macos-latest + needs: [build_sdist] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Build wheels + uses: pypa/cibuildwheel@v3.4.0 + env: + CIBW_TEST_SKIP: "*" + + - uses: actions/upload-artifact@v4 + with: + name: macos-latest path: ./wheelhouse/*.whl retention-days: 1 @@ -85,7 +125,7 @@ jobs: publish: if: github.event_name == 'release' name: Publish to PyPI - needs: [build_sdist, build_wheels, build_manylinux_wheels_ubuntu] + needs: [build_sdist, build_wheels_windows, build_wheels_windows_arm64, build_wheels_macos, build_manylinux_wheels_ubuntu] runs-on: ubuntu-latest permissions: id-token: write diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a35bf3..68a4e95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,36 +8,6 @@ set(ARK_FBS_FLATBUFFERS_SOURCE_DIR "" CACHE PATH set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# CMake excludes free-threaded Python from the default ABI search. On Windows -# cross-compilation, that leads FindPython to look for pythonXY.lib instead of -# pythonXYt.lib for cp3xyt targets. Allow either ABI, and if scikit-build-core -# already provided a target Python root, point FindPython directly at the -# free-threaded import library. -if(WIN32) - set(Python_FIND_ABI "ANY" "ANY" "ANY" "ANY") - - if(DEFINED SKBUILD_SOABI AND SKBUILD_SOABI MATCHES "^cp([0-9]+)t-") - if(NOT DEFINED Python_ROOT_DIR AND DEFINED ENV{pythonLocation}) - set(Python_ROOT_DIR "$ENV{pythonLocation}") - endif() - - if(DEFINED Python_ROOT_DIR) - set(_ark_fbs_python_ft_lib "${Python_ROOT_DIR}/libs/python${CMAKE_MATCH_1}t.lib") - if(EXISTS "${_ark_fbs_python_ft_lib}") - set(Python_LIBRARY "${_ark_fbs_python_ft_lib}") - set(Python_LIBRARY_RELEASE "${_ark_fbs_python_ft_lib}") - endif() - unset(_ark_fbs_python_ft_lib) - endif() - endif() -endif() - -message(STATUS "SKBUILD_SOABI=${SKBUILD_SOABI}") -message(STATUS "Python_ROOT_DIR=${Python_ROOT_DIR}") -message(STATUS "Python_LIBRARY=${Python_LIBRARY}") -message(STATUS "Python_LIBRARY_RELEASE=${Python_LIBRARY_RELEASE}") -message(STATUS "Python_FIND_ABI=${Python_FIND_ABI}") - set(PYBIND11_FINDPYTHON ON) find_package(pybind11 CONFIG REQUIRED) From 4d283e970c586af075bfa3f7a1d55555168bc522 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 12 Mar 2026 11:54:53 +0800 Subject: [PATCH 13/13] ci: add push trigger to wheels workflow for improved automation --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 98bb25d..14acda9 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,6 +1,7 @@ name: Build and publish wheels on: + push: workflow_dispatch: release: types: [published]