In make.conf, it says CCACHE_DIR will default to ${PORTAGE_TMPDIR}/ccache. But, in ebuild.sh, it defaults to /root/.ccache. Either correct make.conf, or ebuild.sh. Portage-2.0.47-r10 ccache-2.2 Reproducible: Always Steps to Reproduce: 1. 2. 3.
And there is a problem with this line, modified to be make.conf compliant (line 1029, ebuild.sh, in newdepend): [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="${PORTAGE_TMPDIR}/ccache" It seems the scope of this export is not as intented. I don't know if it is a bug or feature of bash, but it works like this: [ -z "${CCACHE_DIR}" ] && CCACHE_DIR="${PORTAGE_TMPDIR}/ccache" export CCACHE_DIR To test it, just echo CCACHE_DIR in emake. If someone know why it loses some exports, I would like to know also :).
This problem still exists. make.conf is telling that if CCACHE_DIR is not set, portage will use ${PORTAGE_TMPDIR}/ccache (/var/tmp/ccache). But in ebuild.sh, it is set to /root/.ccache on the following line: [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="/root/.ccache" Why has this not been fixed yet?
This is exported from class config (aka settings) in portage.py. It's only set to /var/tmp/ccache if you are using userpriv.