... Cleaning Up Build Directories ... Done Bootstrapping Ant Distribution Error: Could not find or load main class org.apache.tools.ant.launch.Launcher * ERROR: dev-java/ant-core-1.9.13::gentoo failed (compile phase): * build failed * ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.0-desktop-gnome-systemd_abi32+64_20190120-102705 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-8.2.0 * Available Python interpreters, in order of preference: [1] python3.6 [2] python2.7 (fallback) Available Rust versions: [1] rust-1.32.0 * java-config: The following VMs are available for generation-2: *) IcedTea JDK 3.10.0 [icedtea-bin-8] Available Java Virtual Machines: [1] icedtea-bin-8 system-vm emerge -qpvO dev-java/ant-core [ebuild N ] dev-java/ant-core-1.9.13 USE="-doc -source"
Created attachment 562442 [details] emerge-info.txt
Created attachment 562444 [details] dev-java:ant-core-1.9.13:20190121-160051.log
Created attachment 562446 [details] emerge-history.txt
Created attachment 562448 [details] environment
Created attachment 562450 [details] etc.portage.tbz2
Created attachment 562452 [details] temp.tbz2
i cannot reproduce this error. it might have already been fixed by other fixes i introduced the the ant build system. i will mark it as fixed. if the problem persists, please reopen the issue. also, it would be useful to provide log output using JAVA_PKG_DEBUG=yes emerge ... that in fact would be useful for any java package bug report.
Created attachment 562690 [details] build.log using JAVA_PKG_DEBUG=yes
I can repro on my work machine as well. trying to dig into it.
(In reply to Georgy Yakovlev from comment #9) > I can repro on my work machine as well. trying to dig into it. that'd be great. i looked at the debug output but did not find anything useful to dig out why it fails (under some circumstances).
maybe i found a difference. this is output from my pc where ant-core compiles without issues: # env | grep ANT_HOME ANT_HOME=/usr/share/ant but i did not find that variable in the attached environment file. that would affect behavior of their build.sh in the following part: ... REALANTHOME=$ANT_HOME ... if [ "$REALANTHOME" != "" ]; then if $cygwin; then REALANTHOME=`cygpath --windows "$REALANTHOME"` fi ANT_INSTALL="-Dant.install=$REALANTHOME" else ANT_INSTALL="-emacs" fi bootstrap/bin/ant -nouserlib -lib lib/optional "$ANT_INSTALL" $* so in my case the command is this: bootstrap/bin/ant -nouserlib -lib lib/optional "-Dant.install=/usr/share/ant" $* on systems where ANT_HOME is not set it would be this: bootstrap/bin/ant -nouserlib -lib lib/optional "-emacs" $* maybe that's the difference that causes the issue.
on my system it's set here: # grep ANT_HOME /etc/env.d/* -r /etc/env.d/20ant:ANT_HOME="/usr/share/ant" and it is installed by ant-core: # equery belongs /etc/env.d/20ant * Searching for /etc/env.d/20ant ... dev-java/ant-core-1.10.5 (/etc/env.d/20ant) is ant-core already installed when failing or is it a new install?
yes, I don't have ant installed yet on that machine. probably first installation fails like this. chicken-and-egg type of problem. ebuild unsets ANT_HOME, so it does not play a role from ebuild perspective, moving down to scripts. build.sh/bootstrap.sh sets it to ANT_HOME="$PWD"/bootstrap here are commands from unpacked dir: pwd /tmp/portage/dev-java/ant-core-1.10.5/work/apache-ant-1.10.5 env ANT_HOME="$PWD"/bootstrap ./bootstrap/bin/ant -nouserlib -lib bootstrap/lib/optional --execdebug exec "/usr/lib64/icedtea8/bin/java" -classpath "/usr/share/ant-core/lib/ant-launcher.jar:/usr/lib64/icedtea8/lib/tools.jar" -Dant.home="/usr/share/ant-core" -Dant.library.dir="/usr/share/ant-core/lib" org.apache.tools.ant.launch.Launcher -cp "" "-nouserlib" "-lib" "bootstrap/lib/optional" Error: Could not find or load main class org.apache.tools.ant.launch.Launcher for some reason it sets -Dant.home="/usr/share/ant-core", but it has -Dant.home=\"${ANT_HOME}\" something goes wrong in the ant script itself. such a mess...
i found the cause: # grep ANT_HOME= bootstrap/bin/ant ANT_HOME="${EPREFIX}"/usr/share/ant-core it overrides everything and sets this path. now to find out how to avoid this in case of bootstrap...
Created attachment 562762 [details, diff] patch to fix bootstrap can you please test this patch before i commit it? i changed it to set ANT_HOME only if it is not set. and also changed to /usr/share/ant instead of /usr/share/ant-core to be consistent with env file.
nice! patch worked with dev-java/ant-core-1.10.5 also tested it briefly with other packages, could get maven-bin installed (along with all deps)
thanks! will update the ant patches and ebuilds and will commit the fix in few minutes.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9989ce97dabcf6ef399581493ea145409012ccdf commit 9989ce97dabcf6ef399581493ea145409012ccdf Author: Miroslav Šulc <fordfrog@gentoo.org> AuthorDate: 2019-01-24 22:04:38 +0000 Commit: Miroslav Šulc <fordfrog@gentoo.org> CommitDate: 2019-01-24 22:06:08 +0000 dev-java/ant-core-1.{9.13,10.5}-r1: fixes 1) fixed bug #675992 2) fixed 'package not found' error on systems wnere ant-core is not installed yet Closes: https://bugs.gentoo.org/675992 Package-Manager: Portage-2.3.58, Repoman-2.3.12 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org> dev-java/ant-core/Manifest | 4 ++-- .../ant-core/{ant-core-1.10.5.ebuild => ant-core-1.10.5-r1.ebuild} | 4 +++- .../ant-core/{ant-core-1.9.13.ebuild => ant-core-1.9.13-r1.ebuild} | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-)