Skip to content

Fix platform tag logic to generate the same as cpython on AIX#3220

Merged
messense merged 1 commit into
PyO3:mainfrom
pgimalac:fix/aix-platform-tag
Jun 14, 2026
Merged

Fix platform tag logic to generate the same as cpython on AIX#3220
messense merged 1 commit into
PyO3:mainfrom
pgimalac:fix/aix-platform-tag

Conversation

@pgimalac

@pgimalac pgimalac commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Fix the platform tag logic on AIX to generate the same tag as CPython does.

On AIX, CPython runs lslpp -Lqc bos.rte and parses the output to extract version information, then builds the tag with format aix_{ver:x}{rel}{tl:02}_{builddate:04}_{bitsize}.
See https://github.com/python/cpython/blob/main/Lib/_aix_support.py for the exact implementation.

maturin currently falls through the POSIX fallback which uses uname() 's release and machine fields, producing tags like aix_3_00F9D80F4C00 (hardware model number) that pip does not recognize.

This PR aims to implement the same logic so that wheels are properly tagged and can be used by pip.
Without the fix, pip install fails with ERROR: not a supported wheel on this platform.

Added unit tests to validate the parsing.
Also built maturin with the fix, generated a small test wheel, installed it with pip, and called it to validate it all works end to end on AIX.

@pgimalac pgimalac changed the title Fix platform tag logic to generate the same output as cpython on AIX Fix platform tag logic to generate the same as cpython on AIX Jun 12, 2026
@pgimalac pgimalac marked this pull request as ready for review June 12, 2026 16:15
@messense messense requested a review from Copilot June 14, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates maturin’s wheel platform tag generation on AIX to match CPython’s sysconfig.get_platform() behavior, fixing tags that pip previously rejected.

Changes:

  • Add an AIX-specific platform tag path using lslpp -Lqc bos.rte parsing to produce CPython-compatible aix_{ver}{rel}{tl}_{builddate}_{bitsize} tags.
  • Introduce a unit-testable parser helper (aix_tag_from_lslpp_output) and add unit tests covering typical and edge-case outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/target/platform_tag.rs
@messense messense merged commit 43d7258 into PyO3:main Jun 14, 2026
81 of 85 checks passed
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.

3 participants