Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 63186 - portage-2.0.51_pre20 does not use ccache
Summary: portage-2.0.51_pre20 does not use ccache
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 67740 (view as bug list)
Depends on: 54658
Blocks:
  Show dependency tree
 
Reported: 2004-09-07 21:51 UTC by Sebastian Bergmann (RETIRED)
Modified: 2004-10-15 23:26 UTC (History)
1 user (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 Sebastian Bergmann (RETIRED) gentoo-dev 2004-09-07 21:51:36 UTC
portage-2.0.51_pre20 does not use ccache although configured in make.conf/FEATURES.

Reproducible: Always
Steps to Reproduce:
1. emerge any-package
Actual Results:  
ccache is not utilized

Expected Results:  
ccache is utilized

Portage 2.0.51_pre20 (default-linux/x86/2004.2/gcc34/2.6, gcc-3.4.1,
glibc-2.3.4.20040808-r0, 2.6.8-gentoo-r3 i686 Intel(R) Pentium(R) M processor
1500MHz)
=================================================================
System uname: 2.6.8-gentoo-r3 i686 Intel(R) Pentium(R) M processor 1500MHz
Gentoo Base System version 1.5.3
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux26-headers-2.6.8.1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-pipe -march=pentium3 -msse2 -O2 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config
/usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-pipe -march=pentium3 -msse2 -O2 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache fixpackages sandbox sfperms"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo
http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage-overlay/my"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acpi alsa apache2 apm arts avi berkdb cdr crypt cscope cups dvd dvdr
encode esd evo foomaticdb gdbm gif gnome gpm gtk gtk2 imlib innodb java jpeg
libg++ libwww mad mikmod mmx mono motif mozilla moznocompose moznoirc moznomail
mpeg mysql ncurses nls nntp nptl oggvorbis opengl oss pam pdflib perl png python
quicktime readline samba sdl slang spell sse ssl svga tcltk tcpd tetex tiff
truetype x86 xml2 xmms xv zlib"
Comment 1 Paul Hartman 2004-09-17 22:06:34 UTC
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].
Comment 2 Torsten Veller (RETIRED) gentoo-dev 2004-09-19 10:10:47 UTC
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
Comment 3 Paul Hartman 2004-09-19 20:13:39 UTC
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!
Comment 4 Torsten Veller (RETIRED) gentoo-dev 2004-09-20 02:27:49 UTC
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
Comment 5 Paul Hartman 2004-09-20 14:23:03 UTC
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!
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2004-09-21 18:00:45 UTC
Thanks for the input. Saves us the time to debug it. :)
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2004-10-15 23:26:16 UTC
*** Bug 67740 has been marked as a duplicate of this bug. ***