Skip to content

Fix wheel build - #3182

Merged
csukuangfj merged 4 commits into
k2-fsa:masterfrom
csu-fangjun:fix-wheel-build
Feb 13, 2026
Merged

csukuangfj merged 4 commits into
k2-fsa:masterfrom
csu-fangjun:fix-wheel-build

Conversation

@csukuangfj

@csukuangfj csukuangfj commented Feb 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3177

cc @ggolda

Summary by CodeRabbit

  • New Features

    • Added Python 3.14 support across all build platforms (Windows, macOS, Linux, ARM64 variants, and CUDA/RKNN configurations).
  • Chores

    • Upgraded build tooling to latest version for improved compatibility and performance.
    • Enhanced internal build script robustness and command handling.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 13, 2026
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @csukuangfj, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the reliability and compatibility of the wheel build process. It refines how build directories are determined within the CMake extension script, making path handling more robust. Additionally, it updates the wheel patching utility to include support for Python 3.14, ensuring broader compatibility for generated wheels.

Highlights

  • Build Path Resolution: Improved the robustness of output binary directory path resolution in the CMake extension script by using Path.resolve().parent.
  • CMake Command Readability: Enhanced the readability of CMake command constructions by reformatting multi-line lists for cmake_configure_cmd and cmake_build_cmd.
  • Python 3.14 Support: Extended the wheel patching script to recognize and support Python 3.14 versions.
Changelog
  • cmake/cmake_extension.py
    • Updated the calculation of out_bin_dir to use Path.resolve().parent for more accurate and robust path resolution.
    • Refactored the cmake_configure_cmd and cmake_build_cmd lists into multi-line formats for improved code readability.
    • Removed unnecessary blank lines within the build_extension method.
  • scripts/wheel/patch_wheel.py
    • Added a new condition to detect and correctly handle Python 3.14 (cp314) wheels during the patching process.
Ignored Files
  • Ignored by pattern: .github/workflows/** (10)
    • .github/workflows/build-wheels-aarch64-cuda.yaml
    • .github/workflows/build-wheels-aarch64-rknn.yaml
    • .github/workflows/build-wheels-aarch64.yaml
    • .github/workflows/build-wheels-linux-cuda.yaml
    • .github/workflows/build-wheels-linux.yaml
    • .github/workflows/build-wheels-macos-arm64.yaml
    • .github/workflows/build-wheels-macos-universal2.yaml
    • .github/workflows/build-wheels-macos-x64.yaml
    • .github/workflows/build-wheels-win64-cuda.yaml
    • .github/workflows/build-wheels-win64.yaml
Activity
  • No specific review comments or activity have been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Feb 13, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR extends Python 3.14 support across multiple build workflows, upgrades cibuildwheel to v3.3.1, refactors cmake command construction to use safer explicit lists for path and directory handling, and adds cp314 wheel filename mapping for Python 3.14 detection.

Changes

Cohort / File(s) Summary
Workflow - Python 3.14 Matrix Support
.github/workflows/build-wheels-aarch64-cuda.yaml, .github/workflows/build-wheels-aarch64-rknn.yaml, .github/workflows/build-wheels-linux-cuda.yaml, .github/workflows/build-wheels-win64-cuda.yaml, .github/workflows/build-wheels-win64.yaml
Added Python 3.14 (cp314) to build matrix configurations across CUDA, RKNN, and Windows platforms to expand supported Python versions.
Workflow - cibuildwheel Version Upgrades
.github/workflows/build-wheels-aarch64.yaml, .github/workflows/build-wheels-linux.yaml, .github/workflows/build-wheels-macos-*.yaml
Upgraded cibuildwheel action from v3.1.4 to v3.3.1 across macOS (arm64, universal2, x64) and Linux aarch64 workflows for improved tooling.
Workflow - cibuildwheel Major Version Upgrade
.github/workflows/build-wheels-aarch64-cuda.yaml
Upgraded cibuildwheel in aarch64-cuda workflow from v2.21.3 to v3.3.1, combining major version bump with Python 3.14 support.
Build Tooling - Command Safety & Python 3.14
cmake/cmake_extension.py, scripts/wheel/patch_wheel.py
Refactored cmake command construction to use explicit Python lists for safer path handling and resolved directories; added cp314 wheel filename mapping to py_version "3.14".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Wheels spinning for Python 3.14, so fine,
cibuildwheel upgraded, building in line,
Paths made explicit, commands are clear,
Cross-platform harmony throughout the year! 🌟

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@csukuangfj
csukuangfj merged commit bb49014 into k2-fsa:master Feb 13, 2026
17 of 27 checks passed
@csukuangfj
csukuangfj deleted the fix-wheel-build branch February 13, 2026 08:44

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to fix the wheel build process. The changes include using resolved paths for build directories in cmake/cmake_extension.py to improve robustness, adding support for Python 3.14 in scripts/wheel/patch_wheel.py, and various code formatting improvements for better readability. The changes are generally good and contribute to fixing the build. I've added one comment regarding a long if/elif chain in scripts/wheel/patch_wheel.py which could be refactored for better maintainability as new Python versions are supported.

Comment on lines +47 to +48
elif "cp314" in str(whl):
py_version = "3.14"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change is correct, this long if/elif chain is becoming difficult to maintain. With each new Python version, another elif block is added. Consider refactoring this logic to be more scalable. For example, you could use a regular expression to extract the Python version from the wheel filename.

An example refactoring could look like this:

import re

# ...
    match = re.search(r"cp3(\d+)", str(whl))
    if match:
        py_version = f"3.{match.group(1)}"
    elif "py3-none" in str(whl):
        py_version = None
    else:
        assert False, f"Unknown python version in {whl}"

This would handle all cp3* versions automatically and make the code more robust for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pypi is missing sherpa_onnx-1.12.24-cp312-cp312-win_amd64.whl

1 participant