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.2.0.0 canonicalizes paths in $" and __FILE__, making bundle exec fail when installed by RVM #5240

Open
eregon opened this Issue Jul 6, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@eregon
Member

eregon commented Jul 6, 2018

Paths in $" and __FILE__ are canonicalized in JRuby 9.2.0.0.
They are not in MRI and in JRuby 9.1.16.0.
We have the same bug in TruffleRuby (oracle/truffleruby#1383).

This also causes bundle exec rake to fail when JRuby is installed with latest RVM, which installs RVM in a gem path with a symlink in it (GEM_PATH=/home/eregon/.rvm/gems/jruby-9.2.0.0:/home/eregon/.rvm/gems/jruby-9.2.0.0@global, the ...@global is a symlink), and Bundler then fails to detect its own lib path in $:, leading to removing it and further autoload/require of bundler files to fail.
See oracle/truffleruby#1383 (comment) for details as this is very condensed description.

I'll write a spec for this behavior.

Environment

Provide at least:

  • jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.151-b12 on 1.8.0_151-b12 +jit [linux-x86_64]
  • Linux
@eregon

This comment has been minimized.

Member

eregon commented Jul 9, 2018

Specs in oracle/truffleruby@09cac1a

It's actually more complex than that since Ruby 2.4.4: on require "foo/bar", the foo/bar.rb part is not canonicalized, but the entry in $LOAD_PATH with that file in it is canonicalized.

So this essentially needs a fix in Bundler (bundler/bundler#6502) and/or RVM (to avoid symlinks in GEM_PATH.).

@headius

This comment has been minimized.

Member

headius commented Nov 12, 2018

Note that this is also causing "issues" when exceptions are raised from symlink-pathed files, as seen in #5436. Unclear how critical that particular case is, though, since it was only found due to error path-inspecting specs in Pry.

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