jruby / jruby

JRuby, an implementation of Ruby on the JVM
https://www.jruby.org
Other
3.79k stars 922 forks source link

NotImplementedError in solaris10 #6710

Open tod-yangyd opened 3 years ago

tod-yangyd commented 3 years ago

I found that jruby had incompatible problems running on solaris 10. I've seen people find solutions to the same problems as ubuntu, but they don't apply to the solaris version. The error is shown below.

Environment Information

bash-3.00$ uname -a
SunOS mesttux2 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V440
bash-3.00$ jruby -v
jruby 9.2.7.0 (2.5.3) 2019-04-09 8a269e3 Java HotSpot(TM) 64-Bit Server VM 25.291-b10 on 1.8.0_291-b10 +jit [solaris-sparcv9]

Expected Behavior

bash-3.00$ jruby -e "puts File.stat('/').dev_minor"
NotImplementedError: stat.st_dev unsupported or native support failed to load; see http://wiki.jruby.org/Native-Libraries
  dev_minor at org/jruby/RubyFileStat.java:254
     <main> at -e:1
ahorek commented 3 years ago

unfortunately, sparcv9 platform isn't supported

could you help us to add missing bits, since you have access to the platform?

we need a new variant for sparcv9 https://github.com/jnr/jnr-posix/blob/master/src/main/java/jnr/posix/SolarisPOSIX.java#L21 take a look at Linux variant for inspiration https://github.com/jnr/jnr-posix/blob/master/src/main/java/jnr/posix/LinuxPOSIX.java#L47

and constants should be also generated https://github.com/jnr/jnr-constants

tod-yangyd commented 3 years ago

Although I have access to this version of Solaris, but I'm sorry, I can't help you with add missing bits because I'm not good at development.....T_T If there is anything else I can help, please let me know... Thank you for your answer!

ahorek commented 3 years ago

feel free to ask on https://app.element.io/#/room/#jruby:matrix.org for guidance

it shouldn't be hard to support it. Does CRuby work? could you clone https://github.com/jnr/jnr-constants run rake generate:platform and send us generated files?

the second change is about fixing the struct layout for your platform https://github.com/jnr/jnr-posix/pull/168/files it should be based on these files

/usr/include/sys/stat.h
/usr/include/sys/types.h