-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.empy
175 lines (151 loc) · 6.11 KB
/
index.empy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
@# -*- html -*-
@{page_id = "overview"}
@{page_title = "Compiler cache"}
@empy.include("header.empy")
<div style="float: right; font-size: 90%; margin: 0 1em 0 2em;">
<h1>News</h1>
@{
import yaml
news = list(yaml.safe_load_all(open("news.yaml")))
}@
<ul class="news">
@[for x in news[:10]]
<li><i>@(x["date"]):</i> <a href="news.html#@(x["date"])"><b>@(x["header"])</b></a></li>
@[end for]
<li><a href="news.html">All news</a></li>
</ul>
</div>
<h1>About</h1>
<p>
Ccache is a compiler cache. It <a href="performance.html">speeds up
recompilation</a> by caching previous compilations and detecting when the same
compilation is being done again. Ccache is free software, released under
the <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License
version 3</a> or later. See also the <a href="license.html">license page</a>.
</p>
<p>Latest release: <a href="download.html">version @(latest_version)</a></p>
<h2 style="clear: right;">Features</h2>
<ul>
<li>
Supports GCC, Clang, MSVC (Microsoft Visual C++) and other similar
compilers<sup class="footnote">[1]</sup>.
(<a href="platform-compiler-language-support.html">details</a>)
</li>
<li>
Works on Linux, macOS, other Unix-like operating
systems<sup class="footnote">[1]</sup> and
Windows<sup class="footnote">[1]</sup>.
(<a href="platform-compiler-language-support.html">details</a>)
</li>
<li>
Understands C, C++, assembler, CUDA,
Objective-C<sup class="footnote">[1]</sup> and
Objective-C++<sup class="footnote">[1]</sup>.
(<a href="platform-compiler-language-support.html">details</a>)
</li>
<li>
Supports remote caching over HTTP (e.g. using Nginx or Google Cloud
Storage), Redis or NFS, optionally sharding data onto a server cluster.
(<a href="manual/@(latest_version).html#_remote_storage_backends">details</a>)
</li>
<li>
Supports fast "direct" and "depend" modes that don't rely on using the
preprocessor.
(<a href="manual/@(latest_version).html#_how_ccache_works">details</a>)
</li>
<li>
Uses an inode cache to avoid having to hash the same header files repeatedly
during a build (on supported OSes and file systems).
(<a href="manual/@(latest_version).html#config_inode_cache">details</a>)
</li>
<li>Supports compression using <a href="http://zstd.net">Zstandard</a>.</li>
<li>
Checksums cache content using <a href="http://xxhash.com">XXH3</a> to detect data
corruption.
</li>
<li>
Keeps statistics on hits/misses.
(<a href="manual/@(latest_version).html#_cache_statistics">details</a>)
</li>
<li>
Automatic cache size management.
(<a href="manual/@(latest_version).html#_cache_size_management">details</a>)
</li>
<li>
Easy installation.
(<a href="manual/@(latest_version).html#_run_modes">details</a>)
</li>
<li>
Low overhead. (<a href="performance.html">details</a>)
</li>
<li>
Support for rewriting absolute paths to relative in order to increase the
cache hit ratio.
(<a href="manual/@(latest_version).html#_compiling_in_different_directories">details</a>)
</li>
<li>
Optionally uses file cloning (AKA “reflinks”) where possible to avoid
copies.
</li>
<li>Optionally uses hard links where possible to avoid copies.</li>
</ul>
<p>
<sup>[1]</sup> Might have limited support — see
<a href="platform-compiler-language-support.html">supported platforms,
compilers and languages</a>.
</p>
<h2>Limitations</h2>
<ul>
<li>
Only knows how to cache the compilation of a single file. Other types of
compilations (multi-file compilation, linking, etc) will silently fall back
to running the real compiler.
</li>
<li>
Some compiler flags are not supported. If such a flag is detected, ccache
will silently fall back to running the real compiler.
</li>
<li>
The fastest mode (the "direct mode") has a corner case which can result in
false positive cache hits. This and other minor limitations are listed
under <a href="manual/@(latest_version).html#_caveats">caveats</a> in the
manual.
</li>
</ul>
<h2>Why bother?</h2>
<p>If you ever run <code>make clean; make</code>, you can probably benefit from
ccache. It is common for developers to do a clean build of a project for a
whole host of reasons, and this throws away all the information from your
previous compilations. By using ccache, recompilation goes much faster.</p>
<p>Another reason to use ccache is that the same cache is used for builds in
different directories. If you have several versions or branches of a software
stored in different directories, many of the object files in a build directory
can probably be taken from the cache even if they were compiled for another
version or branch.</p>
<p>A third scenario is using ccache to speed up clean builds performed by
servers or build farms that regularly check that the code is buildable.</p>
<p>You can also share the cache between users, which can be very useful on
shared compilation servers.</p>
<h2>Is it safe?</h2>
<p>The most important aspect of a compiler cache is to always produce exactly
the same output that the real compiler would produce. This includes providing
exactly the same object files and exactly the same compiler warnings that would
be produced if you use the real compiler. The only way you should be able to
tell that you are using ccache is the speed.</p>
<p>Ccache of course tries to provide these guarantees. However:</p>
<ul>
<li>
Compilers are moving targets. Newer compiler versions may, and often do,
introduce features that ccache can't foresee. In some cases it's also very
hard for ccache to handle the compiler behaviors in a good way, especially
in a way that is backward compatible with legacy compilers.
</li>
<li>
The fastest mode (the "direct mode") has a corner case which can result in
false positive cache hits. This and other minor limitations are listed under
<a href="manual/@(latest_version).html#_caveats">caveats</a> in the manual.
</li>
</ul>
<p>If you experience any bugs or undocumented limitations, please
<a href="bugs.html">report them</a>.</p>
@empy.include("footer.empy")