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 9.1.2.0 not working on windows server 2003/2003 R2 #3998

Closed
TheSynthMaster opened this issue Jul 7, 2016 · 10 comments
Closed

JRuby 9.1.2.0 not working on windows server 2003/2003 R2 #3998

TheSynthMaster opened this issue Jul 7, 2016 · 10 comments

Comments

@TheSynthMaster
Copy link

jruby 32 bit, version 9.1.2.0

windows server 2003 32 bit, 2003 R2 32 bit

new installation of jruby, only preinstalled gems, the command gem list return the following output

C:\JRAILS1\APPLIC1\ASSETS~1>gem list

FFI::NotFoundError: Function 'CreateSymbolicLinkW' not found in [kernel32]
attach_function at C:/jrails4_update/jruby-9.1.2.0/lib/ruby/stdlib/ffi/library.rb:241
attach_pfunc at uri:classloader:/jruby/kernel/file.rb:25
module:Functions at uri:classloader:/jruby/kernel/file.rb:31
module:File at uri:classloader:/jruby/kernel/file.rb:16
module:Windows at uri:classloader:/jruby/kernel/file.rb:8
module:JRuby at uri:classloader:/jruby/kernel/file.rb:7
at uri:classloader:/jruby/kernel/file.rb:6
load at org/jruby/RubyKernel.java:962
at file:/C:/jrails4_update/jruby-9.1.2.0/lib/jruby.jar!/jruby/kernel.rb:1

On a windows server 2008 64 bit server no problems...

Jruby 1.7.23 working on the 2003 machines

@mprins
Copy link
Contributor

mprins commented Jul 8, 2016

windows server 2003 32 bit, 2003 R2 32 bit

This is like running windows XP right?... why upgrade a runtime and not your OS

@TheSynthMaster
Copy link
Author

No, this is like running windows server 2003 on a production machine for which upgrading to 2008-2012 will cost circa 10k euros...

@headius
Copy link
Member

headius commented Jul 11, 2016

Sadly, this function appears to have been added in Windows Server 2008.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa363866(v=vs.85).aspx

I know @djberg96 has recommended not supporting anything this old, but perhaps on older Windows we should just behave like MRI did before adding Windows symlink support? Thoughts?

@headius
Copy link
Member

headius commented Jul 11, 2016

FWIW, you get this error now because CRuby added File.symlink support for Windows in Ruby 2.3, and we had to follow suit using @djberg96's FFI-based code. That code only works on Windows systems where CreateSymbolicLink is supported.

@headius headius changed the title Jruby 9.1.2.0 not working on windows server 2003/2003 R2 JRuby 9.1.2.0 not working on windows server 2003/2003 R2 Jul 11, 2016
@TheSynthMaster
Copy link
Author

There's a way by installing some sw package or upgrade on the server to implement that function in windows server 2003?

@headius
Copy link
Member

headius commented Jul 12, 2016

@PanDar1 No, I don't believe so. The best we could do would be to modify JRuby to have pre-2.3 behavior for symlink on those platforms.

@headius headius added this to the JRuby 9.1.3.0 milestone Jul 12, 2016
@enebo
Copy link
Member

enebo commented Jul 12, 2016

@headius as RG works now we have to implement something for symlink?. I believe older versions of Ruby also will not work with newer RG on windows because of this (unless something has changed).

@PanDar1 you can work around this by using an older version of rubygems for now.

@headius
Copy link
Member

headius commented Aug 11, 2016

It looks like MRI defines its stub "not implemented" method for symlink on platforms where the latter is not supported. We can force the symlink method to be "not implemented" when running on Windows. Then, at least RubyGems can be patched to check for symlink, if it doesn't already.

@headius
Copy link
Member

headius commented Aug 11, 2016

Correction...we can set it to not implemented if it's unsupported on a given platform.

@headius
Copy link
Member

headius commented Aug 11, 2016

@PanDar1 Please test the fix I just pushed. I skip the symlink definition completely on Windows when CreateSymbolicLinkW is not available.

@djberg96 This is not a beautiful way to do it, but win32-ffi could perhaps wrap just the symlink definition and skip it when appropriate.

It should be available in tonight's snapshot build at http://ci.jruby.org, or you can build master yourself.

knoxg added a commit to randomnoun/jessop that referenced this issue Jul 18, 2020
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

4 participants