HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.14k stars 656 forks source link

[make] Generate haxelib binary with `nekotools boot -c` on Mac/Linux #11653

Closed tobil4sk closed 4 months ago

tobil4sk commented 5 months ago

nekotools boot is a bit of a hack because it simply copies the neko exectuable and injects in the neko bytecode. This can cause issues with some tools that deal with executables on Linux/Mac. https://github.com/HaxeFoundation/neko/issues/130#issuecomment-218610395

This started happening on Arch linux, where the bytecode somehow gets stripped away during packaging so haxelib becomes unusable because it is reverted to the regular neko binary. See: #11652.

nekotools boot -c will instead generate a .c file which can then be compiled manually. I've changed this for Mac and Linux, but for Windows it will continue to use nekotools boot as it is simpler and doesn't cause issues there as far as I'm aware.

I'm not sure if this may have packaging implications now that a c compiler is used directly in the make file?

tobil4sk commented 4 months ago

Since we are building the executable on macos-13 (rather than macos-12) /usr/local/lib is no longer a default loader path for the executable, so we need to add it as an rpath. The neko binary is built with macos-12 (and previously 11) which is why it wasn't necessary when generating the haxelib executable from the neko executable.

Simn commented 4 months ago

Should I merge this or do we need to do something else first?

tobil4sk commented 4 months ago

Should I merge this or do we need to do something else first?

I don't think there's anything left to do here.