You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS wheels get wrongly tagged as universal2 #586
On macOS when building a wheel of python-ldap, I get one that carries the universal2 tag, which marks it as working on both x86 and ARM: python_ldap-3.4.4-cp313-cp313-macosx_10_13_universal2.whl
Unfortunately, it is not, and when a package installer caches the built wheel, it poisons its own cache and installing it on the wrong architecture creates a rather opaque error:
.venv/lib/python3.13/site-packages/ldap/__init__.py:34: in <module>
import _ldap
E ImportError: dynamic module does not define module export function (PyInit__ldap)
This means I have to clear the cache for python-ldap whenever I switch projects that use a different architecture (e.g., if I want to run uv lock --upgrade on both).
The uv folks told me this is a packaging problem that has to be fixed within the project itself.
I have attached the build log, because it's too long for inline copy-paste: build.log
Note the linker warnings: ld: warning: ignoring file 'build/temp.macosx-10.13-universal2-cpython-313/Modules/common.o': found architecture 'arm64', required architecture 'x86_64'
I ran the build with uvx --from build pyproject-build, i.e. the official PyPA builder.
The issue you link to and this one suggest the build/packaging tool should be in charge of this, otherwise we'd have to mess with ARCHFLAGS (and maybe _PYTHON_HOST_PLATFORM)? Not sure how to go about doing that on our side.
Activity
mistotebe commentedon May 11, 2026
The issue you link to and this one suggest the build/packaging tool should be in charge of this, otherwise we'd have to mess with
ARCHFLAGS(and maybe_PYTHON_HOST_PLATFORM)? Not sure how to go about doing that on our side.