Skip to content

macOS wheels get wrongly tagged as universal2 #586

Open
@hynek

Description

@hynek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions