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

Fix haxelib on OSX failing to find neko dlls #47

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

Aidan63
Copy link
Contributor

@Aidan63 Aidan63 commented Jun 22, 2024

Trying to use a recent haxe nightly with setup-haxe results in libneko errors on OSX.

 /usr/bin/tar xz -C neko-2.3.0-osx64 -f /Users/runner/work/_temp/d41fcca9-6a05-40e9-968e-3aeac137eed5
/bin/ls -1 neko-2.3.0-osx64
neko-2.3.0-osx64
/usr/bin/tar xz -C haxe_latest -f /Users/runner/work/_temp/d00a9bdc-8d92-469c-8e25-93d463847701
/bin/ls -1 haxe_latest
haxe_20240612100642_2106be4
/bin/ln -sfv /Users/runner/hostedtoolcache/neko/2.3.0/x64/libneko.2.dylib /Users/runner/hostedtoolcache/haxe/latest/x64/libneko.2.dylib
/Users/runner/hostedtoolcache/haxe/latest/x64/libneko.2.dylib -> /Users/runner/hostedtoolcache/neko/2.3.0/x64/libneko.2.dylib
/Users/runner/hostedtoolcache/haxe/latest/x64/haxelib setup /Users/runner/hostedtoolcache/haxe/latest/x64/lib
dyld[3399]: Library not loaded: @rpath/libneko.2.dylib
  Referenced from: <7B493A09-7C35-3D4A-8AE7-A0A7B110E9EB> /Users/runner/hostedtoolcache/haxe/latest/x64/haxelib
  Reason: tried: '/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)

Which is apparently due to recent packaging changes.

I think this is due to HaxeFoundation/haxe#11653. Previously the haxelib binary had the same rpath as the neko binary, which included @loader_path. However, now the haxelib binary is built with its own rpath which does not include this. This is why it is failing to find libneko. I'm not sure if the binaries are intended to be installed the way that setup-haxe is doing it.

This can be fixed either by adding the rpath to the haxelib binary or by changing setup-haxe to install the binaries to a default loader path (/usr/local/lib) or to modify the binary with install_name_tool so it can locate libneko in the custom install path.

Making sure DYLD_FALLBACK_LIBRARY_PATH points to the extracted neko folder seems to do the trick. I've also downgraded the mac ci version to 13 since thats the last version of the mac runner to use x86, so we can see that this fix works.

Copy link
Owner

@krdlab krdlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR!

Three checks are failing, but these are problems with the test code, so I will merge this PR.

/Users/runner/hostedtoolcache/haxe/3.4.7/x64/lib/hxnodejs/12,2,0/src/js/node/Crypto.hx:39: characters 5-13 : Unexpected abstract

@Aidan63
Copy link
Contributor Author

Aidan63 commented Jul 1, 2024

Thanks, yeah, I saw those failing tests as well. I thought about trying to fix them but I don't know anything about node and it seemed unrelated anyway.

@krdlab krdlab merged commit 1abb31a into krdlab:master Jul 10, 2024
8 of 11 checks passed
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.

2 participants