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

Requiring pg_array_parser causes LoadError #3601

Closed
paulmenzel opened this issue Jan 18, 2016 · 10 comments
Closed

Requiring pg_array_parser causes LoadError #3601

paulmenzel opened this issue Jan 18, 2016 · 10 comments

Comments

@paulmenzel
Copy link

Upgrading to JRuby 1.7.23, the following regression was observed.

The following fails with JRuby 1.7.23 but works with JRuby 1.7.19 (and 1.7.16.1).

root@jruby:/jruby-1.7.23# bin/jruby -v
jruby 1.7.23 (1.9.3p551) 2015-11-24 f496dd5 on OpenJDK 64-Bit Server VM 1.7.0_75-b13 +jit [linux-amd64]
root@jruby:/jruby-1.7.23# bin/gem install pg_array_parser
Fetching: pg_array_parser-0.0.9-java.gem (100%)
Successfully installed pg_array_parser-0.0.9-java
1 gem installed
root@jruby:/jruby-1.7.23# bin/jirb
irb(main):001:0> require 'pg_array_parser'
LoadError: no such file to load -- pgArrayParser/pg_array_parser_engine
        from org/jruby/RubyKernel.java:1040:in `require'
        from /jruby-1.7.23/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /jruby-1.7.23/lib/ruby/gems/shared/gems/pg_array_parser-0.0.9-java/lib/pg_array_parser.rb:7:in `PgArrayParser'
        from /jruby-1.7.23/lib/ruby/gems/shared/gems/pg_array_parser-0.0.9-java/lib/pg_array_parser.rb:4:in `(root)'
        from org/jruby/RubyKernel.java:1040:in `require'
        from /jruby-1.7.23/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in `(root)'
        from /jruby-1.7.23/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:128:in `require'
        from org/jruby/RubyKernel.java:1079:in `eval'
        from (irb):1:in `evaluate'
        from org/jruby/RubyKernel.java:1479:in `loop'
        from org/jruby/RubyKernel.java:1242:in `catch'
        from org/jruby/RubyKernel.java:1242:in `catch'
        from bin/jirb:13:in `(root)'
@mkristian
Copy link
Member

the extension does not get loaded. replacing require 'pgArrayParser/pg_array_parser_engine' with an explicit loading Java::pgarrayparser::PgArrayParserEngineService.new.basic_load JRuby.runtime works.

but I am not sure how this require 'pgArrayParser/pg_array_parser_engine' should work. guess need to find the breaking commit

@paulmenzel
Copy link
Author

Thank you for the quick response. Do you have a way to do this bisection? Is there, for example, a Docker image, where all the build dependencies are installed and where git bisect can easily be run in?

@mkristian
Copy link
Member

indeed bisecting can be difficult when the SNAPSHOT dependencies are not already in the local maven repository as they disappear with the release of the dependency. not sure how to go about it but we do not have any Docker image :(

@kares
Copy link
Member

kares commented Jan 19, 2016

believe this was never properly documented and it just might have been a side effect that such ext loading worked previously. and since its not working in 9K either I'm going to fire-up a PR asking for a new gem release with a fix.

@mkristian
Copy link
Member

I have to agree with @kares that the usage pattern looks quite far away what we do with the new load-service on 9K that the better approach is to fix the gem to work with the latest 1.7.x and 9K versions.

@paulmenzel
Copy link
Author

@kares, @mkristian, interesting. Unfortunately, I don’t know anything about that.

I suppose the line causing the error is require 'pgArrayParser/pg_array_parser_engine'?

How does it need to be changed above? Is there a guide line?

@kares
Copy link
Member

kares commented Jan 19, 2016

I'm going to fire-up a PR asking for a new gem release with a fix.

here it is: DavyJonesLocker/pg_array_parser#11 ... hopefully @DockYard will respond with a new version

@paulmenzel
Copy link
Author

@kares, thank you very much!

@kares
Copy link
Member

kares commented Jan 19, 2016

work-around to load current pg_array_parser (working on JRuby 1.7.22) :

# work-around for require 'pg_array_parser' from gem <= 0.0.9
$LOADED_FEATURES << 'pgArrayParser/pg_array_parser_engine'
require 'pg_array_parser'
# ext loading require 'pgArrayParser/pg_array_parser_engine' replacement :
Java::pgarrayparser.PgArrayParserEngineService.new.basicLoad JRuby.runtime

@headius headius closed this as completed Jan 21, 2016
@headius
Copy link
Member

headius commented Jan 21, 2016

Closing because it doesn't seem to be our issue.

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

No branches or pull requests

4 participants