Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16664 - FEATURE="userpriv" flag kills ccache
Summary: FEATURE="userpriv" flag kills ccache
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-02 08:23 UTC by AlterEgo
Modified: 2011-10-30 22:21 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AlterEgo 2003-03-02 08:23:52 UTC
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.
Comment 1 SpanKY gentoo-dev 2003-03-02 15:03:37 UTC
when you run as userpriv, the user/group is portage and its HOME is /var/tmp/portage
Comment 2 AlterEgo 2003-03-03 05:16:16 UTC
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
Comment 3 Jon Portnoy (RETIRED) gentoo-dev 2003-03-05 19:14:07 UTC
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.
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2003-03-10 21:47:35 UTC
This should be fixed in 2.0.47-r9
Comment 5 Jon Portnoy (RETIRED) gentoo-dev 2003-03-11 10:03:03 UTC
Works perfectly for me.
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2003-03-14 02:56:37 UTC
-r10 is coming out. ~arch presently.
Comment 7 Nick Brown 2004-04-29 16:59:45 UTC
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 #