Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677876 - dev-java/openjdk-11.0.2_p7 configure fails with FEATURES=ccache
Summary: dev-java/openjdk-11.0.2_p7 configure fails with FEATURES=ccache
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-13 16:14 UTC by Mike Gilbert
Modified: 2019-04-25 16:24 UTC (History)
2 users (show)

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


Attachments
openjdk-ccache.patch (openjdk-ccache.patch,1.09 KB, patch)
2019-04-25 05:48 UTC, Georgy Yakovlev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gilbert gentoo-dev 2019-02-13 16:14:19 UTC
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.
Comment 1 Georgy Yakovlev gentoo-dev 2019-02-13 19:36:13 UTC
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.
Comment 2 Georgy Yakovlev gentoo-dev 2019-02-13 20:07:43 UTC
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.
Comment 3 Larry the Git Cow gentoo-dev 2019-02-13 20:43:25 UTC
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(+)
Comment 4 Pacho Ramos gentoo-dev 2019-04-24 14:16:56 UTC
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!
Comment 5 Mike Gilbert gentoo-dev 2019-04-24 15:05:23 UTC
(In reply to Pacho Ramos from comment #4)

The configure check would probably still fail, regardless of that environment variable.
Comment 6 Georgy Yakovlev gentoo-dev 2019-04-24 16:43:17 UTC
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.
Comment 7 Georgy Yakovlev gentoo-dev 2019-04-25 05:45:27 UTC
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.
Comment 8 Georgy Yakovlev gentoo-dev 2019-04-25 05:48:04 UTC
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.
Comment 9 Pacho Ramos gentoo-dev 2019-04-25 16:24:33 UTC
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