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

Requiring a bare file from current directory works unexpectedly #3049

Closed
eregon opened this Issue Jun 15, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@eregon
Member

eregon commented Jun 15, 2015

test.rb:

puts "BUG"
$ bin/jruby -e 'require "test"'

This should not find the file (well, unless "." is in $: but it is not) and raise a LoadError.

The last update to RubySpec revealed the bug.
9da2c2c should be revert once it is fixed.

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Jun 15, 2015

Member

This is a side effect of our desire to present both Ruby and Java command-line semantics. When running the "java" command at the command line, the current directory is added to the classpath. We do the same in our launcher. This causes Ruby files to be accessible because they can be found via classloader searching.

I'm not opposed to removing this classpath entry, but it would be a change from how the "jruby" command has run for many years.

Member

headius commented Jun 15, 2015

This is a side effect of our desire to present both Ruby and Java command-line semantics. When running the "java" command at the command line, the current directory is added to the classpath. We do the same in our launcher. This causes Ruby files to be accessible because they can be found via classloader searching.

I'm not opposed to removing this classpath entry, but it would be a change from how the "jruby" command has run for many years.

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Jun 15, 2015

Member

I did removed this java "feature" on my https://github.com/jruby/jruby/tree/test-dir-globs-on-uri-classloader branch where I want to move the last bit of the old "LoadService" into the new one.

I always thought this is the desired feature since we have already such a test which does not fail for other reasons (ruby PWD != java PWD)

but whatever is decided here I would incorporate it in the above branch.

Member

mkristian commented Jun 15, 2015

I did removed this java "feature" on my https://github.com/jruby/jruby/tree/test-dir-globs-on-uri-classloader branch where I want to move the last bit of the old "LoadService" into the new one.

I always thought this is the desired feature since we have already such a test which does not fail for other reasons (ruby PWD != java PWD)

but whatever is decided here I would incorporate it in the above branch.

@enebo enebo added this to the JRuby 9.0.0.0.rc2 milestone Jul 6, 2015

@enebo enebo added the JRuby 9000 label Jul 6, 2015

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Jul 6, 2015

Member

fixed with #3073 which also added a test for this

Member

mkristian commented Jul 6, 2015

fixed with #3073 which also added a test for this

@mkristian mkristian closed this Jul 6, 2015

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