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

FFI not working on Java 9 MacOS #4824

Closed
shado23 opened this Issue Oct 19, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@shado23

shado23 commented Oct 19, 2017

It looks like it's expecting "darwin-x86_64", but now somehow getting "x86_64-darwin".

$ name -a
Darwin imac 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
$ java -version
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
$ jruby -v -w -rffi -e 'p FFI::Platform::ARCH'
jruby 9.1.13.0 (2.3.3) 2017-09-06 8e1c115 Java HotSpot(TM) 64-Bit Server VM 9.0.1+11 on 9.0.1+11 +jit [darwin-x86_64]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.io.FilenoUtil to method sun.nio.ch.SelChImpl.getFD()
WARNING: Please consider reporting this to the maintainers of org.jruby.util.io.FilenoUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
LoadError: Unsupported platform: x86_64-darwin
  require at org/jruby/RubyKernel.java:955
  require at /usr/local/Cellar/jruby/9.1.13.0/libexec/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:59
   <main> at /usr/local/Cellar/jruby/9.1.13.0/libexec/lib/ruby/stdlib/ffi/ffi.rb:69
  require at org/jruby/RubyKernel.java:955
   (root) at /usr/local/Cellar/jruby/9.1.13.0/libexec/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
   <main> at /usr/local/Cellar/jruby/9.1.13.0/libexec/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:59
  require at org/jruby/RubyKernel.java:955
   (root) at /usr/local/Cellar/jruby/9.1.13.0/libexec/lib/ruby/stdlib/ffi.rb:1
@shado23

This comment has been minimized.

Show comment
Hide comment
@shado23

shado23 Oct 26, 2017

For comparison this is what I get on Java 8, where it works:

$ jruby -v -w -rffi -e 'p FFI::Platform::ARCH'
jruby 9.1.13.0 (2.3.3) 2017-09-06 8e1c115 Java HotSpot(TM) 64-Bit Server VM 25.122-b04 on 1.8.0_122-ea-b04 +jit [darwin-x86_64]
"x86_64"

shado23 commented Oct 26, 2017

For comparison this is what I get on Java 8, where it works:

$ jruby -v -w -rffi -e 'p FFI::Platform::ARCH'
jruby 9.1.13.0 (2.3.3) 2017-09-06 8e1c115 Java HotSpot(TM) 64-Bit Server VM 25.122-b04 on 1.8.0_122-ea-b04 +jit [darwin-x86_64]
"x86_64"
@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Oct 26, 2017

Member

It appears to work for me here:

$ jruby -Xnative.verbose -v -rffi -e 'p FFI::Platform::ARCH'
jruby 9.1.13.0 (2.3.3) 2017-10-26 d40ae60 Java HotSpot(TM) 64-Bit Server VM 9+181 on 9+181 +jit [darwin-x86_64]
Successfully loaded native POSIX impl.
"x86_64"

This is Oracle's build of JDK9. What build is that you're running?

This may have been fixed after 9.1.13.

Member

headius commented Oct 26, 2017

It appears to work for me here:

$ jruby -Xnative.verbose -v -rffi -e 'p FFI::Platform::ARCH'
jruby 9.1.13.0 (2.3.3) 2017-10-26 d40ae60 Java HotSpot(TM) 64-Bit Server VM 9+181 on 9+181 +jit [darwin-x86_64]
Successfully loaded native POSIX impl.
"x86_64"

This is Oracle's build of JDK9. What build is that you're running?

This may have been fixed after 9.1.13.

@headius headius added this to the JRuby 9.1.14.0 milestone Oct 26, 2017

@shado23

This comment has been minimized.

Show comment
Hide comment
@shado23

shado23 Oct 26, 2017

I'm using the Oracle JDK 9.0.1+11 (installed via homebrew cask).

shado23 commented Oct 26, 2017

I'm using the Oracle JDK 9.0.1+11 (installed via homebrew cask).

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Oct 27, 2017

Member

I have reproduced it with JDK 9.0.1 from Oracle. Fix landing shortly.

Member

headius commented Oct 27, 2017

I have reproduced it with JDK 9.0.1 from Oracle. Fix landing shortly.

@shado23

This comment has been minimized.

Show comment
Hide comment
@shado23

shado23 Oct 28, 2017

Great. Thanks a bunch!

shado23 commented Oct 28, 2017

Great. Thanks a bunch!

@headius headius closed this in 29137e1 Oct 30, 2017

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