I tried to cross-compile psycopg2-binary from an Intel Big Sur machine, however, it did not work.
This Gist works on a an Arm64 Big Sur machine but not on Intel:
It does not work with either cibuildwheel or pure delocate usage.
The PR I’ve been working from is this.
The execution boils down to:
export ARCHFLAGS="-arch arm64"
# More set up steps
pip wheel --use-feature=in-tree-build --wheel-dir /tmp/psycopg2.91366/built_wheel --no-deps .
delocate-wheel --require-archs arm64 -w /tmp/psycopg2.91366/repaired_wheel /tmp/psycopg2.91366/built_wheel/psycopg2_binary-2.9.1-cp38-cp38-macosx_11_0_arm64.whl
delocate-listdeps does not list these on the Intel host while it does for the Arm64 host (Homebrew uses
/usr/local/Cellar on Intel hosts):
I assume things don’t work because we need the arm64 version of the libraries:
❯ lipo -info /usr/local/Cellaremail@example.com/1.1.1l/lib/libssl.1.1.dylib
Non-fat file: /usr/local/Cellarfirstname.lastname@example.org/1.1.1l/lib/libssl.1.1.dylib is architecture: x86_64
❯ lipo -info /usr/local/Cellar/postgresql/13.4/lib/libpq.5.13.dylib
Non-fat file: /usr/local/Cellar/postgresql/13.4/lib/libpq.5.13.dylib is architecture: x86_64
Does this mean that we cannot cross-compile to arm64 to an Intel host when a Python package needs to include an arm64 library?
Can the arm64 libraries that the Arm64 host has be packaged and used in the Intel host during the packaging process?