Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 442230 - =dev-java/jruby- version bump
Summary: =dev-java/jruby- version bump
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Ruby Team
Keywords: PMASKED
Depends on: 472222 472326 495018
Blocks: 445126
  Show dependency tree
Reported: 2012-11-07 18:30 UTC by Gian
Modified: 2018-12-26 23:13 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---

jruby-1.7.4.ebuild (file_442230.txt,6.34 KB, text/plain)
2013-06-03 21:00 UTC, Tom Wijsman (TomWij) (RETIRED)
files/jruby-1.7.4-bash-launcher.patch (file_442230.txt,5.38 KB, patch)
2013-06-03 21:01 UTC, Tom Wijsman (TomWij) (RETIRED)
Details | Diff
jruby-1.7.4.ebuild (file_442230.txt,6.35 KB, text/plain)
2013-06-06 11:13 UTC, Tom Wijsman (TomWij) (RETIRED)

Note You need to log in before you can comment on or make changes to this bug.
Description Gian 2012-11-07 18:30:02 UTC
JRuby 1.7.0 has been released on 2012/10/22. 

Reproducible: Always
Comment 1 Hans de Graaff gentoo-dev Security 2012-11-08 07:09:32 UTC
From the ruby side we need to decide how we want to handle the fact that jruby now defaults to 1.9 compatibility. We already have many ebuilds with the jruby target, but these all depend on jruby's 1.8 profile. Should we introduce a jruby19 target here?
Comment 2 Alex Belykh 2012-12-06 19:08:31 UTC
JRuby 1.7.1 is out already.
Comment 3 Alex Belykh 2013-01-05 14:09:32 UTC
Don't mean to push, but is there some ETA on this enhancement? Like "in a year", at least? :) Also JRuby 1.7.2 is out.
Comment 4 Hans de Graaff gentoo-dev Security 2013-01-06 09:28:43 UTC
As far as I know nobody is working on this, so we can't give an estimate. It would need someone familiar with the java side of things to get an initial version going. It would be great if someone could volunteer for this.
Comment 5 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-06-03 21:00:32 UTC
Created attachment 350008 [details]

Attaching work in progress, blocking bug with a missing dependency.
Comment 6 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-06-03 21:01:18 UTC
Created attachment 350010 [details, diff]
Comment 7 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-06-06 11:13:12 UTC
Created attachment 350274 [details]

All dependencies are in the Portage tree, though two of them seem to be of a version that are incompatible with jruby. I've tried all three versions (0.1, 0.2, 0.3) for jnr-unixsocket but none helped, perhaps it needs a newer unreleased version? Besides unixsocket, it also throws error in regular expression matching code because some other library is incompatible.

According to ./maven/jruby-core/pom.xml it indeed should be 0.3 of jnr-unixsocket, so I don't think the dependency is necessarily wrong; the rest of them should likely be compared to see if there is something noteworthy. Further investigation needs to be done in order to continue...
Comment 8 Manuel Rüger (RETIRED) gentoo-dev 2014-03-31 01:19:41 UTC
Comment 9 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-03 16:27:40 UTC
Comment on attachment 350274 [details]

># Copyright 1999-2012 Gentoo Foundation
># Distributed under the terms of the GNU General Public License v2
># $Header: $
>JAVA_PKG_IUSE="doc source test"
>inherit eutils java-pkg-2 java-ant-2
>DESCRIPTION="Java-based Ruby interpreter implementation"
>LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
>KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos"
>IUSE="bsf ssl"
># jffi still needed? Or do we call that jnr-ffi?
>#  jnr-ffi depends on jffi which depends on libffi
>	>=dev-java/joni-1.1.3:0
>	>=dev-java/jnr-netdb-1.0:0
>	>=dev-java/jvyamlb-0.2.5:0
>	>=dev-java/jcodings-1.0.5:0
>	dev-java/asm:4
>	dev-java/bcpkix:0
>	dev-java/bcprov:0
>	dev-java/invokebinder:0
>	dev-java/jffi:1.2
>	dev-java/jline:2
>	dev-java/jnr-constants:0
>	dev-java/jnr-ffi:0.7
>	dev-java/jnr-posix:2.4
>	dev-java/jnr-unixsocket:0
>	dev-java/joda-time:0
>	dev-util/jay:0[java]
>	dev-java/nailgun:0
>	dev-java/jgrapht:0
>	dev-java/ant-core:0
>	dev-java/bsf:2.3
>	dev-java/osgi-core-api:0
>	>=dev-java/snakeyaml-1.9:0
>	dev-java/jzlib:1.1"
>	>=virtual/jre-1.6"
># Is jna-posix still needed? Or has that been renamed to jnr-posix?
>#  jna-posix is the original project name which was abononed years ago.
>#  jnr-posix < 1.1.8 are from the original fork
>#  later jnr-posix are from the jnr umbrella project.
>	>=virtual/jdk-1.6
>	test? (
>		dev-java/ant-junit4:0
>		dev-java/ant-trax:0
>		dev-java/junit:4
>		java-virtuals/jdk-with-com-sun
>		dev-java/commons-logging:0
>		dev-java/xalan:0
>	)
>	!!<dev-ruby/jruby-1.3.1-r1"
>PDEPEND="ssl? ( dev-ruby/jruby-openssl )"
># Tests fail.
># Need to stop injecting jar's into classpath.
>EANT_GENTOO_CLASSPATH="ant-core asm-4 bcpkix bcprov bsf-2.3 bytelist \
>invokebinder jnr-constants jay jcodings jffi-1.2 jline-2 joda-time joni \
>jnr-ffi-0.7 jnr-posix-2.4 jnr-netdb jnr-unixsocket jvyamlb nailgun
>jgrapht osgi-core-api snakeyaml jzlib-1.1"
>pkg_setup() {
>	unset RUBYOPT
>	java-pkg-2_pkg_setup
>	local fail
>	for directory in "${GEMS}" "${SITE_RUBY}"; do
>		if [[ -L ${directory} ]]; then
>			eerror "${directory} is a symlink. Please do the following to resolve the situation:"
>			echo 'emerge -an app-portage/gentoolkit'
>			echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > ~/jruby.fix'
>			echo 'emerge -1C $(< ~/jruby.fix)'
>			echo "rm ${directory}"
>			echo 'emerge -1 $(< ~/jruby.fix)'
>			echo 'rm ~/jruby.fix'
>			eerror "For more information, please see"
>			fail="true"
>		fi
>	done
>	if [[ -n ${fail} ]]; then
>		die "Please address the above errors, then run emerge --resume"
>	fi
>java_prepare() {
>	epatch "${FILESDIR}"/${P}-bash-launcher.patch
>	# epatch "${FILESDIR}/1.5.1/build.xml.patch"
>	# We don't need to use Retroweaver. There is a jarjar and a regular jar
>	# target but even with jarjarclean, both are a pain. The latter target
>	# is slightly easier so go with this one.
>	sed -r -i \
>		-e 's/maxmemory="128m"/maxmemory="192m"/' \
>		-e "/RetroWeaverTask/d" \
>		-e "/yecht/! { /<zipfileset .+\/>/d }" \
>		build.xml || die
>	sed -i -e '/Arndt/d' src/org/jruby/
>	# Delete the bundled JARs but keep invokedynamic.jar.
>	# No source is available and it's only a dummy anyway.
>	find build_lib -name "*.jar" ! -name "jsr292-mock.jar" ! -name "yecht.jar" ! -name 'coro-mock-1.0-SNAPSHOT.jar' -delete || die
>src_compile() {
>	# Avoid generating the ri cache since that currently fails.
>	local flags="-Dgenerate-ri-cache.hasrun=true"
>	#local flags=""
>	use bsf && flags="-Dbsf.present=true"
>	export RUBYOPT=""
>	einfo $RUBYOPT
>	#eant jar $(use_doc apidocs) -Djdk1.5+=true ${flags}
>	eant -Djdk1.5+=true ${flags}
>src_test() {
>	if [ ${UID} == 0 ] ; then
>		ewarn 'The tests will fail if run as root so skipping them.'
>		ewarn 'Enable FEATURES="userpriv" if you want to run them.'
>		return
>	fi
>	# Our jruby.jar is unbundled so we need to add the classpath to this test.
>	sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
>	sed -i "s@:refid => 'build.classpath'@:path =>\"#{ENV['JRUBY_CP']}:lib/jruby.jar\"@g" \
>		rakelib/commands.rake || die
>	#sed -i "s@:refid => 'test.class.path'@:path => \"#{ENV['JRUBY_CP']}@g" \
>	#	rakelib/commands.rake || die
>	#bsf optionally depends on jruby, which means that the previously
>	#installed jruby will be added to classpath, nasty things will happen.
>	local cpath=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,},junit-4`
>	cpath="$(echo ${cpath} | sed -e "s_${EROOT}/usr/share/jruby/lib/jruby.jar:__g")"
>	cpath="${cpath}:$(java-pkg_getjars --build-only commons-logging,xalan)"
>	local flags=""
>	use bsf && flags="-Dbsf.present=true"
>	#Clear RUBYOPT
>	export RUBYOPT=""
>	export JRUBY_CP="${cpath}"
>	ANT_TASKS="ant-junit4 ant-trax" \
>		JRUBY_OPTS="" eant test -Djdk1.5+=true -Djruby.bindir=bin \
>		-Dgentoo.classpath="${cpath}" ${flags}
>src_install() {
>	java-pkg_dojar lib/${PN}.jar
>	dodoc README docs/{*.txt,README.*} || die
>	use doc && java-pkg_dojavadoc docs/api
>	use source && java-pkg_dosrc src/org
># Use the bash based launcher to preserve whitespace in arguments.
># Ie allow >jruby -e "puts 'hello'"< to work otherwise
># >jruby -e "\"puts 'hello'\""< is needed.
>#	# We run the sed here in install so that we don't get the wrong
>#	# data during the test phase!
>#	sed \
>#		-e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
>#		-e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
>#		bin/ > "${T}"/jruby
>	newbin bin/jruby.bash jruby
>	dobin bin/j{irb{,_swing},rubyc}
>	insinto "${RUBY_HOME}"
>	doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby}
>	# Remove all the references to RubyGems as we're just going to
>	# install it through dev-ruby/rubygems.
>	find "${ED}${RUBY_HOME}" -type f \
>		'(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
>		-delete || die
Comment 10 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-03 21:31:26 UTC
Sorry for the previous comment, caused by an erroneous click; subsequently I didn't notice that I was creating a comment while marking it obsolete.

+  03 May 2014; Tom Wijsman <>
+  +files/jruby-1.7.12-bash-launcher.patch, +jruby-1.7.12.ebuild,
+  jruby-
+  Version bump to 1.7.12, masked as it is pending review by the Java and Ruby
+  herds; for bug #442230, reported by Gian and in cooperation with mrueg and
+  others.

Anyhow, after some wrangling a masked JRuby 1.7.12 has been added to the Portage tree; I'd like to request that the Ruby and Java herd review this before unmasking, it's a quite huge version jump and there have been a lot of changes.

# Tom Wijsman <> (03 May 2014)
# Needs to be further tested and revised by both Java and Ruby herds. 

It might be possible that the ebuild does too much or does not do enough; but review and early testers can help with pointing that out, as far as my non-existing Ruby knowledge goes it bulids file and the compiler seems like it will accept files. If it still bails out due to a Java issue, feel free to ping us.

Two things I notice; first is that setting RUBYOPT="" seems odd to request from the user so I wonder if we can get rid of that, second is that we might be able to get working tests if we figure out the following:

#  $ bin/testrb test
# /usr/share/jruby/lib/ruby/1.9/yaml/store.rb:1:in `require':
# It seems your ruby installation is missing psych (for YAML output).
# To eliminate this warning, please install libyaml and reinstall your ruby.
# JRuby 1.9 mode only supports the `psych` YAML engine; ignoring `syck`
# NoMethodError: undefined method `to_yaml' for {}:Hash
#        Store at /usr/share/jruby/lib/ruby/1.9/yaml/store.rb:78
#        ...

dev-libs/libyaml is installed; so, perhaps it's a different libyaml required, I might have not built it with that present or the dev-lang/ruby ebuild needs to be looked into to make sure it has libyaml support. Dunno, your terrain... :)
Comment 11 YLD 2014-06-27 20:49:26 UTC
psych ( is a YAML parser using libyaml. It replace syck. It came out with MRI 1.9.2 and is the default since 1.9.3. It looks like Jruby 1.7.x is 1.9.3 compatible.The FAQ jut mentionned --19 option without any others details. 

Psych is the default since Jruby 1.7.1 at least, probably 1.7.0 (see

See also

Syck was binary encoding characters sets Psych is UTF-8 compatible (as MRI 1.9.X), so lots of YAML files may becomes unreadable or corrupted, but solutions exists:
Comment 12 Manuel Rüger (RETIRED) gentoo-dev 2014-08-05 23:44:26 UTC
"JRuby 1.7.13 is our thirteenth update release since JRuby 1.7.0. The primary goal of 1.7 point releases is to fill out any missing compatibility issues with Ruby 1.9.3. The community participation lately has been great. Keep reporting issues and sending pull requests.

Changes of note:

    58 issues fixed for 1.7.13
    jruby-openssl 0.9.5 bundled
    Ability to upgrade jruby-openssl as a gem
    New custom profiler API
    Several BigDecimal fixes
Comment 13 Robin Kauffman 2014-09-08 03:41:04 UTC
Looks like JRuby 1.7.15 is out:

"JRuby 1.7.15 is our fifteenth update release since JRuby 1.7.0. The primary goal of 1.7 point releases is to fill out any missing compatibility issues with Ruby 1.9.3. The community participation lately has been great. Keep reporting issues and sending pull requests.

This release is a quick followup release to JRuby 1.7.14. JRuby 1.7.14 had a mangled jruby-jars release as well as several non-obvious regressions involving our new load service internals. We apologize if these regressions have affected you and recommend all people upgrade to 1.7.15.

Changes of note:

    8 issues fixed for 1.7.15
    Potential memory leak resolved when reloading JRuby apps in Java App servers
    jruby-jars gem did not have their embedded jars within it
    rvm install of jruby would not properly follow gemset symlinks
    Windows exec works again
    lstat did not honor native.enabled property and always invoked native
Comment 14 James Le Cuirot gentoo-dev 2015-09-24 14:16:26 UTC
It's a good thing 1.7.12 was masked. It doesn't work at all. Blows up over missing jcodings and joni classes.
Comment 15 Virgil Dupras (RETIRED) gentoo-dev 2018-10-08 11:55:26 UTC
dev-java/jruby has been removed from the tree last year.
Comment 16 Amel Hodzic 2018-12-26 23:13:20 UTC
For anyone that needs jruby, you can enable the "ag-ops" overlay; install chruby and ruby-install; then execute "ruby-install jruby".