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 ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
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: ---


Attachments
emerge-info.txt (emerge-info.txt,17.64 KB, text/plain)
2022-07-25 18:12 UTC, Toralf Förster
Details
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
Details
emerge-history.txt (emerge-history.txt,58.72 KB, text/plain)
2022-07-25 18:12 UTC, Toralf Förster
Details
environment (environment,88.49 KB, text/plain)
2022-07-25 18:12 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,24.90 KB, application/x-bzip)
2022-07-25 18:12 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,1.56 KB, application/x-bzip)
2022-07-25 18:12 UTC, Toralf Förster
Details

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
/usr/lib/llvm/14
14.0.6
Python 3.10.5
Available Ruby profiles:
  [1]   ruby27 (with Rubygems)
  [2]   ruby31 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.62.1 *
GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
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 <repomirrorci@gentoo.org>
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]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-07-25 18:12:14 UTC
Created attachment 794357 [details]
app-misc:rundeck-cli-bin-2.0.1:20220725-174436.log
Comment 3 Toralf Förster gentoo-dev 2022-07-25 18:12:15 UTC
Created attachment 794360 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2022-07-25 18:12:17 UTC
Created attachment 794363 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2022-07-25 18:12:18 UTC
Created attachment 794366 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2022-07-25 18:12:19 UTC
Created attachment 794369 [details]
logs.tar.bz2
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):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61f4303bb92f22c65c803763e8f4a29b5a8bd2b3

commit 61f4303bb92f22c65c803763e8f4a29b5a8bd2b3
Author:     Volkmar W. Pogatzki <gentoo@pogatzki.net>
AuthorDate: 2022-07-29 09:36:29 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
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.
    
    Closes: https://bugs.gentoo.org/861026
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Closes: https://github.com/gentoo/gentoo/pull/26647
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 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]

[1]: https://github.com/6-6-6/spark-overlay
[2]: https://861026.bugs.gentoo.org/attachment.cgi?id=794357
[3]: https://github.com/6-6-6/spark-overlay/blob/master/dev-java/lombok-bin/lombok-bin-1.18.22.ebuild#L29-L32
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):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38dc429245b0d935aeeb0b423ace19787c88b195

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

    app-misc/rundeck-cli-bin: revert to 0.1.11 style
    
    Bug: https://bugs.gentoo.org/861026
    Closes: https://github.com/gentoo/gentoo/pull/27000
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 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(-)