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

Require order appears to impact JRuby extensions [9k] #2521

Closed
headius opened this issue Jan 27, 2015 · 3 comments
Closed

Require order appears to impact JRuby extensions [9k] #2521

headius opened this issue Jan 27, 2015 · 3 comments

Comments

@headius
Copy link
Member

headius commented Jan 27, 2015

It appears something in our load logic is causing extensions to have some sort of load-order dependency.

Gem install the PageRankr gem, and you can have this sort of fun too:

~/projects/jruby $ jruby -e "require 'page_rankr'"
NameError: uninitialized constant Nokogiri::XERCES_VERSION
  const_missing at org/jruby/RubyModule.java:2935
        to_hash at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/nokogiri-1.6.6.2-java/lib/nokogiri/version.rb:73
         (root) at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/nokogiri-1.6.6.2-java/lib/nokogiri/version.rb:99
         (root) at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
        require at org/jruby/RubyKernel.java:954
        require at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:69
         (root) at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/nokogiri-1.6.6.2-java/lib/nokogiri.rb:31
        require at org/jruby/RubyKernel.java:954
         (root) at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
        require at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:121
        require at org/jruby/RubyKernel.java:954
         (root) at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/PageRankr-4.4.0/lib/page_rankr/tracker.rb:1
         (root) at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
        require at org/jruby/RubyKernel.java:954
        require at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:121
         (root) at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/PageRankr-4.4.0/lib/page_rankr/backlink.rb:1
        require at org/jruby/RubyKernel.java:954
         (root) at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
        require at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:121
        require at org/jruby/RubyKernel.java:954
         (root) at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/PageRankr-4.4.0/lib/page_rankr/backlinks/alexa.rb:1
         (root) at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
        require at org/jruby/RubyKernel.java:954
        require at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:121
         (root) at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/PageRankr-4.4.0/lib/page_rankr/backlinks.rb:2

However, if you require nokogiri before page_rankr, it succeeds.

It could be related to load path/loaded features/extension service changes (e.g. dependency loading in RubyGems might be causing the Nokogiri ext to not load).

@headius headius added this to the 9.0.0.0.pre2 milestone Jan 27, 2015
@mkristian
Copy link
Member

hmm - I can not reproduce it and github head with PageRankr-4.4.0

  • nokogiri-1.6.6.2-java, it just works. maybe we could compare the
    debug.loadService=true output ?

@bbrowning
Copy link
Contributor

I've seen this as well w/ 9.0.0.0.pre1 and some TorqueBox 4 apps, but I've yet to narrow down the exact cause.

@headius
Copy link
Member Author

headius commented Apr 17, 2015

This was almost certainly due to RubyGems path-canonicalization messing with our Java exts. I had to fix that again for Rails, so this one is fixed too (and confirmed).

@headius headius closed this as completed Apr 17, 2015
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

3 participants