lix-pm / haxeshim

The Unlicense
25 stars 8 forks source link

Neko is x86_64-only on Mac, which prevents Haxe from working #76

Open thomasjwebb opened 1 week ago

thomasjwebb commented 1 week ago

I'm on an arm Mac and I can see that newer Haxe versions that haxeshim downloads binaries that take advantage of the hardware:

> file ~/haxe/versions/4.3.6/haxe
~haxe/versions/4.3.6/haxe: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
~/haxe/versions/4.3.6/haxe (for architecture x86_64):   Mach-O 64-bit executable x86_64
~/haxe/versions/4.3.6/haxe (for architecture arm64):    Mach-O 64-bit executable arm64
> file ~/haxe/versions/4.3.4/haxe
~/haxe/versions/4.3.4/haxe: Mach-O 64-bit executable x86_64

Whereas older versions were still just x86_64. That's good except the neko that's downloaded is still x86_64-only:

> file ~/haxe/neko/neko
~/haxe/neko/neko: Mach-O 64-bit executable x86_64

So if I try to run haxe to build something, anything when .haxerc specifies 4.3.6, it doesn't work:

> haxe build.hxml                  
haxelib path: dyld[96848]: Library not loaded: @rpath/libneko.2.dylib
  Referenced from: <AA2F4624-5911-36E3-868C-7A06E52B3424> ~/haxe/versions/4.3.6/haxelib
  Reason: tried: '~/haxe/neko/libneko.2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/usr/local/lib/libneko.2.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libneko.2.dylib' (no such file), '/usr/local/lib/libneko.2.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libneko.2.dylib' (no such file)

I don't have this error if I switch to an older Haxe version. I also stop having this error if I use homebrew to install neko, then copy the neko libs over:

cp /opt/homebrew/lib/libneko.* ~/haxe/neko/

Am I doing something wrong or does this need to download a different neko build?

Tobbse commented 16 hours ago

You are not doing anything wrong. There is an open PR in lix.client to address this issue. https://github.com/lix-pm/lix.client/pull/201