Building openjdk-11 fails with FEATURES=ccache enabled. configure: Please use --enable-ccache instead of providing a wrapped compiler. configure: error: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc is a symbolic link to ccache. This is not supported. Perhaps a check for this could be added to pkg_pretend? if has ccache ${FEATURES:-none}; then die "FEATURES=ccache is unsupported for this package" fi Also, it would be nice if the --enable-ccache configure option was exposed via a USE flag.
Thanks. as a workaround you can try passing --enable-ccache via EXTRA_ECONF and disable FEATURES=ccache for openjdk. Last time I tried openjdk's build system did it's own handing of ccache, ignoring portage/system settings. I'd rather disable it completely than try to wrap it into portage, so not sure about use flag, I'll poke around and see how things are now.
it's still a mess. it will die if detects ccache symlink and with no ccache in FEATURES but with --enable-ccache it'll blow up on sandbox violations. will just die in pkg_pretend.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6136f3c691e05e542e644be851bea9f035337fdd commit 6136f3c691e05e542e644be851bea9f035337fdd Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2019-02-13 20:42:17 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2019-02-13 20:42:55 +0000 dev-java/openjdk: die if FEATURES=ccache ./configure will die anyway, so we die a bit earlier before unpacking. openjdk wants to handle ccache itself and ignores portage or system settings. Bug: https://bugs.gentoo.org/677876 Package-Manager: Portage-2.3.60, Repoman-2.3.12 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-java/openjdk/openjdk-11.0.1_p13.ebuild | 1 + dev-java/openjdk/openjdk-11.0.2_p7.ebuild | 1 + dev-java/openjdk/openjdk-8.202_p08.ebuild | 1 + 3 files changed, 3 insertions(+)
why don't you export CCACHE_DISABLE=1 ? per man ccache: disable (CCACHE_DISABLE or CCACHE_NODISABLE, see Boolean values above) When true, ccache will just call the real compiler, bypassing the cache completely. The default is false. And export CCACHE_DISABLE=1 is being used by nvidia-drivers ebuilds without issues Thanks!
(In reply to Pacho Ramos from comment #4) The configure check would probably still fail, regardless of that environment variable.
yep, it's jdk build system that checks for ccache and complains. I'll test it though, I don't like blowing up in user's face with that feature enabled, but we can't RESTRICT ccache unfortunately to disable it.
autoconf/toolchain.m4 571: # We can't handle ccache by gcc wrappers, since we need to know if we're 572: # using ccache. Instead ccache usage must be controlled by a configure option. 574: if test "x$COMPILER_BASENAME" = "xccache"; then 575: AC_MSG_NOTICE([Please use --enable-ccache instead of providing a wrapped compiler.]) 576: AC_MSG_ERROR([$TEST_COMPILER is a symbolic link to ccache. This is not supported.]) well, without this ugly hack (stripping ccache from PATH) PATH="${PATH/\/usr\/lib\/ccache\/bin\:/}" configure still fails with CCACHE_DISABLE=1 I guess with CCACHE_DISABLE=1 and PATH="${PATH/\/usr\/lib\/ccache\/bin\:/}" set just before running econf can potentially disable ccache pretty transparently. even if ccache got run it promises to keep call gcc directly. but I don't like modifying path like that.
Created attachment 574094 [details, diff] openjdk-ccache.patch I kinda made ccache work with it CCACHE_DIR=/var/cache/ccache ccache -s cache directory /var/cache/ccache primary config /var/cache/ccache/ccache.conf secondary config (readonly) /etc/ccache.conf stats updated Wed Apr 24 22:39:07 2019 cache hit (direct) 0 cache hit (preprocessed) 0 cache miss 3576 cache hit rate 0.00 % cleanups performed 0 files in cache 10501 cache size 10.8 MB max cache size 5.0 GB CCACHE_DIR=/var/cache/ccache ccache -s cache directory /var/cache/ccache primary config /var/cache/ccache/ccache.conf secondary config (readonly) /etc/ccache.conf stats updated Wed Apr 24 22:44:37 2019 cache hit (direct) 3269 cache hit (preprocessed) 305 cache miss 3578 cache hit rate 49.97 % cleanups performed 0 files in cache 10521 cache size 10.8 MB max cache size but idk if it's a good idea to do that. opinions? diff attached.
Personally I would opt for disabling ccache with CCACHE_DISABLE=1 (as it seems upstream doesn't want it) and dropping the ugly check from configure
Created attachment 637826 [details] emerge.txt Hi everyone! I get an error while installing as a binary package: * openjdk-8.242.tbz2 MD5 SHA1 size ;-) ... [ ok ] * ERROR: dev-java/openjdk-8.242::gentoo failed (pretend phase): * FEATURES=ccache doesn't work with openjdk * * Call stack: * ebuild.sh, line 125: Called pkg_pretend * environment, line 4492: Called die * The specific snippet of code: * has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}" * * If you need support, post the output of `emerge --info '=dev-java/openjdk-8.242::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-java/openjdk-8.242::gentoo'`. Can you exclude the ccache feature checking for binary packages?
I completely forgot about dev-java/openjdk-bin Does it make sense to fix this?
yeah, it's possible to fix, thanks for catching it should not die if the binpkg is being installed.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91385d013bd1fbc0c8a8e5bc5ec43d8e0f3906f5 commit 91385d013bd1fbc0c8a8e5bc5ec43d8e0f3906f5 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-05-11 04:42:25 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-05-11 04:42:54 +0000 dev-java/openjdk: don't die on ccache if binpkg is being used Bug: https://bugs.gentoo.org/677876 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-java/openjdk/openjdk-11.0.7_p10.ebuild | 4 +++- dev-java/openjdk/openjdk-8.252_p09.ebuild | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
Created attachment 757227 [details, diff] openjdk-ccache.patch I don't see any issues with --enable-ccache=no and removed symlink checking in make/autoconf/toolchain.m4. With this configuration openjdk compiles fine and still uses ccache via wrapper without any issues. Patch attached.
Same with openjdk-11.0.13_p8: * Messages for package dev-java/openjdk-11.0.13_p8: * ERROR: dev-java/openjdk-11.0.13_p8::gentoo failed (pretend phase): * FEATURES=ccache doesn't work with openjdk, bug #677876
Another workaround: echo 'dev-java/openjdk without_ccache.conf' >> /etc/portage/package.env echo 'FEATURES="-ccache"' >> /etc/portage/env/without_ccache.conf It will disabled the FEATURES just for openjdk.
(In reply to Azamat H. Hackimov from comment #14) > Created attachment 757227 [details, diff] [details, diff] > openjdk-ccache.patch > > I don't see any issues with --enable-ccache=no and removed symlink checking > in make/autoconf/toolchain.m4. With this configuration openjdk compiles fine > and still uses ccache via wrapper without any issues. > Patch attached. It works like a charm even for dev-java/openjdk-17.0.6_p10. Thank you, Azamat!
I got same issue compiling dev-java/openjdk-17.0.6_p10 with FEATURES="-ccache" Tried-out some workaround given here but couldn't get it compiling.