How do I get Lime working on my M1/M2 Macs?

Sorry to be that guy, but I’ve been trying to pull all the threads together to get it to work, but it just isn’t clicking.

I have the repo locally and can build the x86_64 versions with arch -x86_64 but running the Haxe project still fails with (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64').

Is there a definitive guide or some arm64/arm64e binaries around?

I personally recommend installing the Intel version of Haxe (just the standard Mac installer from https://haxe.org/download/), and then installing Lime from with haxelib install lime, at least to start out. Haxe and Lime run just fine in Rosetta, and I’ve been successfully using the Intel versions on M1 (and newer) Macs since 2021 with no issues.

Once you confirm thats working with a simple Hello World project, then you can try checking out the Lime repo and rebuilding manually (still on Intel Haxe). Lime can be tricky to build with all the native OS integration, so that’s why I suggested starting with an official release from Haxelib.

Finally, if you can get the Lime repo building for Intel, then you might try switching to Apple Silicon Haxe from wherever that’s available (Homebrew, I think?). I think we only recently started supporting Apple Silicon builds, so there might still be some rough edges, which is why I suggested building Lime for Intel first, just to get past any initial hurdles.

1 Like

It’s taken a little while, but I am a bit closer. I’m doing this on a slightly locked down machine; I can’t install the Haxe installer as it’s not signed. But I have installed x86 Homebrew and x86 Haxe from that.

I’ve installed the required libraries from haxelib, but when I go to run the setup commands, i get this error:

> haxelib run openfl setup
Could not link to neko.
Called from lime/_internal/backend/native/NativeCFFI.hx line 632
Called from lime/system/CFFI.hx line 177
Called from lime/system/CFFI.hx line 300
Uncaught exception - Segmentation fault

Neko is installed and available in the path.

I might have a crack at trying to build it and see if I can get some more info.

I think I read that Homebrew installs Neko in a non-default location, which leads to the Could not link to neko. error message.

In Lime 8.1, we added a new -eval option that completely bypasses Neko, and runs Lime’s tooling using the Haxe interpreter instead.

Try haxelib run openfl setup -eval

You may need to run with -eval for every Lime/OpenFL command after that too. So instead of openfl build html5, it would require openfl build html5 -eval. Not ideal, I know.