Conda-forge builds Apple Silicon (arm64) binaries by cross-compiling, not by building on native platforms. This is all rather hacky and poorly documented, with the best documentation at:
It's really really hacky for Python extension module builds, as distutils doesn't support cross-compilation. The way it works is by running a (hacked, monkeypatched) build-platform Python+distutils to drive the build, which then invokes the cross-platform compiler. This causes all sorts of issues with paths, where the cross-compiler will find the build- rather than host-platform libraries using the default logic from setup.py here.
We avoid this by explicitly detecting conda-forge cross-platform builds by looking for the CONDA_BUILD_CROSS_COMPILATION environment variable. If this variable is set, we set up the library paths by looking at the PREFIX variable (which conda sets to the destination where the package will be installed).
This makes the cross-compilation work. It doesn't make it any less ugly, but that's the world we live in...
Conda-forge builds Apple Silicon (arm64) binaries by cross-compiling, not by building on native platforms. This is all rather hacky and poorly documented, with the best documentation at:
It's really really hacky for Python extension module builds, as distutils doesn't support cross-compilation. The way it works is by running a (hacked, monkeypatched) build-platform Python+distutils to drive the build, which then invokes the cross-platform compiler. This causes all sorts of issues with paths, where the cross-compiler will find the build- rather than host-platform libraries using the default logic from setup.py here.
We avoid this by explicitly detecting conda-forge cross-platform builds by looking for the CONDA_BUILD_CROSS_COMPILATION environment variable. If this variable is set, we set up the library paths by looking at the PREFIX variable (which conda sets to the destination where the package will be installed).
This makes the cross-compilation work. It doesn't make it any less ugly, but that's the world we live in...