I noticed my ccache stopped functioning after upgrading to portage 2.0.47-r7 and introducing FEATURES="userpriv". Ccache -s clearly shows it's not functioning anymore; compile times tell me the same. I tested re-emerging ccache and clearing the .ccache several times, and changed dozens of FEATURES flags. I use the emerge command as root. My ccache tree, normally located in /root/.ccache/..... stays empty. In /var/tmp/ccache/... I find a tree similar to the usual ccache tree; categorized 0 to f, but all categories are empty (!) , and thousands of tmp.hash.<hostname>.<number> files are in /var/tmp/ccache. The categories are owned by user root and group portage, but the tmp.hash....files are owned by user portage and group portage. If I maually cleanup and chown portage /var/tmp/ccache/, ccache seems to work again (from checking the emerge times). CCACHE_DIR=/var/tmp/ccache ccache -s Shows that cccache is working again. When I remove the "userpriv" feature, all is back like it was (.ccache in /root). Reproducible: Always Steps to Reproduce: 1. 2. 3.
when you run as userpriv, the user/group is portage and its HOME is /var/tmp/portage
That makes sense, but that's not the case: the homedir for user portage is /var/tmp/portage/homedir, and that's not the place where ccache writes its cache, that's /var/tmp/ccache. And it does so with the wrong user priviliges, namely as root instead of as user portage. Therefore, ccache does not work properly until a "chown portage /var/tmp/ccache/" I suspect there's a tiny user rights issue in either portage or ccache ebuild
I'm having the same issue. /home/ccache (my CCACHE_DIR) is owned by portage:portage, so there shouldn't be an issue there, yet ccache -s shows the cache not changing.
This should be fixed in 2.0.47-r9
Works perfectly for me.
-r10 is coming out. ~arch presently.
This would appear to still be a problem. I'm using 2.0.50-r6 I have ccache and userpriv in my options. I am using the defaults for everything else, so /var/tmp/ccache is being used for the cache. However "CCACHE_DIR=/var/tmp/ccache ccache -s" reveal that there are no files in the cache. I am seeing "adjusting ccache permissions for portage user..." message, but the cache directories all seem to be owned by root rather than portage (though the group is correct). If I delete /var/tmp/ccache it is recreated but still with wrong ownership, and thus appears to not be used. If I manually change the ownership to portage it all works fine. I think the code in usr/lib/portage/pym/portage.py to adjust the ownership must be wrong. root@littlebox ccache # pwd /var/tmp/ccache root@littlebox ccache # ls -la total 13 drwxrws--- 18 portage portage 456 Apr 29 19:25 . drwxrwxrwt 6 root root 272 Apr 29 21:45 .. drwxr-sr-x 2 root portage 72 Apr 29 19:12 0 drwxr-sr-x 2 root portage 72 Apr 29 19:12 1 drwxr-sr-x 2 root portage 72 Apr 29 19:12 2 drwxr-sr-x 2 root portage 72 Apr 29 19:12 3 drwxr-sr-x 2 root portage 72 Apr 29 19:12 4 drwxr-sr-x 2 root portage 72 Apr 29 19:12 5 drwxr-sr-x 2 root portage 72 Apr 29 19:12 6 drwxr-sr-x 2 root portage 72 Apr 29 19:12 7 drwxr-sr-x 2 root portage 72 Apr 29 19:12 8 drwxr-sr-x 2 root portage 72 Apr 29 19:12 9 drwxr-sr-x 2 root portage 72 Apr 29 19:12 a drwxr-sr-x 2 root portage 72 Apr 29 19:12 b drwxr-sr-x 2 root portage 72 Apr 29 19:12 c drwxr-sr-x 2 root portage 72 Apr 29 19:12 d drwxr-sr-x 2 root portage 72 Apr 29 19:12 e drwxr-sr-x 2 root portage 72 Apr 29 19:12 f -rw-r--r-- 1 portage portage 50 Apr 29 19:25 stats root@littlebox ccache #