You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There something wrong with where JFFI is looking for its native library on the Mac in JRuby. We are getting the fallback version. You may not notice this in normal JRuby, as it's silently ignored, but in Truffle we require the native version and so we're seeing the error.
$ bin/jruby -X+T -e 'puts 14'
Truffle internal error: java.lang.RuntimeException: Error while calling the constructor of Truffle's RubyContext
java.lang.RuntimeException: Error while calling the constructor of Truffle's RubyContext
at org.jruby.Ruby.loadTruffleContext(Ruby.java:939)
at org.jruby.Ruby.getTruffleContext(Ruby.java:918)
at org.jruby.Ruby.runInterpreter(Ruby.java:871)
at org.jruby.Ruby.runInterpreter(Ruby.java:885)
at org.jruby.Ruby.runNormally(Ruby.java:757)
at org.jruby.Ruby.runFromMain(Ruby.java:574)
at org.jruby.Main.doRunFromMain(Main.java:401)
at org.jruby.Main.internalRun(Main.java:296)
at org.jruby.Main.run(Main.java:225)
at org.jruby.Main.main(Main.java:197)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.jruby.Ruby.loadTruffleContext(Ruby.java:937)
... 9 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder
at jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:282)
at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:36)
at jnr.posix.MacOSPOSIX.<init>(MacOSPOSIX.java:11)
at jnr.posix.POSIXFactory.loadMacOSPOSIX(POSIXFactory.java:147)
at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:118)
at jnr.posix.POSIXFactory.getNativePOSIX(POSIXFactory.java:72)
at org.jruby.truffle.runtime.RubyContext.<init>(RubyContext.java:129)
... 14 more
The error is not actually NoClassDefFoundError - but a static initialiser in there is failing. If you attach a debugger you see whereabouts it's going wrong. It looks like it's looking for the wrong type of file.
There something wrong with where JFFI is looking for its native library on the Mac in JRuby. We are getting the fallback version. You may not notice this in normal JRuby, as it's silently ignored, but in Truffle we require the native version and so we're seeing the error.
The error is not actually NoClassDefFoundError - but a static initialiser in there is failing. If you attach a debugger you see whereabouts it's going wrong. It looks like it's looking for the wrong type of file.
Workaround:
cp lib/jni/Darwin/libjffi-1.2.jnilib lib/jni/Darwin/libjffi-1.2.dylib
The text was updated successfully, but these errors were encountered: