Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 170058 - dev-java/jruby-0.9.8 emerge results in access violation with FEATURES="-userpriv"
Summary: dev-java/jruby-0.9.8 emerge results in access violation with FEATURES="-userp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Josh Nichols (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-09 04:13 UTC by bme
Modified: 2007-03-11 20:15 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bme 2007-03-09 04:13:06 UTC
compile:

serialize:
[jruby-serialize] Serializing 8 files to /var/tmp/portage/dev-java/jruby-0.9.8/work/jruby-0.9.8/build/classes/jruby

generate-method-classes:
     [java] ACCESS DENIED  mkdir:     /root/.jruby
   [delete] Deleting: /var/tmp/portage/dev-java/jruby-0.9.8/work/jruby-0.9.8/build/__empty.rb

jar-jruby:
      [jar] Building jar: /var/tmp/portage/dev-java/jruby-0.9.8/work/jruby-0.9.8/lib/jruby.jar

jar:

BUILD SUCCESSFUL
Total time: 40 seconds
>>> Source compiled.
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/var/log/sandbox/sandbox-dev-java_-_jruby-0.9.8-23321.log"

mkdir:     /root/.jruby
--------------------------------------------------------------------------------


Reproducible: Always

Steps to Reproduce:
Comment 1 Josh Nichols (RETIRED) gentoo-dev 2007-03-09 13:38:12 UTC
I'm not able to reproduce. Could you please emerge --debug jruby, and attach the log?
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2007-03-09 13:53:56 UTC
(In reply to comment #1)
> I'm not able to reproduce. Could you please emerge --debug jruby, and attach
> the log?
> 

Turn off FEATURES="userpriv" and you should be able to reproduce.
Comment 3 bme 2007-03-09 15:43:58 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > I'm not able to reproduce. Could you please emerge --debug jruby, and attach
> > the log?
> > 
> 
> Turn off FEATURES="userpriv" and you should be able to reproduce.
> 

Another way to reproduce this is to remove the /root/.jruby directory.  If you want the emerge to succeed, you can work around the privilege issue by creating the directory yourself (mkdir /root/.jruby).
Comment 4 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-03-09 16:29:26 UTC
Just add "addpredict /root/.jruby" in src_compile(). This will silence sandbox but still won't allow the mkdir (which doesn't seem fatal for the compilation anyway). if somebody has FEATURES="-sandbox -userpriv" it will be created but that's his fault :) and it doesn't hurt anyway.

BTW there's java-pkg_filter-compiler called in global scope. That's not good, one should use EANT_FILTER_COMPILER variable. But since you will have to create own src_compile() anyway for the addpredict, you can just move the filter-compiler call there too :)
Comment 5 Josh Nichols (RETIRED) gentoo-dev 2007-03-11 20:15:22 UTC
Doing the addpredict is a bit kludgy, since the build process still is trying to create that directory.

The issue is that it checks for jruby.home property, and eventually creates it. The offending bit in the build.xml is:

  <target name="generate-method-classes" depends="serialize">
    <touch file="${build.dir}/__empty.rb" verbose="false"/>
    <java classname="org.jruby.Main" fork="true">
      <classpath refid="build.classpath"/>
      <classpath path="${jruby.classes.dir}"/>
      <sysproperty key="jruby.dump_invocations" value="${jruby.classes.dir}"/>
      <arg value="-rjava"/>
      <arg value="${build.dir}/__empty.rb"/>
    </java>
    <delete file="${build.dir}/__empty.rb" quiet="true"/>
  </target>

If you look at other places where they invoke org.jruby.Main, they specify:

      <jvmarg value="-Djruby.home=${basedir}"/>

but just not here.

So, for now, I just added that. I'll look into making it more generalized, so you don't have worry about adding that when you invoke org.jruby.Main from the build.xml.

Fixed in 0.9.8-r1.