Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 70672

Summary: Using ccache for non-Portage C Compiling information not accurate
Product: [OLD] Docs-user Reporter: Frederic Grosshans <frederic.grosshans_web>
Component: HandbookAssignee: Sven Vermeulen (RETIRED) <swift>
Status: RESOLVED FIXED    
Severity: minor CC: docs-team
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=3
Whiteboard:
Package list:
Runtime testing required: ---

Description Frederic Grosshans 2004-11-10 08:18:20 UTC
The handbook says :
----
If you would like to use ccache for non-Portage compilations, add /usr/lib/ccache/bin to the beginning of your PATH variable (before /usr/bin). This can be accomplished by editing /etc/env.d/00basic:
        

Code Listing 9: Editing /etc/env.d/00basic
        
PATH="/usr/local/bin:/opt/bin:/usr/lib/ccache/bin"
----

but it doesn't work, even by adding the line 
ROOTPATH="/usr/local/bin:/opt/bin:/usr/lib/ccache/bin"       


Reproducible: Always
Steps to Reproduce:
1.Read the handbook
2.edit /etc/env.d/00basic
3.env-update && source /etc/profile
4.which gcc

Actual Results:  
it prints : 
/usr/bin/gcc 
ccache is not used

Expected Results:  
It should have printed
/usr/lib/ccache/bin/gcc
meaning that ccache is used

That seems to come from /etc/profile which hard-codes the position of /usr/bin
in the path. I don't know if it's a /etc/profile bug, but it's clearly a
documentation bug, since the proposed method does not work. I guess there are
other ways to change the PATH, which sould be advertised in the handbook.
Comment 1 SpanKY gentoo-dev 2004-11-10 14:51:16 UTC
it does work

however, that doesnt change the fact it's wrong ... users should never change files in /etc/env.d/ since those changes will be lost next time a package is emerged

the changes should go in /etc/profile and should be something like:
PATH="/usr/lib/ccache/bin:${PATH}"
Comment 2 Frederic Grosshans 2004-11-12 02:59:16 UTC
It doesn't work : the advertised procedure adds /usr/lib/ccache/bin in the PATH variable *AFTER* /usr/bin , which is hardcoded in /etc/profile.
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2004-11-26 14:07:05 UTC
I've altered the instructions to use /etc/profile instead of any /etc/env.d files.