[ccache] What to do when there are problems writing to the cache directory?

Joel Rosdahl joel at rosdahl.net
Mon Jan 9 14:34:52 MST 2012


Hi,

I would like to get some feedback on what ccache users think ccache's
behavior should be when it fails to create files or directories in the
cache directory.

Here are some different cases to consider:

1. CCACHE_DIR is set to a directory that doesn't exist and can't be created.
2. CCACHE_DIR is set to a directory that exists but is unwritable.
3. CCACHE_DIR is set to a directory that exists, but one of the
subdirectories storing the cache data (e.g. $CCACHE_DIR/a/b) is
unwritable or not possible to create.
4. CCACHE_DIR is set to a directory that exists, but CCACHE_TEMPDIR
(defaults to $CCACHE_DIR/tmp for ccache 3 and $CCACHE_DIR for ccache
2) is unwritable or not possible to create.

Here's what happens with ccache 2.4:

1. Fatal error, non-zero exit code.
2. Silent failure, falling back to running the compiler.
3. Silent failure, falling back to running the compiler.
4. Silent failure, falling back to running the compiler.

ccache 3.0-3.1.6 (I think, haven't checked all versions):

1. Fatal error, non-zero exit code.
2. Fatal error, non-zero exit code.
3. Silent failure, falling back to running the compiler.
4. Silent failure, falling back to running the compiler.

ccache 3.1.7:

1. Fatal error, non-zero exit code.
2. Fatal error, non-zero exit code.
3. Fatal error, non-zero exit code.
4. Silent failure, falling back to running the compiler.

ccache has previously been more forgiving, so one might argue that
ccache 3.x more strict behavior is a regression from version 2.4 that
should be fixed. Also, one might argue that ccache should never fail
fatally so that case 1 should silently fall back to running the
compiler as well.

On the other hand, my general opinion is that tools should not fail
silently. As a ccache user, I would like to be informed if something
is badly configured, for instance if the cache directory is unwritable
by me, so that I get alerted that something is wrong.

What do you think?

-- Joel


More information about the ccache mailing list