<!-- The actual name of your feature page should look something like: Features/Your_Feature_Name. This keeps all features in the same namespace -->

<!-- The actual name of your feature page should look something like: Features/Your_Feature_Name. This keeps all features in the same namespace -->

−

= Features/JRuby 1.7.1 =

+

= Features/JRuby 1.7 =

== Summary ==

== Summary ==

−

JRuby is an alternative Ruby implementation with fast growing user base due to its great performance in parallel tasks. Although JRuby 1.6.7 is already in Fedora, this feature brings in new major version and better Fedora integration.

+

JRuby is an alternative Ruby implementation with fast growing user base due to its great performance in parallel tasks. Although JRuby 1.6.7 is already in Fedora, this feature brings in new minor version and better Fedora integration.

** Most of the packages that JRuby depends on are in Fedora just because of JRuby, so they can be safely updated.

** Most of the packages that JRuby depends on are in Fedora just because of JRuby, so they can be safely updated.

Line 29:

Line 29:

** Normally, each Ruby implementations ships with its own copy of RubyGems library. This is wrong because a) it's bundling, b) there is no reason why multiple Ruby implementations wouldn't be able to share one RubyGems library. There used to be some differencies in JRuby's copy of RubyGems, but the JRuby upstream has been very cooperative and managed to get them all merged into upstream RubyGems.

** Normally, each Ruby implementations ships with its own copy of RubyGems library. This is wrong because a) it's bundling, b) there is no reason why multiple Ruby implementations wouldn't be able to share one RubyGems library. There used to be some differencies in JRuby's copy of RubyGems, but the JRuby upstream has been very cooperative and managed to get them all merged into upstream RubyGems.

** The integration will require changing Fedora's operating_system.rb (place for distro-specific defaults for RubyGems). This change will result into all Gems with binary extensions having to be recompiled, as the binary extension placement will change. See [1] for current operating_system.rb look and its changes from F18.

** The integration will require changing Fedora's operating_system.rb (place for distro-specific defaults for RubyGems). This change will result into all Gems with binary extensions having to be recompiled, as the binary extension placement will change. See [1] for current operating_system.rb look and its changes from F18.

−

** What should "/usr/bin/ruby" point to? During standard Gem packaging process, the executable files in Gems get shebangs according to the binary that they are packaged with (Ruby => "/usr/bin/ruby"; JRuby => "/usr/bin/jruby"). Therefore executing a Ruby "binary" runs the interpreter that was used for building (or the hardcoded one, which is usually Ruby). Using alternatives for "/usr/bin/ruby" doesn't seem to be a very good option, because alternatives are only switchable on admin level (we want every user to be able to choose the interpreter); also, Ruby and JRuby are not in fact full alternatives, as they for example cannot use same extension Gems. Moreover, all Gems with executables would need to be built for both runtimes and provide alternatives. Therefore Ruby-SIG has come up with solution of having "/usr/bin/ruby" as a bash script, that would allow user to choose the interpreter as first argument (_mri_ or _jruby_), if such a parameter is present. Otherwise it would fall back to a default. For example invoking "ruby_binary _jruby_ --foo=bar" would in fact invoke "/usr/bin/jruby ruby_binary --foo=bar". This bash script will be in a separate package and both Ruby and JRuby will depend on it.

+

** What should "/usr/bin/ruby" point to? During standard Gem packaging process, the executable files in Gems get shebangs according to the binary that they are packaged with (Ruby => "/usr/bin/ruby"; JRuby => "/usr/bin/jruby"). Therefore executing a Ruby "binary" runs the interpreter that was used for building (or the hardcoded one, which is usually Ruby). Using alternatives for "/usr/bin/ruby" doesn't seem to be a very good option, because Ruby and JRuby are not in fact full alternatives, as they for example cannot use same extension Gems (but it still makes sense to allow executing same binaries with them). Also, alternatives are only switchable on admin level (we want every developer with non-root privileges to be able to choose the interpreter). Therefore Ruby-SIG has come up with solution of having "/usr/bin/ruby" as a bash script (currently called rubypick) [2], that allows user to choose the interpreter as first argument on invocation (_mri_ or _jruby_), if such a parameter is present. Otherwise it falls back to a default. For example invoking "ruby_binary _jruby_ --foo=bar" in fact invokes "/usr/bin/jruby ruby_binary --foo=bar". This bash script will be in a separate package and both Ruby and JRuby will depend on it.

+

*** Ruby-SIG knows that this feature might be controversial and we wouldn't want it to stop us from bringing JRuby's power to Fedora (if met with a heavy resistance). So if anyone will suggest a more suitable solution, we'll go with it instead of this one.

+

*** EDIT [Jan 24 2013] Rubypick now also supports choosing runtime using environment variable RUBYPICK (values are also _mri_ or _jruby_ to keep them consistent).

* Changes in packaging

* Changes in packaging

−

** This feature will require some additions to Ruby Packaging Guidelines, the draft can be seen at TODO: pg_draft.

+

** None yet. JRuby will be able to use pure Ruby Gems packaged into RPM out of the box, but packaging of Gems with JRuby extensions is turning out to be very complicated, so the guidelines for it will be postponed to next release (as well as the actual packaging). Users will be still able to install Gems with JRuby extensions, both system-wide (into /usr/local/) and into their home directories.

−

** An example of RubyGem packaged with both C and Java extension can be seen at [2].

The changes only affect Ruby packages in Fedora. Few updated Java packages (jansi, jcodings, jline2, snakeyaml; also some jnr-* dependencies of gradle) may also affect some dependent Java packages - this will have to be discussed with their owners.

The changes only affect Ruby packages in Fedora. Few updated Java packages (jansi, jcodings, jline2, snakeyaml; also some jnr-* dependencies of gradle) may also affect some dependent Java packages - this will have to be discussed with their owners.

+

+

=== New Packaging Guidelines ===

+

Some alterations were made to Ruby Packaging Guidelines. These will prevent breakage by the future introduction of JRuby-specific guidelines. The new draft can be seen at [1]. The draft has been proposed to FPC [2].

+

+

[1] https://fedoraproject.org/wiki/PackagingDrafts/Ruby

+

[2] https://fedorahosted.org/fpc/ticket/242

== How To Test ==

== How To Test ==

Line 61:

Line 68:

1) There is a testing repo at http://bkabrda.fedorapeople.org/jruby/jruby.repo, which can be used to test. Do not install this on your system, due to the changes mentioned above, it would break your standard Ruby installation. This repo is meant to be tested in fedora-19-x86_64 mock chroot, where it can do no harm.

1) There is a testing repo at http://bkabrda.fedorapeople.org/jruby/jruby.repo, which can be used to test. Do not install this on your system, due to the changes mentioned above, it would break your standard Ruby installation. This repo is meant to be tested in fedora-19-x86_64 mock chroot, where it can do no harm.

−

2) The repo packages do not contain all the integration features mentioned above, but provide a functional and usable JRuby installation.

+

2) The repo also contains Ruby and basic set of Gems rebuilt with mentioned modifications (adoption to changes in Fedora-Ruby integration).

== User Experience ==

== User Experience ==

<!-- If this feature is noticeable by its target audience, how will their experiences change as a result? Describe what they will see or notice. -->

<!-- If this feature is noticeable by its target audience, how will their experiences change as a result? Describe what they will see or notice. -->

−

JRuby will be up-to-date, usable and will be able to use Fedora's RPM-packaged RubyGems.

+

JRuby will be up-to-date, usable and will be able to use Fedora's RPM-packaged pure Ruby Gems.

== Dependencies ==

== Dependencies ==

Line 119:

Line 126:

== Contingency Plan ==

== Contingency Plan ==

Reverting to the previous behaviour will always be doable very easily, no harm will be done.

Reverting to the previous behaviour will always be doable very easily, no harm will be done.

+

+

EDIT [Jan 24 2013] Upgrade of JRuby itself is just a normal package upgrade, the Fedora integration bits are the things that might need reverting. These would be reverted by adjusting JRuby spec and rebuilding, so that JRuby would behave just the way it now does.

== Documentation ==

== Documentation ==

Line 134:

Line 143:

−

[[Category:FeaturePageIncomplete]]

+

[[Category:FeatureAcceptedF19]]

<!-- When your feature page is completed and ready for review -->

<!-- When your feature page is completed and ready for review -->

<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->

<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->

<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->

<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->

<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->

<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->

JRuby is an alternative Ruby implementation with fast growing user base due to its great performance in parallel tasks. Although JRuby 1.6.7 is already in Fedora, this feature brings in new minor version and better Fedora integration.

Most of the packages that JRuby depends on are in Fedora just because of JRuby, so they can be safely updated.

Some dependencies are shared with other packages, so they will have to be discussed with their owners (see #Scope).

Integration with Fedora

Normally, each Ruby implementations ships with its own copy of RubyGems library. This is wrong because a) it's bundling, b) there is no reason why multiple Ruby implementations wouldn't be able to share one RubyGems library. There used to be some differencies in JRuby's copy of RubyGems, but the JRuby upstream has been very cooperative and managed to get them all merged into upstream RubyGems.

The integration will require changing Fedora's operating_system.rb (place for distro-specific defaults for RubyGems). This change will result into all Gems with binary extensions having to be recompiled, as the binary extension placement will change. See [1] for current operating_system.rb look and its changes from F18.

What should "/usr/bin/ruby" point to? During standard Gem packaging process, the executable files in Gems get shebangs according to the binary that they are packaged with (Ruby => "/usr/bin/ruby"; JRuby => "/usr/bin/jruby"). Therefore executing a Ruby "binary" runs the interpreter that was used for building (or the hardcoded one, which is usually Ruby). Using alternatives for "/usr/bin/ruby" doesn't seem to be a very good option, because Ruby and JRuby are not in fact full alternatives, as they for example cannot use same extension Gems (but it still makes sense to allow executing same binaries with them). Also, alternatives are only switchable on admin level (we want every developer with non-root privileges to be able to choose the interpreter). Therefore Ruby-SIG has come up with solution of having "/usr/bin/ruby" as a bash script (currently called rubypick) [2], that allows user to choose the interpreter as first argument on invocation (_mri_ or _jruby_), if such a parameter is present. Otherwise it falls back to a default. For example invoking "ruby_binary _jruby_ --foo=bar" in fact invokes "/usr/bin/jruby ruby_binary --foo=bar". This bash script will be in a separate package and both Ruby and JRuby will depend on it.

Ruby-SIG knows that this feature might be controversial and we wouldn't want it to stop us from bringing JRuby's power to Fedora (if met with a heavy resistance). So if anyone will suggest a more suitable solution, we'll go with it instead of this one.

EDIT [Jan 24 2013] Rubypick now also supports choosing runtime using environment variable RUBYPICK (values are also _mri_ or _jruby_ to keep them consistent).

Changes in packaging

None yet. JRuby will be able to use pure Ruby Gems packaged into RPM out of the box, but packaging of Gems with JRuby extensions is turning out to be very complicated, so the guidelines for it will be postponed to next release (as well as the actual packaging). Users will be still able to install Gems with JRuby extensions, both system-wide (into /usr/local/) and into their home directories.

JRuby is starting to get very popular among Rubyists, mainly because of its excelent performance in tasks using concurrency (leveraging power of JVM). Because of this, JRuby is mainly used for running web (mostly Ruby on Rails) applications under great stress. Having up-to-date and sanely packaged JRuby is a must for Ruby development and deployment platform.

The changes only affect Ruby packages in Fedora. Few updated Java packages (jansi, jcodings, jline2, snakeyaml; also some jnr-* dependencies of gradle) may also affect some dependent Java packages - this will have to be discussed with their owners.

Some alterations were made to Ruby Packaging Guidelines. These will prevent breakage by the future introduction of JRuby-specific guidelines. The new draft can be seen at [1]. The draft has been proposed to FPC [2].

1) There is a testing repo at http://bkabrda.fedorapeople.org/jruby/jruby.repo, which can be used to test. Do not install this on your system, due to the changes mentioned above, it would break your standard Ruby installation. This repo is meant to be tested in fedora-19-x86_64 mock chroot, where it can do no harm.

2) The repo also contains Ruby and basic set of Gems rebuilt with mentioned modifications (adoption to changes in Fedora-Ruby integration).

Reverting to the previous behaviour will always be doable very easily, no harm will be done.

EDIT [Jan 24 2013] Upgrade of JRuby itself is just a normal package upgrade, the Fedora integration bits are the things that might need reverting. These would be reverted by adjusting JRuby spec and rebuilding, so that JRuby would behave just the way it now does.