Skip to content

abi3t-* feature hard-errors on a valid free-threaded config from PYO3_CONFIG_FILE, even though it doesn't request abi3 #6176

Description

@dimbleby

Summary

With pyo3 features abi3-py310 + abi3t-py315 enabled (PEP 803 setup: abi3 wheel for GIL 3.10-3.14, abi3.abi3t wheel for 3.15+), building for free-threaded CPython 3.14t works when maturin queries the interpreter live, but fails when it resolves via a static PYO3_CONFIG_FILE — which is how CI/cross-compilation always resolves interpreters (e.g. --interpreter 3.14t vs a literal path).

Failing example from our CI: https://github.com/dimbleby/tomledit/actions/runs/28405596439/job/84167243975

Repro

$ maturin build --interpreter /path/to/python3.14t   # works
📦 Built wheel ...cp314-cp314t....whl

$ maturin build --interpreter 3.14t                  # fails, same interpreter
error: cannot set a minimum Python version 3.15 higher than the interpreter version 3.14
       (the minimum Python version is implied by the abi3-py315 feature)

The config file maturin writes in the failing case:

implementation=CPython
version=3.14
target_abi=CPython-free_threaded-3.14
build_flags=Py_GIL_DISABLED

It requests no abi3, yet pyo3-ffi's build script still rejects it — the min_version <= version assertion in pyo3-build-config/src/impl_.rs seems to enforce the abi3t-py315 floor whenever the feature is merely enabled, not only when the resolved target ABI is actually Abi3t.

Expected

Free-threaded 3.14t should build version-specific regardless of how the interpreter was resolved, matching the live-interpreter case.

Environment

pyo3/pyo3-build-config/pyo3-ffi 0.29.0, maturin 1.14.1, rustc 1.95.0, Linux x86_64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions