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

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

Comments

Projects
None yet
3 participants
@yamam

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

This comment has been minimized.

Show comment
Hide comment
@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius May 31, 2016

Member

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?

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 headius added this to the JRuby 9.1.3.0 milestone May 31, 2016

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 15, 2016

Member

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.

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 headius closed this in b8739c1 Aug 15, 2016

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 15, 2016

Member

@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.

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