<body class="article">\r
<div id="header">\r
<h1>ccache authors</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-17 19:55:54 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
</div>\r
</div>\r
</body>\r
<body class="article">\r
<div id="header">\r
<h1>ccache installation</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-15 16:04:58 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
</div>\r
</div>\r
</body>\r
<body class="article">\r
<div id="header">\r
<h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-15 16:04:58 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
</div>\r
</div>\r
</body>\r
<body class="article">\r
<div id="header">\r
<h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</p>\r
</dd>\r
<dt class="hdlist1">\r
-<strong>stats</strong> (<strong>CCACHE_STATS</strong>) [boolean]\r
+<strong>max_files</strong> (<strong>CCACHE_MAXFILES</strong>)\r
</dt>\r
<dd>\r
<p>\r
- If true, ccache will update the statistics counters on each compilation.\r
- The default is true.\r
+ This option specifies the maximum number of files to keep in the cache. Use\r
+ 0 for no limit (which is the default).\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>max_size</strong> (<strong>CCACHE_MAXSIZE</strong>)\r
+</dt>\r
+<dd>\r
+<p>\r
+ This option specifies the maximum size of the cache. Use 0 for no limit.\r
+ The default value is 5G. Available suffixes: k, M, G, T (decimal) and Ki,\r
+ Mi, Gi, Ti (binary). The default suffix is "G".\r
</p>\r
</dd>\r
<dt class="hdlist1">\r
</p>\r
</dd>\r
<dt class="hdlist1">\r
-<strong>reache</strong> (<strong>CCACHE_RECACHE</strong>) [boolean]\r
+<strong>recache</strong> (<strong>CCACHE_RECACHE</strong>) [boolean]\r
</dt>\r
<dd>\r
<p>\r
information.</p></div>\r
</dd>\r
<dt class="hdlist1">\r
+<strong>stats</strong> (<strong>CCACHE_STATS</strong>) [boolean]\r
+</dt>\r
+<dd>\r
+<p>\r
+ If true, ccache will update the statistics counters on each compilation.\r
+ The default is true.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
<strong>temporary_dir</strong> (<strong>CCACHE_TEMPDIR</strong>)\r
</dt>\r
<dd>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-15 16:04:58 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
</div>\r
</div>\r
</body>\r
If set to a file path, ccache will write information on what it is doing to
the specified file. This is useful for tracking down problems.
-*stats* (*CCACHE_STATS*) [boolean]::
+*max_files* (*CCACHE_MAXFILES*)::
- If true, ccache will update the statistics counters on each compilation.
- The default is true.
+ This option specifies the maximum number of files to keep in the cache. Use
+ 0 for no limit (which is the default).
+
+*max_size* (*CCACHE_MAXSIZE*)::
+
+ This option specifies the maximum size of the cache. Use 0 for no limit.
+ The default value is 5G. Available suffixes: k, M, G, T (decimal) and Ki,
+ Mi, Gi, Ti (binary). The default suffix is "G".
*path* (*CCACHE_PATH*)::
from the cache using the direct mode, not the preprocessor mode. See
documentation for *read_only* regarding using a read-only ccache directory.
-*reache* (*CCACHE_RECACHE*) [boolean]::
+*recache* (*CCACHE_RECACHE*) [boolean]::
If true, ccache will not use any previously stored result. New results will
still be cached, possibly overwriting any pre-existing results.
See the discussion under <<_troubleshooting,TROUBLESHOOTING>> for more
information.
+*stats* (*CCACHE_STATS*) [boolean]::
+
+ If true, ccache will update the statistics counters on each compilation.
+ The default is true.
+
*temporary_dir* (*CCACHE_TEMPDIR*)::
This setting specifies where ccache will put temporary files. The default
<body class="article">\r
<div id="header">\r
<h1>ccache news</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>\r
<div id="content">\r
<div class="sect1">\r
+<h2 id="_ccache_3_2_1">ccache 3.2.1</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2014-12-10</p></div>\r
+<div class="sect2">\r
+<h3 id="_bug_fixes">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed regression in temporary file handling, which lead to incorrect\r
+ permissions for stats, manifest and ccache.conf files in the cache.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<code>CACHEDIR.TAG</code> files are now created in the [0-9a-f] subdirectories so that\r
+ ccache.conf is not lost in backups.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Made the default cache size suffix <code>G</code>, as previously documented.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<code>-fdiagnostics-color=auto</code> is now passed to the compiler even if stderr is\r
+ redirected. This fixes a problem when, for instance, a configure test probes\r
+ if the compiler (wrapped via ccache) supports <code>-fdiagnostics-color=auto</code>.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Added missing documentation for <code>max_files</code> and <code>max_size</code> configuration\r
+ options.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
<h2 id="_ccache_3_2">ccache 3.2</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2014-11-17</p></div>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2013-01-06</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2012-01-08</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-28</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-21</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-07</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-17 19:56:32 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-10 20:38:47 CET\r
</div>\r
</div>\r
</body>\r
===========
+ccache 3.2.1
+------------
+Release date: 2014-12-10
+
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed regression in temporary file handling, which lead to incorrect
+ permissions for stats, manifest and ccache.conf files in the cache.
+
+- `CACHEDIR.TAG` files are now created in the [0-9a-f] subdirectories so that
+ ccache.conf is not lost in backups.
+
+- Made the default cache size suffix `G`, as previously documented.
+
+- `-fdiagnostics-color=auto` is now passed to the compiler even if stderr is
+ redirected. This fixes a problem when, for instance, a configure test probes
+ if the compiler (wrapped via ccache) supports `-fdiagnostics-color=auto`.
+
+- Added missing documentation for `max_files` and `max_size` configuration
+ options.
+
+
ccache 3.2
----------
Release date: 2014-11-17
.\" Title: ccache
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 11/17/2014
+.\" Date: 12/10/2014
.\" Manual: ccache Manual
-.\" Source: ccache 3.2
+.\" Source: ccache 3.2.1
.\" Language: English
.\"
-.TH "CCACHE" "1" "11/17/2014" "ccache 3\&.2" "ccache Manual"
+.TH "CCACHE" "1" "12/10/2014" "ccache 3\&.2\&.1" "ccache Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
If set to a file path, ccache will write information on what it is doing to the specified file\&. This is useful for tracking down problems\&.
.RE
.PP
-\fBstats\fR (\fBCCACHE_STATS\fR) [boolean]
+\fBmax_files\fR (\fBCCACHE_MAXFILES\fR)
.RS 4
-If true, ccache will update the statistics counters on each compilation\&. The default is true\&.
+This option specifies the maximum number of files to keep in the cache\&. Use 0 for no limit (which is the default)\&.
+.RE
+.PP
+\fBmax_size\fR (\fBCCACHE_MAXSIZE\fR)
+.RS 4
+This option specifies the maximum size of the cache\&. Use 0 for no limit\&. The default value is 5G\&. Available suffixes: k, M, G, T (decimal) and Ki, Mi, Gi, Ti (binary)\&. The default suffix is "G"\&.
.RE
.PP
\fBpath\fR (\fBCCACHE_PATH\fR)
regarding using a read\-only ccache directory\&.
.RE
.PP
-\fBreache\fR (\fBCCACHE_RECACHE\fR) [boolean]
+\fBrecache\fR (\fBCCACHE_RECACHE\fR) [boolean]
.RS 4
If true, ccache will not use any previously stored result\&. New results will still be cached, possibly overwriting any pre\-existing results\&.
.RE
for more information\&.
.RE
.PP
+\fBstats\fR (\fBCCACHE_STATS\fR) [boolean]
+.RS 4
+If true, ccache will update the statistics counters on each compilation\&. The default is true\&.
+.RE
+.PP
\fBtemporary_dir\fR (\fBCCACHE_TEMPDIR\fR)
.RS 4
This setting specifies where ccache will put temporary files\&. The default is
while (p) {
tmp_unlink(p->path);
p = p->next;
- /* Leak p->path and p here because clean_up_pending_tmp_files needs to be signal
- * safe. */
+ /* Leak p->path and p here because clean_up_pending_tmp_files needs to be
+ * signal safe. */
}
}
put_file_in_cache(output_obj, cached_obj);
stats_update(STATS_TOCACHE);
- /* Make sure we have a CACHEDIR.TAG
- * This can be almost anywhere, but might as well do it near the end
- * as if we exit early we save the stat call
+ /* Make sure we have a CACHEDIR.TAG in the cache part of cache_dir. This can
+ * be done almost anywhere, but we might as well do it near the end as we
+ * save the stat call if we exit early.
*/
- if (create_cachedirtag(conf->cache_dir) != 0) {
- cc_log("Failed to create %s/CACHEDIR.TAG (%s)\n",
- conf->cache_dir, strerror(errno));
- stats_update(STATS_ERROR);
- failed();
+ {
+ char *first_level_dir = dirname(stats_file);
+ if (create_cachedirtag(first_level_dir) != 0) {
+ cc_log("Failed to create %s/CACHEDIR.TAG (%s)\n",
+ first_level_dir, strerror(errno));
+ stats_update(STATS_ERROR);
+ failed();
+ }
+ free(first_level_dir);
+
+ /* Remove any CACHEDIR.TAG on the cache_dir level where it was located in
+ * previous ccache versions. */
+ if (getpid() % 1000 == 0) {
+ char *path = format("%s/CACHEDIR.TAG", conf->cache_dir);
+ unlink(path);
+ free(path);
+ }
}
free(tmp_stderr);
/* Output is redirected, so color output must be forced. */
args_add(stripped_args, "-fdiagnostics-color=always");
cc_log("Automatically forcing colors");
+ } else {
+ args_add(stripped_args, argv[i]);
}
found_color_diagnostics = true;
continue;
output_is_precompiled_header =
actual_language && strstr(actual_language, "-header");
- if (output_is_precompiled_header && !(conf->sloppiness & SLOPPY_PCH_DEFINES)) {
+ if (output_is_precompiled_header
+ && !(conf->sloppiness & SLOPPY_PCH_DEFINES)) {
cc_log("You have to specify \"pch_defines,time_macros\" sloppiness when"
" creating precompiled headers");
stats_update(STATS_CANTUSEPCH);
}
}
+ if (strstr(p, "CACHEDIR.TAG")) {
+ goto out;
+ }
+
if (num_files == allocated) {
allocated = 10000 + num_files*2;
files = (struct files **)x_realloc(files, sizeof(struct files *)*allocated);
/* Get the per directory limits */
void
-stats_get_obsolete_limits(const char *dir, unsigned *maxfiles, uint64_t *maxsize)
+stats_get_obsolete_limits(const char *dir, unsigned *maxfiles,
+ uint64_t *maxsize)
{
struct counters *counters = counters_init(STATS_END);
char *sname = format("%s/stats", dir);
unset CCACHE_TEMPDIR
unset CCACHE_UMASK
unset CCACHE_UNIFY
+unset GCC_COLORS
# Many tests backdate files, which updates their ctimes. In those tests, we
# must ignore ctimes. Might as well do so everywhere.
/*
- * Copyright (C) 2010-2012 Joel Rosdahl
+ * Copyright (C) 2010-2014 Joel Rosdahl
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
#include "ccache.h"
#include "test/framework.h"
+#include "util.h"
#if defined(HAVE_TERMIOS_H)
#define USE_COLOR
suite_fn *suite;
int tty = is_tty(1);
+ x_unsetenv("GCC_COLORS"); /* Avoid confusing argument processing tests. */
verbose = verbose_output;
for (suite = suites; *suite; suite++) {
size_t i;
struct { const char *size; int64_t expected; } sizes[] = {
{"0", 0},
- {"42", 42},
+ {"42", (int64_t)42 * 1000 * 1000 * 1000}, /* Default suffix: G */
{"78k", 78 * 1000},
{"78K", 78 * 1000},
}
#endif
+#ifndef _WIN32
+static mode_t
+get_umask(void)
+{
+ static bool mask_retrieved = false;
+ static mode_t mask;
+ if (!mask_retrieved) {
+ mask = umask(0);
+ umask(mask);
+ mask_retrieved = true;
+ }
+ return mask;
+}
+#endif
+
/*
* Copy src to dest, decompressing src if needed. compress_level > 0 decides
* whether dest will be compressed, and with which compression level.
char buf[10240];
int n, written;
char *tmp_name;
-#ifndef _WIN32
- mode_t mask;
-#endif
struct stat st;
int errnum;
}
#ifndef _WIN32
- /* get perms right on the tmp file */
- mask = umask(0);
- fchmod(fd_out, 0666 & ~mask);
- umask(mask);
+ fchmod(fd_out, 0666 & ~get_umask());
#endif
/* the close can fail on NFS if out of space */
default:
return false;
}
+ } else {
+ /* Default suffix: G. */
+ x *= 1000 * 1000 * 1000;
}
*size = x;
return true;
if (fd == -1) {
fatal("Failed to create file %s: %s", template, strerror(errno));
}
+
+#ifndef _WIN32
+ fchmod(fd, 0666 & ~get_umask());
+#endif
+
free(*fname);
*fname = template;
return fd;
-const char CCACHE_VERSION[] = "3.2";
+const char CCACHE_VERSION[] = "3.2.1";