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

Require real path #5121

Merged
merged 1 commit into from Apr 18, 2018

Conversation

Projects
None yet
2 participants
@ChrisBr
Contributor

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

Require real path
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

@headius headius merged commit ed3dd5f into jruby:master Apr 18, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@headius headius added this to the JRuby 9.2.0.0 milestone Apr 18, 2018

@headius

This comment has been minimized.

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

This comment has been minimized.

Member

headius commented Apr 20, 2018

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

@ChrisBr

This comment has been minimized.

Contributor

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

Fix TestLoad#test_symlinked_jar
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

Fix TestLoad#test_symlinked_jar
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 added a commit that referenced this pull request Apr 24, 2018

Fix TestLoad#test_symlinked_jar
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