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 uses absolute pathnames in batch files generated by rubygems #4890

Closed
oxygene opened this issue Dec 10, 2017 · 2 comments
Closed

jruby uses absolute pathnames in batch files generated by rubygems #4890

oxygene opened this issue Dec 10, 2017 · 2 comments

Comments

@oxygene
Copy link

oxygene commented Dec 10, 2017

I'm planning to use jekyll running on jruby on Windows and Linux build machines without internet access. Therefore, I "bootstrap" jruby and install the jekyll gem on a machine with internet access first, and then make a tarball that can be then deployed to the build-machines.

This works fine in principle, however the bin/jekyll.bat files uses an absolute path to jruby like this:

@"C:\Users\username\Documents\path-to-jruby-9.1.15.0\bin\jruby.exe" "%~dpn0" %*

This will of course fail on the build machines when installed to a different path.
It works fine when I change the line to

@"%~dp0jruby.exe" "%~dpn0" %*

The code that generates the line seems to be here:

def windows_stub_script(bindir, bin_file_name)
ruby = Gem.ruby.gsub(/^\"|\"$/, "").tr(File::SEPARATOR, "\\")
return <<-TEXT
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"#{ruby}" "#{File.join(bindir, bin_file_name)}" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"#{ruby}" "%~dpn0" %*
TEXT
end

Could that be changed to use %~dp0 instead of the hardcoded absolute path?

Environment

jruby 9.1.15.0 (2.3.3) 2017-12-07 929fde8 Java HotSpot(TM) Client VM 25.151-b12 on 1.8.0_151-b12 +jit [mswin32-x86]

@oxygene oxygene changed the title jruby uses absolute pathnames in batch files jruby uses absolute pathnames in batch files generated by rubygems Dec 10, 2017
@headius
Copy link
Member

headius commented Dec 11, 2017

That seems like a reasonable change. However we ship an unmodified version of RubyGems, so this isn't a change we'd make in JRuby since it would get wiped out with the first RubyGems update.

I think you should open this with rubygems/rubygems and link to this issue. Once there's released versions of RubyGems with an appropriate fix, we can update and resolve this one.

I'll help make your case if there's any pushback.

@headius
Copy link
Member

headius commented Feb 12, 2018

No recent progress on this and it's really out of our domain. We'll happily pull in the new RubyGems when available. Please open a new issue for that once the original issue is fixed in RubyGems.

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

No branches or pull requests

2 participants