Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 84062 - FEATURES="userpriv" flag kills ccache - please fix bugs 16664, 22125, 33162 properly
Summary: FEATURES="userpriv" flag kills ccache - please fix bugs 16664, 22125, 33162 p...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-03-04 02:20 UTC by Jakub Moc (RETIRED)
Modified: 2005-07-14 07:11 UTC (History)
1 user (show)

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


Attachments
Patch that hopefully does enough (ccache.patch,1.21 KB, patch)
2005-04-13 06:50 UTC, Jason Stubbs (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Moc (RETIRED) gentoo-dev 2005-03-04 02:20:45 UTC
ccache does not work with FEATURES="userpriv" due to wrong permissions of /var/tmp/ccache subdirectories. 


Reproducible: Always
Steps to Reproduce:
1. emerge ccache
2. set "FEATURES=userpriv usersandbox" in /etc/make.conf
3. emerge something
4. run "CCACHE_DIR=/var/tmp/ccache ccache -s"
5. emerge something
6. run "CCACHE_DIR=/var/tmp/ccache ccache -s"

Actual Results:  
ccache is not used due to incorrect permissions. Running "chown -R
portage:portage /var/tmp/ccache" fixes that. 

References:
- Bug 16664
- Bug 22125
- Bug 33162

All these bugs are marked as fixed but they are not fixed. It still does not
work even with portage 2.0.51.19. 

Expected Results:  
Portage should use ccache with FEATURES="userpriv usersandbox". 

emerge info
Portage 2.0.51.19 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20040808-r1,
2.6.9-gentoo-r13 i686)
=================================================================
System uname: 2.6.9-gentoo-r13 i686 AMD Athlon(tm) XP 2200+
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#2, Feb  7 2005, 10:01:40)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/glftpd/etc /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache collision-protect distlocks makecheck
sandbox sfperms userpriv usersandbox"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow acpi apache2 apm arts avi bash-completion berkdb bitmap-fonts
crypt curl emboss encode f77 fbcon firebird font-server foomaticdb fortran gd
gd-external gdbm gif gpm gtk2 imap imlib innodb java jpeg junit libg++ libwww
mad maildir mikmod mmx motif mpeg mysql ncurses nls nptl odbc oggvorbis opengl
oss pam pdflib perl png pnp postgres python quicktime readline sasl sdl slang
snmp socks5 spell sqlite sse ssl svga tcpd tiff truetype truetype-fonts
type1-fonts unicode xml xml2 xmms xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2005-03-08 08:28:35 UTC
There should also be a loud warning when someone adds userpriv and usersandbox to FEATURES, which already has ccache because the old cache gets abandonned. 
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-04-13 06:50:42 UTC
Created attachment 56162 [details, diff]
Patch that hopefully does enough

This will do the complete chmod/chgrp -R when switching between userpriv and
non-userpriv only. In either case, it'll be a chmod -R ug+rw $CCACHE_DIR. Then
portage:portage for userpriv and root:portage non-userpriv.

I can't see a way to fix already "broken" installations other than "fixing" the
permissions at every turn, but that would be a major performance disadvantage
with very little gain.
Comment 3 Brian Harring (RETIRED) gentoo-dev 2005-04-13 13:14:14 UTC
Why not a 
chown -1:(portage_gid) -R ; 
find ${CCACHE_DIR} -type d -print0 | xargs --null chmod 04775 

If required, a find ${CCACHE_DIR} -type f -print0 | xargs -null chmod 775
also...?
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-04-13 16:44:02 UTC
When? At every run?
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2005-04-14 02:01:43 UTC
Jason, does this fix Bug 85085 as well?
Comment 6 Jason Stubbs (RETIRED) gentoo-dev 2005-04-14 04:39:59 UTC
Bug 85085 is completely separate. That is in relation to a large overhaul of the relevant code. It's not going to be released as stable any time soon.

Had a thought with regard to Brian's suggestion though.. How about looking at the owner of CCACHE_DIR? If the permissions on that dir aren't correct, adjust underneath CCACHE_DIR as -1:portage with ug+rw and then adjust CCACHE_DIR, where:

userpriv -> portage:portage
-userpriv -> root:portage
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2005-04-14 05:18:43 UTC
Reworked for this logic and fixed some bugs in my untested code, tested ;), and it works. Flicking userpriv on and off still utilizes the cache.
Comment 8 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 05:47:37 UTC
Fixed on or before 2.0.51.22-r1 
Comment 9 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 06:58:25 UTC
Looking through the batch of bugs, I'm not sure that some of these are 
actually fixed in stable. Others, the requirements have possibly changed after 
the initial fix was committed. 
 
If you think this bug has been closed incorrectly, please reopen or ask that 
it be reopened. 
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2005-07-14 07:11:08 UTC
(In reply to comment #9)
> Looking through the batch of bugs, I'm not sure that some of these are 
> actually fixed in stable. Others, the requirements have possibly changed after 
> the initial fix was committed. 

Yes, it is fixed, I can confirm that it changes the permissions back and forth
when switching between userpriv/-userpriv (portage 2.0.51.22-r1).