Summary: | portage-2.0.51_pre20 does not use ccache | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Sebastian Bergmann (RETIRED) <sebastian> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | rockoo |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 54658 | ||
Bug Blocks: |
Description
Sebastian Bergmann (RETIRED)
![]() Using portage 2.0.51_rc1 I also have the same problem. ccache is not utilized at all, even though 'emerge info' shows ccache version and [enabled]. i think you both don't have "userpriv" in features? I usually use userpriv and ccache without problems. #emerge --info | grep FEATURES FEATURES="autoaddcvs ccache sandbox" CCACHE_DIR="/root/.ccache" emerge $whateverusesgcc (you can CTRL+C it after some cacheable stuff has proceded) ls -la /root/ccache and once again please CCACHE_DIR="/root/.ccache" emerge $whateverusesgcc ls -la /root/ccache -------my example: # rm -r /root/.ccache/ # CCACHE_DIR="/root/.ccache" ccache -s cache hit 0 cache miss 0 files in cache 0 cache size 0 Kbytes max cache size 976.6 Mbytes # CCACHE_DIR="/root/.ccache" emerge bogofilter # CCACHE_DIR="/root/.ccache" ccache -s cache hit 0 cache miss 77 compile failed 3 preprocessor error 1 autoconf compile/link 32 no input file 6 files in cache 154 cache size 492 Kbytes max cache size 2.0 Gbytes # ls -la /root/.ccache total 196 drwxr-xr-x 18 root root 4096 Sep 19 18:54 . drwx------ 5 root root 4096 Sep 19 18:53 .. drwxr-xr-x 7 root root 4096 Sep 19 18:53 0 # CCACHE_DIR="/root/.ccache" emerge bogofilter Calculating dependencies ...done! >>> emerge (1 of 1) mail-filter/bogofilter-0.92.6 to / *** Adjusting ccache permissions for portage user... >>> md5 src_uri ;-) bogofilter-0.92.6.tar.bz2 # CCACHE_DIR="/root/.ccache" ccache -s cache hit 77 cache miss 81 compile failed 6 preprocessor error 2 autoconf compile/link 64 no input file 12 files in cache 162 cache size 544 Kbytes max cache size 2.0 Gbytes # ls -la /root/.ccache total 316 drwxrws--- 18 portage portage 4096 Sep 19 18:56 . drwx------ 5 root root 4096 Sep 19 18:53 .. drwxrwxr-x 7 portage portage 4096 Sep 19 18:53 0 ----------------------------------- i don't know python but i hope my interpretation is not too far from reality in portage.py: | try: | mystat=os.stat(mysettings["CCACHE_DIR"]) ^^^CCACHE_DIR not defined (first exception) | if (mystat[ST_GID]!=portage_gid) or ((mystat[ST_MODE]&02070)!=02070): ^^mystat not set?! second exception | print "*** Adjusting ccache permissions for portage user..." some more strange stuff prepending the emerge commandline with CCACHE_DIR="/root/.ccache" caused it to work. This leaves me with 3 questions: Is portage failing to properly find the ccache directory when the CCACHE_DIR variable is not set? ccache itself seems to know where the cache is located without me specifying. Is ccache ebuild failing to set CCACHE_DIR variable and is it mandatory? Is this behavior expected, making the gentoo online documentation chapter 3.b. incorrect? Thanks! okay, the problem is: ccache uses ${HOME}/.ccache as CACHE_DIR (if CCACHE_DIR is not set) If you run it as root (no userpriv) then ${HOME} of user portage (uid 250) is /var/tmp/portage/homedir and CACHE_DIR is /var/tmp/portage/homedir/.ccache (and it *is* used! 'CCACHE_DIR="/var/tmp/portage/homedir/.ccache/" ccache -s') at the same time (in ebuild.sh) CCACHE_DIR is not set so... [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="/root/.ccache" echo $HOME $UID #added echo "CCACHE_DIR = ${CCACHE_DIR}" #added addread "${CCACHE_DIR}" addwrite "${CCACHE_DIR}" ccache *is* used with the latest portages -- but you must look in /var/tmp/portage/homedir/.ccache Now it makes sense. I use emerge as root with userpriv not set (the default portage settings, I think). I never thought to look in /var/tmp/portage tree. Thank you tove! Thanks for the input. Saves us the time to debug it. :) |