Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 861026 - java-pkg-simple.eclass: does not sufficiently skip compilation if USE=binary is set. (was: app-misc/rundeck-cli-bin-2.0.1 - ejavac failed )
Summary: java-pkg-simple.eclass: does not sufficiently skip compilation if USE=binary ...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
Keywords: PullRequest
Depends on:
Reported: 2022-07-25 18:12 UTC by Toralf Förster
Modified: 2022-08-25 16:37 UTC (History)
3 users (show)

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

emerge-info.txt (emerge-info.txt,17.64 KB, text/plain)
2022-07-25 18:12 UTC, Toralf Förster
app-misc:rundeck-cli-bin-2.0.1:20220725-174436.log (app-misc:rundeck-cli-bin-2.0.1:20220725-174436.log,2.25 KB, text/plain)
2022-07-25 18:12 UTC, Toralf Förster
emerge-history.txt (emerge-history.txt,58.72 KB, text/plain)
2022-07-25 18:12 UTC, Toralf Förster
environment (environment,88.49 KB, text/plain)
2022-07-25 18:12 UTC, Toralf Förster
etc.portage.tar.bz2 (etc.portage.tar.bz2,24.90 KB, application/x-bzip)
2022-07-25 18:12 UTC, Toralf Förster
logs.tar.bz2 (logs.tar.bz2,1.56 KB, application/x-bzip)
2022-07-25 18:12 UTC, Toralf Förster

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-07-25 18:12:12 UTC
javac -source 11 -target 11 -d target/classes -encoding UTF-8 @sources.lst
* javac is not available for openjdk-jre-bin-17 on x86_64
* IMPORTANT: some Java tools are not available on some VMs or some architectures
 * ERROR: app-misc/rundeck-cli-bin-2.0.1::gentoo failed (compile phase):
 *   ejavac failed
 * Call stack:


  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no_multilib_hardened-j4-20220725-032651


gcc-config -l:
 [1] x86_64-pc-linux-gnu-12.1.1 *
clang/llvm (if any):
clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/14/bin
Python 3.10.5
Available Ruby profiles:
  [1]   ruby27 (with Rubygems)
  [2]   ruby31 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.62.1 *
The following VMs are available for generation-2:
*)	Eclipse Temurin JRE 17.0.3_p7 [openjdk-jre-bin-17]
Available Java Virtual Machines:
  [1]   openjdk-jre-bin-17  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli:

  HEAD of ::gentoo
commit 740379531e9cd53bb361ed34a76f2991b24497e9
Author: Repository mirror & CI <>
Date:   Mon Jul 25 16:31:52 2022 +0000

    2022-07-25 16:31:52 UTC

emerge -qpvO app-misc/rundeck-cli-bin
[ebuild  N    ] app-misc/rundeck-cli-bin-2.0.1  USE="-binary"
Comment 1 Toralf Förster gentoo-dev 2022-07-25 18:12:13 UTC
Created attachment 794354 [details]
Comment 2 Toralf Förster gentoo-dev 2022-07-25 18:12:14 UTC
Created attachment 794357 [details]
Comment 3 Toralf Förster gentoo-dev 2022-07-25 18:12:15 UTC
Created attachment 794360 [details]
Comment 4 Toralf Förster gentoo-dev 2022-07-25 18:12:17 UTC
Created attachment 794363 [details]
Comment 5 Toralf Förster gentoo-dev 2022-07-25 18:12:18 UTC
Created attachment 794366 [details]
Comment 6 Toralf Förster gentoo-dev 2022-07-25 18:12:19 UTC
Created attachment 794369 [details]
Comment 7 Volkmar W. Pogatzki 2022-07-25 19:16:17 UTC
It's a bug in java-pkg-simple.eclass.

"If USE FLAG 'binary' exists and is set, it will just copy ${JAVA_BINJAR_FILENAME} to ${S} and skip the rest of src_compile."
Comment 8 Larry the Git Cow gentoo-dev 2022-08-02 11:45:36 UTC
The bug has been closed via the following commit(s):

commit 61f4303bb92f22c65c803763e8f4a29b5a8bd2b3
Author:     Volkmar W. Pogatzki <>
AuthorDate: 2022-07-29 09:36:29 +0000
Commit:     Florian Schmaus <>
CommitDate: 2022-08-02 11:45:28 +0000

    java-pkg-simple.eclass: run java-pkg_gen-cp only for non-binary packages
    app-misc/rundeck-cli-bin-2.0.1 failed to build with openjdk-jre-bin-17
    saying "javac is not available for openjdk-jre-bin-17 on x86_64".
    Culprit was java-pkg-simple.eclass calling java-pkg_gen-cp
    unconditionally. Limiting java-pkg_gen-cp to the "non-binary" case solves
    the problem.
    Signed-off-by: Volkmar W. Pogatzki <>
    Signed-off-by: Florian Schmaus <>

 eclass/java-pkg-simple.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Comment 9 Yuan Liao (Leo3418) 2022-08-23 19:17:28 UTC
Sorry for this late reply because I've been struggling to keep up with Java updates for a while.  I have just identified the above eclass change as the root cause of some regressions and test failures on Spark overlay [1] packages.  The overlay has a lot of Java packages that support the 'binary' USE flag, and their dependencies are no longer correctly declared in the /usr/share/{PN}/package.env file after this change.

From my (late) investigation on this bug, the eclass change per se is a non-solution.  The java-pkg_gen-cp() function (defined at the very bottom of java-utils-2.eclass) does not call any JDK programs, so it is safe to call it when 'use binary' and only JRE is installed.  The build log has a clue to the real underlying cause: 'binary' was not included in the USE flag combination printed at the log start despite 'IUSE="+binary"' being declared in app-misc/rundeck-cli-bin:

>  * USE: abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
Since this bug was reported by tinderbox, I suspect it was caused by tinderbox testing different USE flag combinations.  The '+' operator in IUSE just enables a USE flag by default; it does not force it, so anyone, including users and tinderbox, can disable it on their own in /etc/portage/package.use.  Perhaps, when tinderbox decided to run a test with the 'binary' USE flag disabled, the error in the bug occurred.

To compare, I built app-misc/rundeck-cli-bin-2.0.1 locally with default USE settings, and this is what was given in the build log.  Note that the 'binary' USE flag was included here.

> * USE: abi_x86_64 amd64 binary elibc_glibc kernel_linux userland_GNU
Furthermore, this bug can still be reproduced with a copy of ::gentoo I just synced today, when I disabled the 'binary' USE flag myself, despite all the pertaining eclass and ebuild changes:

> # USE="-binary" emerge -a1 app-misc/rundeck-cli-bin
To properly resolve the bug, I would suggest reverting this eclass change, and doing either of the following:
- Forcefully enable the 'binary' USE flag for app-misc/rundeck-cli-bin in the profile
- Or, maybe better, just remove the 'binary' USE flag if it was intended to be always enabled, but override src_compile() in the app-misc/rundeck-cli-bin ebuild so it would copy the binary JAR to ${JAVA_JAR_FILENAME} and return directly, like in [3]

Comment 10 Larry the Git Cow gentoo-dev 2022-08-25 16:37:53 UTC
The bug has been referenced in the following commit(s):

commit 38dc429245b0d935aeeb0b423ace19787c88b195
Author:     Volkmar W. Pogatzki <>
AuthorDate: 2022-08-24 10:46:34 +0000
Commit:     William Hubbs <>
CommitDate: 2022-08-25 16:37:47 +0000

    app-misc/rundeck-cli-bin: revert to 0.1.11 style
    Signed-off-by: Volkmar W. Pogatzki <>
    Signed-off-by: William Hubbs <>

 app-misc/rundeck-cli-bin/metadata.xml                 |  3 ---
 app-misc/rundeck-cli-bin/rundeck-cli-bin-2.0.1.ebuild | 13 +++++++------
 2 files changed, 7 insertions(+), 9 deletions(-)