[ccache] debugging ccache on shared nfs drive

Kris Coryn Kris.Coryn at Pandora.be
Wed Apr 9 08:19:10 EST 2003


Sorry i doesn't give up, because a have already feeled the power of ccache ( 
and distcc)

thanks for the reply in previous mails but it doesnt alway work, i did some 
more tests to find out way not always it take it from the ccache.

i think i have the same problem like Enno Rehling with two debian machines, 
but i am using the gentoo distro.

with gentoo are there two tools to auto compile and update the packages emerge 
and ebuild.

if i use emerge package_x then the two pc's havent the same result so the 
second time on the other machine the compiling doesn't come from the cacche.

if i use

ebuild package_x clean
ebuild package_x unpack
ebuild package_x compile

the same problem the second time no cache hit.

but if i do previous command a second time on the same machine yes then cache 
hits. (so ccache is good configured)

the ccache stats are the same on the two machine so they share the same ccache 
nfs maps

if i doesnt use the emerge or ebuild command no problem
that wil say compiling a kernel works perfect, the second time on a other 
machine fast because it comes from the ccache.

if i compile manuel package_x after unpacking it with ebuild ( use make ) than 
on the second pc also manual ( use make ) compiling al comes from the ccache
so ebuild en emerge do some strangs things and the ccache file arent the same 
if i use ebuild, therefore i patches ccache to extend the CCACHE_LOGFILE with 
extra data, sorry for the code its works but i'm not a expert in writing C 

ok this means that it is the gentoo tools emerge and ebuild who change some 
things if they compile.
therefore an other test, i take two other machines and make a copy of the disk 
to the second machine's disk and just rename the hostname and ip of corse, and 
yes thats working fine, so it must works with the other gentoo machines to. 
but how to find out what parameter make the difference.

my question ?

if somebody have time to check this quick patch that i use to debug with 
parameters are supply with compiling please

this is some output form the CCACHE_LOGFILE

CCACHE args are: gcc -march=pentium -O3 -pipe -fomit-frame-pointer -Wall 
-Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmiss
ing-declarations -Wnested-externs -Winline daemon.c -c 
CCACHE hashname: /nfs/ccache/6/3/14dd5656531f103d8990c53ac0be7e-20220
got cached result for daemon.o

so i see that the args are the same on the to machines and also see the ccache 

because i not so a good C writer i ask to the ccache group is there someone  
with some time to make a patch and maybe later standard in the sources of 
ccache with a extra CCACHE_DEBUG_LOGFILE shell variable that print the most 
parameters that make ccache to create a new ccache file or take it from ccache.
my patch for example just print the ccache argsv and the hashname, adding the 
gcc size, gcc time ,... , ..., wil help to findout wich param is difference 
and have to correct on the pc to make it take next time identical, so must 
faster from ccache.

because the manual compiling on the to pc works fine, i think there is no 
problem with include files or so, they must be the same includefiles otherwise 
shouldnt the second time manuel compiling on the other machine takes it from 

I cannot do a pre-processor test with the -E options because the manuel 
compiling is ok, and cant it implement in the gentoo tools.
on the forums on the gentoo site i do not find tips to this problem or how to 
correct it.



-------------- next part --------------
*** ccache.c_origineel	Mon Feb 17 02:11:58 2003
--- ccache.c	Tue Apr  8 23:12:18 2003
*** 757,764 ****
--- 757,766 ----
  /* the main ccache driver function */
  static void ccache(int argc, char *argv[])
+         int i;
  	/* find the real compiler */
  	find_compiler(argc, argv);
  	/* we might be disabled */
*** 769,779 ****
--- 771,793 ----
  	/* process argument list, returning a new set of arguments for pre-processing */
  	process_args(orig_args->argc, orig_args->argv);
+         cc_log("CCACHE args are: ");
+         for (i=0;i<argc;i++) 
+         {
+         cc_log(argv[i]);
+         cc_log(" ");
+         }                                                                                                                           
+         cc_log("\n");
  	/* run with -E to find the hash */
+         cc_log("CCACHE hashname: ");
+         cc_log(hashname);
+         cc_log("\n");
  	/* if we can return from cache at this point then do */
  	/* run real compiler, sending output to cache */

More information about the ccache mailing list