Description
Description
Hi! I see on https://ziglang.org/download/ that since versions v0.10.0 and later the Zig programming language has had 32-bit binaries, and it now regularly publishes binaries for development versions of v0.13.0 at the time of writing; I wonder if it would be possible to build 32-bit Windows wheels based on those binaries and ship them with PyPI as well.
Proposed implementation
I see that make_wheels.py
is used to build wheels instead of the traditional setup.py
format, and no source distributions are distributed, as described in #2 – that makes sense.
I think this should be done by:
- adding an
x86-windows
key-value pair to theZIG_PYTHON_PLATFORMS
constant, and - the platform tag for the wheel should then be mapped to
win32
– which is the value ofsysconfig.get_platform()
, mostly, but it can be better extracted fromwheel.bdist.wheel.get_tag
in these lines:Lines 130 to 135 in 33c05bb
- and then these lines
Lines 152 to 165 in 33c05bb
urllib
and package the binary up into an extra wheel without ABI tags as usual.
The command-line argument parser can then work as usual, just with a new available option.
Additional context
I would be happy to implement the changes myself here – they look quite minimal, and would be happy to get a chance to contribute :) I have decided to open an issue first to gauge thoughts from maintainers and core developers.
I'm using zig cc
as a build-time dependency for my Python package for cross-compiling uses, where the absence of a 32-bit Windows wheel would break building off of the source distribution (since a source distribution isn't planned or worth any use for Zig and just wheels are uploaded). I can very well remove that breakage with a conditional dependency specifier in the form of something like
[build-system]
requires = [
"setuptools>=64",
"wheel==0.42.0",
"ziglang==0.11.0; platform_machine != 'x86' and platform_system == 'Windows'",
]
build-backend = "setuptools.build_meta"
to restrict it for just this platform and architecture (while keeping it for others), but since PyPI's Zig isn't being built from source, I thought I should really propose the addition here.