Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 10 commits into from
May 16, 2024

Conversation

tobil4sk
Copy link
Member

@tobil4sk tobil4sk commented May 3, 2024

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. HaxeFoundation/neko#130 (comment)

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?

`nekotools boot` is a bit of a hack and some tools that deal with executables on linux can strip away the haxelib bytecode if it is done this way.

`nekotools boot -c` will generate a .c file which can then be compiled manually.
Otherwise it doesn't work if haxe isn't already installed, or it might use the wrong version of the standard library
They are now needed for compiling haxelib
@HaxeFoundation HaxeFoundation deleted a comment from RMSPORTS1902 May 4, 2024
@HaxeFoundation HaxeFoundation deleted a comment from RMSPORTS1902 May 4, 2024
For some reason this environment variable isn't working here on Windows
We don't have neko binaries for mac arm64 yet

`nekotools boot run.n` was previously also producing an x64 binary
It looks like /usr/local/lib is no longer used as a default path in some cases.
@tobil4sk
Copy link
Member Author

tobil4sk commented May 6, 2024

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
Copy link
Member

Simn commented May 16, 2024

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

@tobil4sk
Copy link
Member Author

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

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

@Simn Simn merged commit 1e9326a into HaxeFoundation:development May 16, 2024
50 checks passed
@tobil4sk tobil4sk deleted the fix/haxelib-binary branch May 16, 2024 14:06
kLabz pushed a commit that referenced this pull request Jul 18, 2024
…11653)

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

`nekotools boot` is a bit of a hack and some tools that deal with executables on linux can strip away the haxelib bytecode if it is done this way.

`nekotools boot -c` will generate a .c file which can then be compiled manually.

* [make] Fix for unix platforms if PLATFORM is defined

* [make] Set the HAXE_STD_PATH while building haxelib

Otherwise it doesn't work if haxe isn't already installed, or it might use the wrong version of the standard library

* [ci] Install missing neko headers during setup

They are now needed for compiling haxelib

* [ci] Ensure /usr/local/include exists before installing neko

* [ci] Install neko headers for earthly builds as well

* [make] Omit HAXE_STD_PATH when building haxelib on windows

For some reason this environment variable isn't working here on Windows

* [ci] Continue building x64 haxelib on mac arm64 for now

We don't have neko binaries for mac arm64 yet

`nekotools boot run.n` was previously also producing an x64 binary

* [make] Set rpath on mac when building haxelib

It looks like /usr/local/lib is no longer used as a default path in some cases.

* [make] Set std path for haxelib build on windows
kLabz pushed a commit that referenced this pull request Jul 18, 2024
…11653)

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

`nekotools boot` is a bit of a hack and some tools that deal with executables on linux can strip away the haxelib bytecode if it is done this way.

`nekotools boot -c` will generate a .c file which can then be compiled manually.

* [make] Fix for unix platforms if PLATFORM is defined

* [make] Set the HAXE_STD_PATH while building haxelib

Otherwise it doesn't work if haxe isn't already installed, or it might use the wrong version of the standard library

* [ci] Install missing neko headers during setup

They are now needed for compiling haxelib

* [ci] Ensure /usr/local/include exists before installing neko

* [ci] Install neko headers for earthly builds as well

* [make] Omit HAXE_STD_PATH when building haxelib on windows

For some reason this environment variable isn't working here on Windows

* [ci] Continue building x64 haxelib on mac arm64 for now

We don't have neko binaries for mac arm64 yet

`nekotools boot run.n` was previously also producing an x64 binary

* [make] Set rpath on mac when building haxelib

It looks like /usr/local/lib is no longer used as a default path in some cases.

* [make] Set std path for haxelib build on windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants