Skip to content

Require real path#5121

Merged
headius merged 1 commit intojruby:masterfrom
ChrisBr:bug/require-expanded
Apr 18, 2018
Merged

Require real path#5121
headius merged 1 commit intojruby:masterfrom
ChrisBr:bug/require-expanded

Conversation

@ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented Mar 27, 2018

expand load paths to real paths to get rid of duplicate loading from
symbolic-linked directories. [Feature #10222]
ruby/ruby@b6d3927

This fixes

test/mri/ruby/test_require.rb#test_symlink_load_path

Deletes obsolete spec/regression/GH-1940_symlink_load_path_should_not_expand_in_FILE_spec.rb

#5109 #5117

expand load paths to real paths to get rid of duplicate loading from
symbolic-linked directories. [Feature #10222]
ruby/ruby@b6d3927

This fixes

test/mri/ruby/test_require.rb#test_symlink_load_path

Deletes obsolete spec/regression/GH-1940_symlink_load_path_should_not_expand_in_FILE_spec.rb

jruby#5109 jruby#5117
@headius headius merged commit ed3dd5f into jruby:master Apr 18, 2018
@headius headius added this to the JRuby 9.2.0.0 milestone Apr 18, 2018
@headius
Copy link
Member

headius commented Apr 20, 2018

Grr...it's still failing. Herre's the error I see...it's a symlinked jar file that should be loaded as a jar file, but because of traversing the link it tries to load as a Ruby file.

test:

     [exec]   Java::OrgJrubyEmbed::EvalFailedException: (SyntaxError) /home/travis/build/jruby/jruby/test/jruby/jarwithoutextension:1: Invalid char `\3' ('') in expression
     [exec]   PK�;c�7	�META-INF/���PK�PK�;c�7�META-INF/MANIFEST.MF�M��LK-.
     [exec] K-*��ϳR0�3��r.JM,IM�u��	������+h8���*8��������(x�%�i�r�r�PK�%�tFFPK�/c�7�hello_from_jar.rbS�H���W�UP��T��PK�m!���PK��org.jruby.embed.internal.EmbedEvalUnitImpl.run(org/jruby/embed/internal/EmbedEvalUnitImpl.java:131)
     [exec] org.jruby.embed.ScriptingContainer.runUnit(org/jruby/embed/ScriptingContainer.java:1295)
     [exec] org.jruby.embed.ScriptingContainer.runScriptlet(org/jruby/embed/ScriptingContainer.java:1288)

It is from the JRuby-specific test suite, so maybe it's possible that this is not correct behavior?

I believe the issue is that, while it's fine to traverse the link for the file contents, it should still make its decision about what kind of file it is based on the first found filename...maybe?

I'm going to let you try to fix it. You can run the one test with jruby -I. test/jruby/test_load.rb -n test_symlinked_jar.

@headius
Copy link
Member

headius commented Apr 20, 2018

Ping @ChrisBr in case the comment didn't do it :-D

@ChrisBr
Copy link
Contributor Author

ChrisBr commented Apr 20, 2018

@headius thanks for the heads up! I will have a look at it tonight!

ChrisBr added a commit to ChrisBr/jruby that referenced this pull request Apr 23, 2018
Introduced in jruby#5121.
Ruby 2.5 loads now the real path of symlinked libraries.
We will now use the file extension of the symlink
to decide what ResourceLibrary to load.
ChrisBr added a commit to ChrisBr/jruby that referenced this pull request Apr 23, 2018
Introduced in jruby#5121.
Ruby 2.5 loads now the real path of symlinked libraries.
We will now use the file extension of the symlink
to decide what ResourceLibrary to load.
headius pushed a commit that referenced this pull request Apr 24, 2018
Introduced in #5121.
Ruby 2.5 loads now the real path of symlinked libraries.
We will now use the file extension of the symlink
to decide what ResourceLibrary to load.

Signed-off-by: Charles Oliver Nutter <headius@headius.com>
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

Successfully merging this pull request may close these issues.

2 participants