Bohuslav "Slavek" Kabrda created JRUBY-6488:
-----------------------------------------------
Summary: Load path inconsistencies
Key: JRUBY-6488
URL: https://jira.codehaus.org/browse/JRUBY-6488
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.6.6
Environment: Fedora 17 x86_64
Reporter: Bohuslav "Slavek" Kabrda
Assignee: Thomas E Enebo
Hi,
I'm currently trying to adapt JRuby 1.6.6 for Fedora 17 and I found few things
that are really puzzling me:
In --1.9 mode, I get this from RbConfig::CONFIG
["rubylibprefix", "/usr/share/jruby/lib/ruby"]
["rubylibdir", "/usr/share/jruby/lib/ruby/1.8"]
["sitedir", "/usr/share/jruby/lib/ruby/site_ruby"]
["sitelibdir", "/usr/share/jruby/lib/ruby/site_ruby/1.8"]
["sitearch", "java"]
["sitearchdir", "/usr/share/jruby/lib/ruby/site_ruby/1.8/java"]
["archdir", "/usr/share/jruby/lib/ruby/1.8/java"]
and $:
["/usr/share/jruby/lib/ruby/site_ruby/1.9",
"/usr/share/jruby/lib/ruby/site_ruby/shared",
"/usr/share/jruby/lib/ruby/site_ruby/1.8", "/usr/share/jruby/lib/ruby/1.9"]
First of all, these paths seem to be inconsistent - why do all the paths in
RbConfig include 1.8 and not 1.9? This got me digging even deeper and I found
out, that you set the paths for RbConfig and LoadPaths separately. I think it
is not a good idea - better approach would be to set the paths once in RbConfig
and then use them in LoadPaths, wouldn't it? Another issue is, why are the
rubygems placed under site_ruby/1.8 and not site_ruby/shared, if they are used
by both versions (if they are not, correct me, please)?
My ideas are here:
1) Running --1.8 mode, RbConfig should contain:
["rubylibprefix", "/usr/share/jruby/lib/ruby"]
["rubylibdir", "/usr/share/jruby/lib/ruby/1.8"]
["shareddir", "/usr/share/jruby/lib/ruby/site_ruby/shared"]
["sitedir", "/usr/share/jruby/lib/ruby/site_ruby"]
["sitelibdir", "/usr/share/jruby/lib/ruby/site_ruby/1.8"]
["sitearch", "java"]
["sitearchdir", "/usr/share/jruby/lib/ruby/site_ruby/1.8/java"]
["archdir", "/usr/share/jruby/lib/ruby/1.8/java"]
And load paths should contain sitelibdir, shareddir, rubylibdir
2) Running --1.9 mode, RbConfig should contain:
["rubylibprefix", "/usr/share/jruby/lib/ruby"]
["rubylibdir", "/usr/share/jruby/lib/ruby/1.9"]
["shareddir", "/usr/share/jruby/lib/ruby/site_ruby/shared"]
["sitedir", "/usr/share/jruby/lib/ruby/site_ruby"]
["sitelibdir", "/usr/share/jruby/lib/ruby/site_ruby/1.9"]
["sitearch", "java"]
["sitearchdir", "/usr/share/jruby/lib/ruby/site_ruby/1.9/java"]
["archdir", "/usr/share/jruby/lib/ruby/1.9/java"]
And again, load paths should contain sitelibdir, shareddir, rubylibdir.
3) Move rubygems under shareddir (or under a defined rubygemsdir that would
reside in there).
It may also be nice, if you could add something like
["vendordir", "/usr/share/jruby/lib/ruby/vendor_ruby"]
["vendorlibdir", "/usr/share/jruby/lib/ruby/vendor_ruby/__version__/"]
["vendorarchdir", "/usr/share/jruby/lib/ruby/vendor_ruby/__version/java"]
and add these to load paths for us packagers to place the distribution stuff :)
Thank you very much for reading this through and considering it. If we agree on
some kind of solution, I'll submit a patch.
Bohuslav "Slavek" Kabrda
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email