[ccache] Re: [distcc] ccache doesn't handle .i files

Martin Pool mbp at samba.org
Wed Sep 24 10:30:46 EST 2003


On 23 Sep 2003, eezyy at gmx.net wrote:
> on Mon, 21 Jul 2003 23:52:45 -0700, Martin Pool wrote:
> >    If I run ccache 2.2 on a .i file, it thinks it's not a C/C++ file and
> >    it doesn't cache it.
> > 
> >    This could be naively fixed by updating check_extension(), but it
> >    would be far better for ccache to know that it doesn't need to run cpp
> >    on such files.  distcc does so.
> > 
> >    In particular this means that if ccache is run by distcc or distccd it
> >    will never hit.
> > 
> >    This is not a terribly big deal but might be nice to fix.
> 
> imho it's a better way to combine ccache and distcc to ccache on the
> distcc hosts after distributing, as compiler upgrades are handled
> correctly this way.

That was what I meant by running it from distccd.

> maybe this will do(I know it's kludgy but to nicely implement it some
> redesign of ccache would be needed):

> @@ -64,19 +70,23 @@
>  static struct {
>  	char *extension;
>  	char *i_extension;
> +	int preprocess;

Okay.

> +	if (preprocess) {
> +	/* now the run */
>  	args_add(args, "-E");
>  	args_add(args, input_file);
>  	status = execute(args->argv, path_stdout, path_stderr);
> @@ -327,6 +339,12 @@
>  		failed();
>  	}
>  
> +	} else {
> +		copy_file(input_file, path_stdout);
> +		x_asprintf(&command, "touch %s", path_stderr);
> +		system(command);
> +		free(command);
> +	}

Huh?

-- 
Martin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/ccache/attachments/20030924/d47b8340/attachment.bin


More information about the ccache mailing list