Opened 3 years ago

Last modified 21 months ago

#63486 reopened enhancement

Provide ARM version of PyPy on M1 Macs

Reported by: programmingkidx Owned by: danchr (Dan Villiom Podlaski Christiansen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: arm64 Cc:
Port: pypy39

Description

Currently when someone tries to install PyPy on an M1 Mac the x86_64 version installed. I ask that an ARM version of PyPy be made available for M1 Macs.

Steps to reproduce: sudo port install pypy37

Change History (8)

comment:1 Changed 3 years ago by programmingkidx

Looks like it would not be as easy as recompiling. I found this post indicating it would probably take some work: https://www.pypy.org/posts/2020/12/mac-meets-arm64-940822335619099039.html

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Keywords: arm64 added; PyPy Python M1 ARM removed
Owner: set to danchr
Status: newassigned
Type: defectenhancement

comment:3 Changed 3 years ago by danchr (Dan Villiom Podlaski Christiansen)

The main attraction of PyPy is the JIT; without it, PyPy is essentially equivalent to CPython, only slower and less compatible. For macOS, the only supported JIT platform is AMD64, and I haven't seen any other news since the blog post, mentioned earlier, indicating otherwise. Looking at their repository, hardly any work has been done on the effort. Because of that, I've disabled the port for other platforms, and I'm inclined to close this bug as WONTFIX; essentially, it's an upstream bug.

Unless you have a concrete use-case where you could actually use a JIT-less PyPy, I believe the current behaviour is correct: Just refuse to install it on platforms where it's de facto useless, such as PowerPC and ARM64. If you do have such a use-case, please share!

(In general, porting and developing PyPy is quite hard, and it's probably one of the reasons why alternate proposals for a Python JIT keep turning up. Even fixing bugs on macOS is stupidly difficult, as you have to rely on the mostly undocumented test suite to reproduce errors. If you're so unlucky that your issue only turns up on a fully bootstrapped JIT, look forward to thirty minute fix/test development cycles. At best.)

Last edited 3 years ago by danchr (Dan Villiom Podlaski Christiansen) (previous) (diff)

comment:4 Changed 3 years ago by danchr (Dan Villiom Podlaski Christiansen)

As an aside, I should also note that I don't actually own any ARM boxes capable of running macOS, so someone else will have to spearhead this effort. The Intel Macs I have can't run ARM code, and my Raspberry Pi 4 isn't up to the task either 😁

comment:5 Changed 3 years ago by programmingkidx

Thank you for the information. It is hard to work on.

comment:6 Changed 3 years ago by danchr (Dan Villiom Podlaski Christiansen)

Resolution: wontfix
Status: assignedclosed

As noted earlier, although PyPy does offer an arm64 JIT, it is not supported on macOS. Hence, there is little-to-no value in having an arm64 build of PyPy, and you'd probably be better off running the x86_64 binary under emulation anyway.

comment:7 Changed 21 months ago by danchr (Dan Villiom Podlaski Christiansen)

Port: pypy39 added; pypy37 removed
Resolution: wontfix
Status: closedreopened

According to their blog nightly builds of PyPy are now able to target ARM64 on macOS. I still don't own an ARM mac, but I can try enabling the build in the next release and see if it works.

Reopening.

comment:8 Changed 21 months ago by programmingkidx

I spent months working on porting PyPy to ARM64 Mac OS. It is really bad to work on. You have to rely on their rpython language. I have a good idea what the r stands for now... After having the main parts of PyPy working on ARM64 Mac OS I ended my work on it stopping with the foreign function interface code. This means if you import a library it will probably crash PyPy. In the end I so regret spending so much time on it. The maintainers were creeps. I hope never to hear from them again. They were awful to work with. The funny thing is they thank Maciej Fijałkowski for the work, but it was me who did about everything 🙄. Well PyPy was able to run code very fast on my M1 Mac. I was pleased with that. Recently I discovered Google's Go language and left Python coding so you may do as you wish with this port. I don't need it anymore.

Note: See TracTickets for help on using tickets.