Skip to content

Wheel's C-extension build process broken on 3.13a1 on Windows b/c of SOABI addition #111059

Closed
@Starbuck5

Description

@Starbuck5

Bug report

Bug description:

Hello, I'm one of the maintainers of pygame-ce. I downloaded the recent release of Python 3.13a1 to test if pygame-ce would build against it, and after I commented out all the cython modules (which all failed to build ofc), I got this error:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<pip-setuptools-caller>", line 34, in <module>
  File "C:\Users\charl\Desktop\pygame-ce\setup.py", line 1051, in <module>
    setup(**PACKAGEDATA)
  File "C:\Users\charl\AppData\Local\Programs\Python\Python313\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
            ^^^^^^^^^^^^^^^^^^
  File "C:\Users\charl\AppData\Local\Programs\Python\Python313\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "C:\Users\charl\AppData\Local\Programs\Python\Python313\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "C:\Users\charl\AppData\Local\Programs\Python\Python313\Lib\site-packages\setuptools\dist.py", line 989, in run_command
    super().run_command(command)
  File "C:\Users\charl\AppData\Local\Programs\Python\Python313\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
    cmd_obj.run()
  File "C:\Users\charl\AppData\Local\Programs\Python\Python313\Lib\site-packages\wheel\bdist_wheel.py", line 401, in run
    impl_tag, abi_tag, plat_tag = self.get_tag()
                                  ^^^^^^^^^^^^^^
  File "C:\Users\charl\AppData\Local\Programs\Python\Python313\Lib\site-packages\wheel\bdist_wheel.py", line 351, in get_tag
    tag in supported_tags
AssertionError: would build wheel with unsupported tag ('cp313', 'cpwin_amd64', 'win_amd64')

I printed out a list of what tags were supported:

[('cp313', 'cp313', 'win_amd64'), ('cp313', 'abi3', 'win_amd64'), ('cp313', 'none', 'win_amd64'), ('cp312', 'abi3', 'win_amd64'), ('cp311', 'abi3', 'win_amd64'), ('cp310', 'abi3', 'win_amd64'), ('cp39', 'abi3', 'win_amd64'), ('cp38', 'abi3', 'win_amd64'), ('cp37', 'abi3', 'win_amd64'), ('cp36', 'abi3', 'win_amd64'), ('cp35', 'abi3', 'win_amd64'), ('cp34', 'abi3', 'win_amd64'), ('cp33', 'abi3', 'win_amd64'), ('cp32', 'abi3', 'win_amd64'), ('py313', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('py312', 'none', 'win_amd64'), ('py311', 'none', 'win_amd64'), ('py310', 'none', 'win_amd64'), ('py39', 'none', 'win_amd64'), ('py38', 'none', 'win_amd64'), ('py37', 'none', 'win_amd64'), ('py36', 'none', 'win_amd64'), ('py35', 'none', 'win_amd64'), ('py34', 'none', 'win_amd64'), ('py33', 'none', 'win_amd64'), ('py32', 'none', 'win_amd64'), ('py31', 'none', 'win_amd64'), ('py30', 'none', 'win_amd64'), ('cp313', 'none', 'win_amd64'), ('py313', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('py312', 'none', 'win_amd64'), ('py311', 'none', 'win_amd64'), ('py310', 'none', 'win_amd64'), ('py39', 'none', 'win_amd64'), ('py38', 'none', 'win_amd64'), ('py37', 'none', 'win_amd64'), ('py36', 'none', 'win_amd64'), ('py35', 'none', 'in_amd64')]

Since pygame-ce is a C-extension and is not using the limited ABI, the correct abi_tag (middle element of the tuple) is "cp313." However, wheel is not generating this correctly on 3.13a1, instead coming up with the nonsensical "cpwin_amd64."

Looking through Wheel's logic, I see that the change that breaks this was the addition of sysconfig.get_config_var("SOABI") in Python 3.13. In Python 3.12, sysconfig.get_config_var("SOABI") returns None, but on Python 3.13a1 sysconfig.get_config_var("SOABI") returns 'cp313-win_amd64'. This causes an invalid abi_tag to be generated and the build won't complete.

The SOABI change came from this issue I believe: #88402

Accompanying issue on this over on pypa/wheel: pypa/wheel#576

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions