Skip to content

Add Python 3.14 wheel builds - #44

Merged
ipmb merged 7 commits into
mainfrom
copilot/build-wheels-python-3-14
Feb 24, 2026
Merged

Add Python 3.14 wheel builds#44
ipmb merged 7 commits into
mainfrom
copilot/build-wheels-python-3-14

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor
  • Investigate cibuildwheel versions and Python 3.14 support
  • Update pypa/cibuildwheel from v2.20.0 to v3.3.1 (which includes CPython 3.14.2)
  • Add cp31?t-* to CIBW_SKIP to skip free-threading builds (now built by default in cibuildwheel v3.1+)
  • Remove cp36-* and pp* from CIBW_SKIP (invalid in cibuildwheel v3)
  • Fix pre_build.sh: Python 3.14 uses LC_BUILD_VERSION instead of LC_VERSION_MIN_MACOSX in Mach-O headers
  • Replace retired macos-13 runner with macos-14 (Apple Silicon) for x86_64 cross-compilation
  • Fix pre_build.sh: pass ARCHFLAGS to pcre2/jansson configure for cross-compilation
  • Fix build.yml: add macOS-specific flags for uWSGI build
  • Fix macOS x86_64 failure: set explicit per-matrix macOS ARCHFLAGS, APPEND_CFLAGS, and LDFLAGS instead of relying on ${ARCHFLAGS:-} expansion in CIBW_ENVIRONMENT_MACOS
Original prompt

This section details on the original issue you should resolve

<issue_title>Wheels for Python 3.14</issue_title>
<issue_description>Would it be possible to build wheels for Python 3.14?</issue_description>

<agent_instructions>The changes necessary will likely all be in the CI pipeline. cibuildwheel compatibility should be confirmed.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: ipmb <319156+ipmb@users.noreply.github.com>
Copilot AI changed the title [WIP] Add wheels support for Python 3.14 Add Python 3.14 wheel builds Feb 24, 2026
Copilot AI requested a review from ipmb February 24, 2026 15:30
@ipmb

ipmb commented Feb 24, 2026

Copy link
Copy Markdown
Member

@copilot remove these warnings from the build:

Warning: cibuildwheel: Invalid skip selector: 'cp36-*'. cibuildwheel 3.x no longer supports Python < 3.8. Please use the 2.x series or update `skip`. This selector will have no effect. 
Warning: cibuildwheel: Invalid skip selector: 'pp*'. This selector matches a group that wasn't enabled. Enable it using the `enable` option or remove this selector. This selector will have no effect. 

Co-authored-by: ipmb <319156+ipmb@users.noreply.github.com>

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot remove these warnings from the build:

...

Done in 5a71799. Removed both cp36-* (Python < 3.8 no longer supported in cibuildwheel v3) and pp* (PyPy not enabled by default in v3, so skip has no effect).

@ipmb

ipmb commented Feb 24, 2026

Copy link
Copy Markdown
Member

@copilot review and resolve the the issues in the build https://github.com/lincolnloop/pyuwsgi-wheels/actions/runs/22357647552

… 3.14

Co-authored-by: ipmb <319156+ipmb@users.noreply.github.com>

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review and resolve the the issues in the build https://github.com/lincolnloop/pyuwsgi-wheels/actions/runs/22357647552

The macos-14 arm64 job was failing in pre_build.sh because Python 3.14 binaries use LC_BUILD_VERSION instead of LC_VERSION_MIN_MACOSX in their Mach-O load commands. With set -o pipefail, the grep returning exit code 1 (no match) caused the script to abort.

Fixed in 0c4453c:

  1. Skip deployment target detection entirely if cibuildwheel has already set MACOSX_DEPLOYMENT_TARGET (it does in v3.2.1+)
  2. When detection is needed, fall back from LC_VERSION_MIN_MACOSX to LC_BUILD_VERSION (Python 3.14+)
  3. Added an explicit error if both detection methods fail

@ipmb

ipmb commented Feb 24, 2026

Copy link
Copy Markdown
Member

@copilot Resolve this issue in the build:

The configuration 'macos-13-us-default' is not supported

…6_64

Co-authored-by: ipmb <319156+ipmb@users.noreply.github.com>

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Resolve this issue in the build:

The configuration 'macos-13-us-default' is not supported

Fixed in e08b3c5. The macos-13 GitHub Actions runner has been retired. Replaced with macos-14 (Apple Silicon) which cross-compiles x86_64 wheels. Also updated pre_build.sh to pass ARCHFLAGS (set by cibuildwheel to -arch x86_64 during cross-compilation) to the pcre2 and jansson configure commands so the native dependencies are built for the correct target architecture.

@ipmb

ipmb commented Feb 24, 2026

Copy link
Copy Markdown
Member

@copilot resolve the build error for Build wheels for macos-14 x86_64

Co-authored-by: ipmb <319156+ipmb@users.noreply.github.com>

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the build error for Build wheels for macos-14 x86_64

Fixed in 829cf31. The uWSGI build system (uwsgiconfig.py) compiles with its own clang invocations that don't automatically inherit ARCHFLAGS. Added CIBW_ENVIRONMENT_MACOS to propagate ARCHFLAGS via APPEND_CFLAGS and LDFLAGS — the two env vars uwsgiconfig.py reads directly — so the compiled .so is built for the correct target architecture (x86_64 when cross-compiling).

@ipmb

ipmb commented Feb 24, 2026

Copy link
Copy Markdown
Member

@copilot build_pcre and build_jannson already have these set CFLAGS="${ARCHFLAGS:-}" LDFLAGS="${ARCHFLAGS:-}". Does your change mean that isn't necessary anymore? Double check your work.

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot build_pcre and build_jannson already have these set CFLAGS="${ARCHFLAGS:-}" LDFLAGS="${ARCHFLAGS:-}". Does your change mean that isn't necessary anymore? Double check your...

Both changes are still needed — they target different build components:

  • pre_build.sh CFLAGS="${ARCHFLAGS:-}" → affects pcre2/jansson's ./configure. Autoconf reads CFLAGS from the env. CIBW_ENVIRONMENT_MACOS only sets APPEND_CFLAGS, which autoconf doesn't know about, so the CFLAGS in pre_build.sh can't be removed.

  • CIBW_ENVIRONMENT_MACOS APPEND_CFLAGS="${ARCHFLAGS:-}" → affects uWSGI's build. uwsgiconfig.py reads APPEND_CFLAGS (not CFLAGS), so the pre_build.sh subshell CFLAGS setting doesn't reach it.

The LDFLAGS overlap is technically redundant (both set to ${ARCHFLAGS:-}), but removing either risks breaking its respective component if the other ever changes.

@ipmb

ipmb commented Feb 24, 2026

Copy link
Copy Markdown
Member

@copilot still failing, try again

Co-authored-by: ipmb <319156+ipmb@users.noreply.github.com>

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot still failing, try again

Addressed in bd6cb88. I changed CIBW_ENVIRONMENT_MACOS to set explicit per-matrix values for ARCHFLAGS, APPEND_CFLAGS, and LDFLAGS (-arch x86_64 or -arch arm64) instead of relying on ${ARCHFLAGS:-} expansion. This makes the target architecture deterministic for both pre_build.sh (pcre2/jansson) and uWSGI’s uwsgiconfig.py build path.

@ipmb

ipmb commented Feb 24, 2026

Copy link
Copy Markdown
Member

@copilot handle this

 Build wheels for macos-14 x86_64
cibuildwheel: Setting SYSTEM_VERSION_COMPAT=0 to ensure CPython 3.8 can get correct macOS version and allow installation of wheels with MACOSX_DEPLOYMENT_TARGET >= 11.0. See https://github.com/pypa/cibuildwheel/issues/1767 for the details.

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot handle this

...

That line is informational from cibuildwheel, not an error. It intentionally sets SYSTEM_VERSION_COMPAT=0 on macOS so CPython 3.8 reports the real macOS version and can install wheels tagged macosx_11_0+ correctly.

I re-checked the latest run (22362136683) and it is green, including Build wheels for macos-14 x86_64.

@ipmb
ipmb marked this pull request as ready for review February 24, 2026 19:00
@ipmb
ipmb merged commit d88b058 into main Feb 24, 2026
9 checks passed
@ipmb ipmb mentioned this pull request Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wheels for Python 3.14

2 participants