fix: prevent panic when no interpreters match abi3 minimum version#3108
Merged
messense merged 1 commit intoMar 30, 2026
Merged
Conversation
When the default Python interpreter (first on PATH) doesn't meet the abi3 minimum version and no interpreter is explicitly specified, maturin panicked with `assertion failed: !wheels.is_empty()`. This happened because `find_specified_interpreters` didn't filter by `requires-python`, so an incompatible interpreter (e.g. CPython 3.9) was selected. Then in `build_abi3_wheels`, it was excluded from both `abi3_interps` (version too low) and `non_abi3_interps` (has stable API), resulting in an empty wheels vector. Fix both layers: - Filter default interpreters by `requires-python` in `find_specified_interpreters`, so the abi3 sysconfig fallback can find compatible interpreters instead. - Replace the `assert!` in `build_abi3_wheels` and `build()` with proper error messages as defense in depth.
c4357eb to
69a7068
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the default Python interpreter (first on PATH) doesn't meet the abi3 minimum version and no interpreter is explicitly specified, maturin panicked with
assertion failed: !wheels.is_empty().This happened because
find_specified_interpretersdidn't filter byrequires-python, so an incompatible interpreter (e.g. CPython 3.9) was selected. Then inbuild_abi3_wheels, it was excluded from bothabi3_interps(version too low) andnon_abi3_interps(has stable API), resulting in an empty wheels vector.Fix both layers:
requires-pythoninfind_specified_interpreters, so the abi3 sysconfig fallback can find compatible interpreters instead.assert!inbuild_abi3_wheelsandbuild()with proper error messages as defense in depth.Closes #3107