indygreg / python-build-standalone

Produce redistributable builds of Python
BSD 3-Clause "New" or "Revised" License
1.75k stars 109 forks source link

WIP: Windows arm64 builds - help needed #93

Open adiantek opened 2 years ago

adiantek commented 2 years ago

Hello,

I'm trying to add Windows ARM64 compatibility in your python-build-standalone. I started working with it. OpenSSL is compiled, libffi checks done, but https://github.com/adiantek/python-build-standalone/runs/3770671733?check_suite_focus=true#step:7:7470 why -march64 is ignored?

And I don't know why build system is 32-bit... Build system should be x86_64-w64-cygwin, and host/target aarch64:

checking build system type... i686-pc-cygwin
checking host system type... aarch64-w64-cygwin
checking target system type... aarch64-w64-cygwin
indygreg commented 2 years ago

The problem here is that the msvc.sh script in the version of libffi we are using doesn't recognize the -arm64 argument. It looks like the newer source of libffi in https://github.com/python/cpython-source-deps/tree/libffi does support this.

We should upgrade to the latest libffi and in a separate commit/PR add support for arm/arm64 builds. I'll start looking into upgrading libffi now.

indygreg commented 2 years ago

I pushed a commit to the main branch to update libffi to version 3.4.2 on Windows. After this change, I'm able to build an arm64 libffi. So you should be unblocked from finishing this PR. (It currently fails in CPython's build when handling OpenSSL when I build locally.)

Also, if we're going to implement ARM64, what do you think about doing ARM as well? I feel like it should be trivial to do both once you get 1 working? If you don't want to deal with the scope bloat, I can work on ARM once you get ARM64 working.

adiantek commented 2 years ago

Thanks for help. Unfortunately, this week I've busy, so I could look into it next week. I've Surface Pro X, so I can test it on the real device and that's why I would like to have python3 for arm64. ARM32 should run too.

zooba commented 2 years ago

Also, if we're going to implement ARM64, what do you think about doing ARM as well? I feel like it should be trivial to do both once you get 1 working? If you don't want to deal with the scope bloat, I can work on ARM once you get ARM64 working.

Only do this if you're keen - it seems like ARM is not going to be an important user or server platform anytime soon, and the IoT applications aren't as compelling as they once were. ARM64 is the main priority for everyone.