Closed jaraco closed 1 year ago
Side note, it's a shame that the error message doesn't indicate what output was received or what was expected.
Same error occurs without --optimizations
and without --python
and with --python=cpython-3.10
.
Looking at this SO question, it seems it was a known issue with older Pythons prior to Apple Silicon support, but that should be irrelevant for Python 3.9+. I am using py
, which was resolving to Python 3.12.0a2, but I'm guessing the version of Python running the build script is not relevant to the configure step, and confirmed (issue occurs with py -3.10 ...
).
The error message apparently comes from:
https://github.com/python/cpython/blob/cd67c1bb30eccd0c6fd1386405df225aed4c91a9/configure#L10953
Suggesting that /usr/bin/arch
is emitting something other than i386
, ppc
, or arm64
... or maybe the word size detection is breaking and causing the configure script to use the wrong cases.
I have confirmed that i386
is what appears from arch when running under x86_64:
$ arch -x86_64 sh -c arch
i386
I think I've observed that the configure is failing during a second attempt. Is that because this project first builds Python for the host system, then performs the cross-compilation?
CPython's configure script is notoriously bad about handling cross-compilation on macOS. It makes a ton of assumptions about Apple targeting. We have to carry a handful of patches to essentially remove all these assumptions. It looks like this arch
issue somehow fell through the cracks. We'll need to carry a patch to configure.ac
to fix this busted logic.
The failing code hasn't been unused since 2011. Lol. https://github.com/python/cpython/pull/101048
I can confirm the 20230116 tag is building now. Thank you, thank you, thank you.
Attempting to build Python for macOS on an M1 Macbook Pro running Ventura (macOS 13.0.1) and targeting x86_64 fails during the configure:
Since the docs say it should be possible to build for x86 on ARM, I'm guessing this is a bug. I reproduced it against both main (a07a392) and 20221106.
For reference, here's the full output of a run and the corresponding invocation/stderr: