'groovy --version' command fails. Issue goes from this line of stack trace: https://github.com/apache/groovy/blob/GROOVY_2_4_5/src/main/org/codehaus/groovy/reflection/GeneratedMetaMethod.java#L177 . Reading of 'META-INF/dgminfo' fails there. The cause of which is the lack of 'dgminfo' file in groovy.jar: # unzip -l /usr/share/groovy/lib/groovy.jar 'META-INF/*' Archive: /usr/share/groovy/lib/groovy.jar Length Date Time Name --------- ---------- ----- ---- 0 01-18-2016 17:29 META-INF/ 68 01-18-2016 17:29 META-INF/MANIFEST.MF --------- ------- 68 2 files Reproducible: Always Steps to Reproduce: # emerge dev-java/groovy # groovy --version Actual Results: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:159) at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) at java.io.BufferedInputStream.read(BufferedInputStream.java:265) at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:337) at java.io.DataInputStream.readUTF(DataInputStream.java:589) at java.io.DataInputStream.readUTF(DataInputStream.java:564) at org.codehaus.groovy.reflection.GeneratedMetaMethod$DgmMethodRecord.loadDgmInfo(GeneratedMetaMethod.java:177) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:185) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:95) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:73) at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36) at groovy.ui.GroovyMain.processArgs(GroovyMain.java:123) at groovy.ui.GroovyMain.main(GroovyMain.java:109) Groovy Version: JVM: 1.8.0_66 Vendor: Oracle Corporation OS: Linux Expected Results: Groovy Version: 2.4.5 JVM: 1.8.0_66 Vendor: Oracle Corporation OS: Linux
Created attachment 423314 [details] emerge --info
Created attachment 423316 [details] build.log
Thanks a lot for filing this bug report and your thorough analysis. I did encounter this problem too after compiling but didn't dig further into it. There's a function in the Java eclasses to add additional resources to jar files so this might be solution.
It's going to be harder than I thought... https://github.com/apache/groovy/blob/89135be7c627eba8fc992b9b37ff33ba062e4e97/build.gradle#L353 Basically a gradle task generates this dgminfo file prior to compile the final jar (I guess?). !_! Does it make ANY sense? No. But let's try to work out this bug anyway. As discussed we James yesterday in the IRC channel: [12:46:53] [ @monsieurp ] so how would you proceed? as far as I can tell, if we want to fix this issue, we'll have to write some Java code, compile it and execute it at compile time, like the exceptionutils class to which he replied: [12:47:14] [ @Chewi ] it was just a problem with --version, right? [12:48:05] [ @monsieurp ] yes [12:48:46] [ @Chewi ] that doesn't sound like the end of the world so either it can wait or you could investigate if there's a way to run gradle just to do these nasty bits without doing the whole build 2 possible solutions: - write a patch/class that generates the dmginfo file (compile + run in the ebuild) (we already do that with ExceptionUtils.java, see the ebuild) - have gradle run the "dmgConverter" task Pick your choice.
(In reply to Patrice Clement from comment #4) > 2 possible solutions: > - write a patch/class that generates the dmginfo file (compile + run in the > ebuild) (we already do that with ExceptionUtils.java, see the ebuild) > - have gradle run the "dmgConverter" task > > Pick your choice. But gradle is not supported by portage (https://wiki.gentoo.org/wiki/Gentoo_Java_Packing_Policy#Gradle) so second way is not available.
I get this exception on almost every groovy invocation (for example, when doing groovy -e 'println("abc")'). So it's not only --version that is affected.
Package removed.