[ccache] [PATCH] Some patches for Xcode support

Joel Rosdahl joel at rosdahl.net
Sun Jun 13 10:38:51 MDT 2010

On 2010-06-11 15:18, Bernhard Bauer wrote:
> I finally got around to rewriting the third patch. I added a special
> case to process_args that matches distcc's behavior (if the first
> argument to distcc is neither a source/object file nor an option, it's
> treated as the compiler).

Thanks. One problem with the patch is that if ccache is invoked as
distcc, ccache will hash the mtime (or content) of distcc instead of the
compiler when trying to detect compiler changes. (See
CCACHE_COMPILERCHECK in calculate_common_hash().)

Also, it feels a bit strange to add a special case for distcc, so I
would like to understand more about the problem to solve. You said
earlier that distcc is called directly by xcodebuild and that you're
masquerading ccache as distcc via a symlink. Is the following a correct
guess of the setup?

1. /X/distcc is a symlink to ccache.
2. xcodebuild runs "/X/distcc compiler arguments".
3. ccache determines (with your patch) that it's invoked as distcc.
4. ccache uses "distcc compiler arguments" as the compiler command and
the real distcc is found in PATH.

If so, wouldn't an alternative solution be to replace /X/distcc with a
script like this:

CCACHE_PREFIX=distcc exec ccache "$@"

As a bonus, this will make ccache call the preprocessor as "compiler -E"
instead of "distcc compiler -E", which avoids some extra processing.

-- Joel

More information about the ccache mailing list