`CCACHE_BASEDIR` environment variable to an absolute path that specifies
which paths to rewrite.
- - Object files are now by default stored compressed in the cache. The
+ - Object files are now optionally stored compressed in the cache. The
runtime cost is negligible, and more files will fit in the ccache
- directory and in the disk cache. `CCACHE_NOCOMPRESS` can be set to
- disable object file compression.
+ directory and in the disk cache. Set `CCACHE_COMPRESS` to enable object
+ file compression. Note that you can't use compression in combination with
+ the hard link feature.
- A `CCACHE_COMPILERCHECK` option has been added. This option tells ccache
what compiler-identifying information to hash to ensure that results
failed();
}
- compress = !getenv("CCACHE_NOCOMPRESS");
+ compress = getenv("CCACHE_COMPRESS") ? 1 : 0;
if (stat(tmp_stderr, &st) != 0) {
cc_log("Failed to stat %s", tmp_stderr);
* Easy installation.
* Low overhead.
* Optionally uses hard links where possible to avoid copies.
+* Optionally compresses files in the cache to reduce disk space.
LIMITATIONS
You can optionally set *CCACHE_CC* to force the name of the compiler to
use. If you don't do this then ccache works it out from the command line.
+*CCACHE_COMPRESS*::
+
+ If you set the environment variable *CCACHE_COMPRESS* then ccache will
+ compress object files and other compiler output it puts in the cache.
+ However, this setting has no effect on how files are retrieved from the
+ cache; compressed and uncompressed results will still be usable regardless
+ of this setting.
+
*CCACHE_COMPILERCHECK*::
By default, ccache includes the modification time (mtime) and size of the
compiler output rather than using a file copy. Using hard links is faster,
but can confuse programs like ``make'' that rely on modification times.
Hard links are never made for compressed cache files. This means that you
- typically also should set the *CCACHE_NOCOMPRESS* variable if you want to
- use hard links.
+ typically should not set the *CCACHE_COMPRESS* variable if you want to use
+ hard links.
*CCACHE_HASHDIR*::
of levels of hash in the cache directory. The default is 2. The minimum is
1 and the maximum is 8.
-*CCACHE_NOCOMPRESS*::
-
- If you set the environment variable *CCACHE_NOCOMPRESS* then no compression
- is used for files that go into the cache. However, this setting has no
- effect on how files are retrieved from the cache; compressed results will
- still be usable.
-
*CCACHE_NODIRECT*::
If you set the environment variable *CCACHE_NODIRECT* then ccache will not
CACHE COMPRESSION
-----------------
-By default, ccache will compress all files it puts into the cache using the
+ccache can optionally compress all files it puts into the cache using the
compression library zlib. While this involves a negligible performance
slowdown, it significantly increases the number of files that fit in the cache.
-You can turn off compression by setting the *CCACHE_NOCOMPRESS* environment
+You can turn on compression by setting the *CCACHE_COMPRESS* environment
variable.
unset CCACHE_BASEDIR
unset CCACHE_CC
unset CCACHE_COMPILERCHECK
+unset CCACHE_COMPRESS
unset CCACHE_CPP2
unset CCACHE_DIR
unset CCACHE_DISABLE
unset CCACHE_HASHDIR
unset CCACHE_LOGFILE
unset CCACHE_NLEVELS
-unset CCACHE_NOCOMPRESS
unset CCACHE_NODIRECT
unset CCACHE_NOSTATS
unset CCACHE_PATH
##################################################################
# Check that compressed and uncompressed files get the same hash sum.
testname="compression hash sum"
- $CCACHE $COMPILER -c test.c
+ CCACHE_COMPRESS=1 $CCACHE $COMPILER -c test.c
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- $CCACHE $COMPILER -c test.c
+ CCACHE_COMPRESS=1 $CCACHE $COMPILER -c test.c
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 1
checkstat 'cache miss' 1
- CCACHE_NOCOMPRESS=1 $CCACHE $COMPILER -c test.c
+ $CCACHE $COMPILER -c test.c
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 2
checkstat 'cache miss' 1