java-pkg_dosrc in /usr/portage/dev-java/antlr/antlr-4.4.ebuild seems to be broken, referring to nonexistent paths in the source tree. Reproducible: Always Steps to Reproduce: 1.emerge -1 antlr (on ~amd64) Actual Results: ... build-jar: [jar] Building jar: /var/tmp/portage/dev-java/antlr-4.4/work/antlr4-4.4/dist/antlr-4.4-complete.jar distribute: BUILD SUCCESSFUL Total time: 23 seconds >>> Source compiled. >>> Test phase [not enabled]: dev-java/antlr-4.4 >>> Install antlr-4.4 into /var/tmp/portage/dev-java/antlr-4.4/image/ category dev-java /var/tmp/portage/dev-java/antlr-4.4/temp/environment: line 2231: pushd: runtime/Java/src/main/java: No such file or directory * ERROR: dev-java/antlr-4.4::gentoo failed (install phase): * problem entering runtime/Java/src/main/java * * Call stack: * ebuild.sh, line 93: Called src_install * environment, line 3939: Called java-pkg_dosrc 'tool/src/org/' 'runtime/Java/src/main/java/org/' * environment, line 2231: Called die * The specific snippet of code: * pushd ${dir_parent} > /dev/null || die "problem entering ${dir_parent}"; * * If you need support, post the output of `emerge --info '=dev-java/antlr-4.4::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-java/antlr-4.4::gentoo'`. !!! When you file a bug report, please include the following information: GENTOO_VM=icedtea-7 CLASSPATH="" JAVA_HOME="/usr/lib64/icedtea7" JAVACFLAGS="-source 1.6 -target 1.6" COMPILER="javac" and of course, the output of emerge --info =antlr-4.4 * The complete build log is located at '/var/tmp/portage/dev-java/antlr-4.4/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-java/antlr-4.4/temp/environment'. * Working directory: '/var/tmp/portage/dev-java/antlr-4.4/work/antlr4-4.4' * S: '/var/tmp/portage/dev-java/antlr-4.4/work/antlr4-4.4' >>> Failed to emerge dev-java/antlr-4.4, Log file: build-jar: [jar] Building jar: /var/tmp/portage/dev-java/antlr-4.4/work/antlr4-4.4/dist/antlr-4.4-complete.jar distribute: BUILD SUCCESSFUL Total time: 23 seconds >>> Source compiled. >>> Test phase [not enabled]: dev-java/antlr-4.4 >>> Install antlr-4.4 into /var/tmp/portage/dev-java/antlr-4.4/image/ category dev-java /var/tmp/portage/dev-java/antlr-4.4/temp/environment: line 2231: pushd: runtime/Java/src/main/java: No such file or directory * ERROR: dev-java/antlr-4.4::gentoo failed (install phase): * problem entering runtime/Java/src/main/java * * Call stack: * ebuild.sh, line 93: Called src_install * environment, line 3939: Called java-pkg_dosrc 'tool/src/org/' 'runtime/Java/src/main/java/org/' * environment, line 2231: Called die * The specific snippet of code: * pushd ${dir_parent} > /dev/null || die "problem entering ${dir_parent}"; * * If you need support, post the output of `emerge --info '=dev-java/antlr-4.4::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-java/antlr-4.4::gentoo'`. !!! When you file a bug report, please include the following information: GENTOO_VM=icedtea-7 CLASSPATH="" JAVA_HOME="/usr/lib64/icedtea7" JAVACFLAGS="-source 1.6 -target 1.6" COMPILER="javac" and of course, the output of emerge --info =antlr-4.4 * The complete build log is located at '/var/tmp/portage/dev-java/antlr-4.4/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-java/antlr-4.4/temp/environment'. * Working directory: '/var/tmp/portage/dev-java/antlr-4.4/work/antlr4-4.4' * S: '/var/tmp/portage/dev-java/antlr-4.4/work/antlr4-4.4' >>> Failed to emerge dev-java/antlr-4.4, Log file: I was able to patch up the ebuild to finish, but I don't know if my new paths were correct, as I don't really understand the purpose of java-pkg_dosrc. My best guess was to change the line to: use source && java-pkg_dosrc tool/src/org/ runtime/Java/src/org/
hi, can you attach your full build.log and emerge --info
Sure. I'll need to undo the ebuild changes and emerge again. I'm going to let the other changes that were blocked by this finish first though, to see if there is any problem.
Created attachment 400812 [details] build.log Here's my own build log. I'm not experiencing a failure so far.
The reason is yours succeeds and mine fails is obvious, your build is not running java-pkg_dosrc. I'm not sure why "use source" returns true forme and not for you I'll post info as soon as I have access to my machine again. The paths tool/src/main/org and runtime/Java/src/main/java/org/ do not exist under the work directory. I'm certain this is what caused the build to fail for me, because after changing those paths it no longer failed. tool/src/org/ and runtime/Java/src/org/ respectively, look like the equivalent in the current source tree.
Okay Joshua. There was indeed a problem with the path passed to java-pkg_dosrc. I too eventually got an error due to a non-existing directory after switching on the USE=source flag. >>> Install antlr-4.4 into /var/tmp/portage/dev-java/antlr-4.4/image/ category dev-java /var/tmp/portage/dev-java/antlr-4.4/temp/environment: line 2144: pushd: tool/src/main: No such file or directory * ERROR: dev-java/antlr-4.4::gentoo failed (install phase): * problem entering tool/src/main It has been fixed. See this diff (yeah I've also refactored use gunit. I personally prefer an if statement rather than a use bla &&. It's a tad more explicit): Index: antlr-4.4.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/dev-java/antlr/antlr-4.4.ebuild,v retrieving revision 1.1 diff -r1.1 antlr-4.4.ebuild 39d38 < use gunit && java-pkg_dolauncher gunit --main org.antlr.v4.gunit.Interp 41,42c40,47 < use source && java-pkg_dosrc tool/src/main/org \ < runtime/Java/src/main/java/org/ --- > if use gunit; then > java-pkg_dolauncher gunit --main org.antlr.v4.gunit.Interp > fi > > if use source; then > java-pkg_dosrc tool/src/org/antlr \ > runtime/Java/src/org/antlr > fi Now, after the build and install processes are finished, here's the image directory content: $ tree /var/tmp/portage/dev-java/antlr-4.4/image /var/tmp/portage/dev-java/antlr-4.4/image └── usr ├── bin │ └── antlr4 └── share └── antlr-4 ├── lib │ └── antlr.jar ├── package.env └── sources └── antlr-src.zip antlr-src.zip should contain antlr sources.. $ unzip -l /var/tmp/portage/dev-java/antlr-4.4/image/usr/share/antlr-4/sources/antlr-src.zip Archive: /var/tmp/portage/dev-java/antlr-4.4/image/usr/share/antlr-4/sources/antlr-src.zip Length Date Time Name --------- ---------- ----- ---- 2512 07-16-2014 21:08 antlr/v4/misc/OrderedHashMap.java 3896 07-16-2014 21:08 antlr/v4/misc/Graph.java 5163 07-16-2014 21:08 antlr/v4/misc/Utils.java 2231 07-16-2014 21:08 antlr/v4/misc/MutableInt.java 5756 07-16-2014 21:08 antlr/v4/misc/CharSupport.java 2004 07-16-2014 21:08 antlr/v4/misc/FrequencySet.java 4221 07-16-2014 21:08 antlr/v4/codegen/DefaultOutputModelFactory.java ... --------- ------- 1875382 369 files .. and it does. + 09 Apr 2015; Patrice Clement <monsieurp@gentoo.org> antlr-4.4.ebuild: + Adjust path passed to java-pkg_dosrc. Fix bug 545916. + You should be all set now. Thanks.
Thanks, Patrice. That should definitely fix the build failure. Just one possible issue. The "org" directory is part of the package name. Think of it like a "top level domain" on the internet. Java uses directory heirarchy to uniquely identify packages. Sort of like the DNS system on the internet, but backwards. for instance here is a package (I picked at random) com/sun/xml/bind/api/errorlistener Packages start with com, org, etc. org/antlr/v4/misc/OrderedHashMap is correct, rather than going deeper down.
Joshua is right, the source zips should start from the top-level package, so org in this case.
Index: antlr-4.4.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/dev-java/antlr/antlr-4.4.ebuild,v retrieving revision 1.2 diff -r1.2 antlr-4.4.ebuild 45,46c45,46 < java-pkg_dosrc tool/src/org/antlr \ < runtime/Java/src/org/antlr --- > java-pkg_dosrc tool/src/org \ > runtime/Java/src/org which now yields the following result: $ unzip -l /var/tmp/portage/dev-java/antlr-4.4/image/usr/share/antlr-4/sources/antlr-src.zip Archive: /var/tmp/portage/dev-java/antlr-4.4/image/usr/share/antlr-4/sources/antlr-src.zip Length Date Time Name --------- ---------- ----- ---- 2512 07-16-2014 21:08 org/antlr/v4/misc/OrderedHashMap.java 3896 07-16-2014 21:08 org/antlr/v4/misc/Graph.java 5163 07-16-2014 21:08 org/antlr/v4/misc/Utils.java 2231 07-16-2014 21:08 org/antlr/v4/misc/MutableInt.java 5756 07-16-2014 21:08 org/antlr/v4/misc/CharSupport.java 2004 07-16-2014 21:08 org/antlr/v4/misc/FrequencySet.java 4221 07-16-2014 21:08 org/antlr/v4/codegen/DefaultOutputModelFactory.java 15755 07-16-2014 21:08 org/antlr/v4/codegen/Target.java 12664 07-16-2014 21:08 org/antlr/v4/codegen/ActionTranslator.java @Joshua: Yes, I know how Java indentifies packages. Thanks for the heads up though ;). It was a silly mistake. There, fixed! + 09 Apr 2015; Patrice Clement <monsieurp@gentoo.org> antlr-4.4.ebuild: + Package sources from top-level. Fix bug 545916. + @James: is Joshua right?