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

jruby-complete cannot start irb in windows #7547

Closed
rdp opened this issue Dec 30, 2022 · 6 comments
Closed

jruby-complete cannot start irb in windows #7547

rdp opened this issue Dec 30, 2022 · 6 comments
Labels
Milestone

Comments

@rdp
Copy link
Contributor

rdp commented Dec 30, 2022

Environment Information

Provide at least:

java -jar jruby-complete-9.4.0.0.jar -v
jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec1 OpenJDK 64-Bit Server VM 17.0.5+8-LTS on 17.0.5+8-LTS +jit [x86_64-mswin32]

  • Operating system and platform (e.g. uname -a)

uname on windows? :)

ver
Microsoft Windows [Version 10.0.19044.2364]

Expected Behavior

  • Describe your expectation of how JRuby should behave, perhaps by showing how CRuby/MRI behaves.

IRB should work.

Actual Behavior

> java -jar jruby-complete-9.4.0.0.jar -vS irb
jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f OpenJDK 64-Bit Server VM 17.0.5+8-LTS on 17.0.5+8-LTS +jit [x86_64-mswin32]
2022-12-29T23:55:54.120-07:00 [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED' to enable.
io/console not supported; tty will not be manipulated
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/fiddle/jruby.rb:158: warning: assigned but unused variable - size
LoadError: no such file to load -- win32api
Did you mean?  Win32API
          require at org/jruby/RubyKernel.java:1057
          require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85
  <class:Windows> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/reline/windows.rb:56
           <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/reline/windows.rb:3
          require at org/jruby/RubyKernel.java:1057
          require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85
           <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/reline.rb:567
          require at org/jruby/RubyKernel.java:1057
          require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85
           <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:13
          require at org/jruby/RubyKernel.java:1057
          require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85
           <main> at uri:classloader:/META-INF/jruby.home/bin/jirb:10
... 14 levels...
@headius
Copy link
Member

headius commented Jan 4, 2023

It has been a while since I looked at Windows support, but I thought we had a basic win32api. Perhaps it got lost during recent version updates.

@headius headius added the windows label Jan 4, 2023
@enebo
Copy link
Member

enebo commented Jan 16, 2023

This seems to only be an issue with jruby-complete. Seemingly we are not including win32api? Not really sure how that would have changed from 9.3 but the codebases are pretty far apart now. Confirmed locally for me at least 😄

@enebo
Copy link
Member

enebo commented Jan 16, 2023

Both 9.3 and 9.4 jruby-complete have the file but it is named Win32API.rb. I wonder if we did something to case insensitivity/encoding/fs where require 'win32api' will not find Win32API.rb.

@enebo
Copy link
Member

enebo commented Jan 16, 2023

Ok. Significant difference has been found. 9.4 of complete contains reline but 9.3 does not.

As mentioned before there is a file 'Win32API.rb'. Both files have it but only one is calling it during irb (9.4). Case closed?

There is a mystery. If I run irb with an installation of 9.4 it starts up. Why? Is the full install loading readline capabilities different in some way between an install and jruby-complete?

I did poke around enough to see require "win32api" will not work in 9.3 or 9.4 whether from installation or from jruby-complete. I am on NTFS and perhaps it is case sensitive? I somewhat assumed we would still work case insensitive. Having said that I believe either reline or we should rename Win32API to match up.

I am going to rebundle jruby-complete with changed win32api.rb and see if things work but I don't feel this is good enough. Someone make this make sense :)

@enebo
Copy link
Member

enebo commented Jan 16, 2023

renaming it does work fwiw. I still don't get why it works on a full install of 9.4 with the mixed-case name.

@enebo
Copy link
Member

enebo commented Jan 20, 2023

I was wrong about require "Win32API". It will work on in an ordinary install but not from a file loaded via classloading (which is case-sensitive). 9.3 and earlier worked because we were not yet using reline so it was not requiring this file. Fixed in e9d8a73.

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

No branches or pull requests

3 participants