Skip to content

"universal2" and alternate deployment target on macOS #108

@ronaldoussoren

Description

@ronaldoussoren

Platform: macOS, in particular M1 systems.

These systems can run both arm64 (native) and x86_64 (in emulation) code, with per process selection using the "arch" command.

For C extensions it is possible to build both architectures on an M1 system (basically a form of cross compiling), including merging code for the two architectures in a fat binary ("Universal 2" in Apple-speak).

setuptools_rust will currently always build arm64 code only, even if python was started in x86_64 mode (e.g. arch -x86_64 python3.9 setup.py build_ext).

It would be nice if setuptools_rust were able to build "universal2" wheels.

An related to this: for C extensions Python by default builds extension that work on the deployment target used for the python binary. It might be necessary to enhance setuptools_rust to do something similar.

BTW. I hope to have some time to work on a PR in the near future.

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