Issues with MacOS neko rpath resolve ever since 4.3.5 release
Looks like https://github.com/HaxeFoundation/haxe/commit/d9c3eafa92cc7e8afcb642bc415890712c53e8e3 changed some of the behavior for rpath.
Our usage of the library is a bit atypical, as we dont typically run the installer and have been copying the neko dylib into the same folder as the haxelib executable on macs. This has worked until version 4.3.4. I believe the change above made it so it prefers to only load out of essentially /usr/local/lib. This requires us to run sudo cp commands since we cant set fallback paths on mac due to security permissions csrutil.
Can you add searching the local dir first.. or even alternately adding support for loading from the NEKOPATH environment variable as a fallback on Mac (like it does for PC)
Quick note.. adding back previous fallback behavior to check executable directory first should be as easy as adding a second 2nd rpath~ Not sure if checking env var is even allowed on mac...
i.e. changing it from
-Wl,-rpath,$(INSTALL_DIR)/lib
to
-Wl,-rpath,'@executable_path',-rpath,$(INSTALL_DIR)/lib
See https://blog.krzyzanowskim.com/2018/12/05/rpath-what/
For a custom install use case, it should be possible to modify the install path using install_name_tool, e.g. something like:
install_name_tool -rpath /usr/local/lib @executable_path ./haxelib