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
pandar1 opened this Issue Jul 7, 2016 · 10 comments

Comments

Projects
None yet
4 participants
@pandar1

pandar1 commented Jul 7, 2016

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

This comment has been minimized.

Show comment
Hide comment
@mprins

mprins Jul 8, 2016

Contributor

windows server 2003 32 bit, 2003 R2 32 bit

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

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

@pandar1

This comment has been minimized.

Show comment
Hide comment
@pandar1

pandar1 Jul 8, 2016

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

pandar1 commented Jul 8, 2016

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

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Jul 11, 2016

Member

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?

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

This comment has been minimized.

Show comment
Hide comment
@headius

headius Jul 11, 2016

Member

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.

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 from Jruby 9.1.2.0 not working on windows server 2003/2003 R2 to JRuby 9.1.2.0 not working on windows server 2003/2003 R2 Jul 11, 2016

@pandar1

This comment has been minimized.

Show comment
Hide comment
@pandar1

pandar1 Jul 12, 2016

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

pandar1 commented Jul 12, 2016

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

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Jul 12, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Jul 12, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 11, 2016

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 11, 2016

Member

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

Member

headius commented Aug 11, 2016

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

@headius headius closed this in 623b537 Aug 11, 2016

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 11, 2016

Member

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

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.

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