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

no such file to load -- ffi in 9.1.2.0 jruby.jar #3943

Closed
yamam opened this issue May 30, 2016 · 4 comments
Closed

no such file to load -- ffi in 9.1.2.0 jruby.jar #3943

yamam opened this issue May 30, 2016 · 4 comments

Comments

@yamam
Copy link

yamam commented May 30, 2016

Environment

Windows 7 SP1 32bit
jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) Client VM 25.91-b14 on 1.8.0_91-b14 +jit [mswin32-x86]

Expected Behavior

public class JavaTest {
  public static void main(String[] args)  {
    (new org.jruby.embed.ScriptingContainer()).runScriptlet("");
  }
}

compile

javac -cp c:/jruby-9.1.2.0/lib/jruby.jar JavaTest.java

exec

java -cp "c:/jruby-9.1.2.0/lib/jruby.jar;." JavaTest

No exception occurs.

Actual Behavior

Exception in thread "main" org.jruby.exceptions.RaiseException: (LoadError) no s
uch file to load -- ffi
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:944)
        at RUBY.<top>(uri:classloader:/jruby/kernel/file.rb:4)
        at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:962)
        at RUBY.<top>(file:/C:/jruby-9.1.2.0/lib/jruby.jar!/jruby/kernel.rb:1)
@ahorek
Copy link
Contributor

ahorek commented May 31, 2016

@headius
Copy link
Member

headius commented May 31, 2016

We may want to do something to improve this. Perhaps we should start including all the FFI bits in the normal JRuby jar? We are starting to leverage it more for core functionality (like File::symlink) and the base JRuby jar needs to be able to boot on Windows without the complete bits.

@enebo What do you think?

@headius
Copy link
Member

headius commented Aug 15, 2016

The workaround today would be to use the jruby-complete jar or add the jruby-stdlib jar to classpath.

However, we should consider doing one of two things:

  • Either: Include in the base jruby.jar everything JRuby itself needs to boot. This would include FFI, parts of jruby/* in stdlib. It might also include RubyGems and did_you_know.
  • Or: gracefully fail over to non-native logic when we can't boot FFI at startup, rather than failing to boot altogether.

It appears that the Windows use of FFI may be the only one we need to patch around, so I'm going to go that route for now.

@headius
Copy link
Member

headius commented Aug 15, 2016

@enebo I've pushed my fix above, but I still wonder if perhaps we should be packing FFI into the JRuby base jar. I guess we only need it for Windows symlink right now, but we might need it for more things in the future and it feels crippling to disable chunks of core functionality with stdlib isn't there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants