Joel Rosdahl [Mon, 20 Mar 2023 19:42:14 +0000 (20:42 +0100)]
fix: Disable the inode cache by default
There have reports of ccache processes hanging on futex calls related to
the inode cache. (The inode cache synchronization mechanism has been
reworked not to use pthread mutexes in ccache 4.8, so the inode cache is
enabled by default in 4.8 and newer.)
Joel Rosdahl [Thu, 17 Nov 2022 20:31:58 +0000 (21:31 +0100)]
fix: Avoid race condition in inode cache for quick updates
The inode cache has a race condition that consists of these events:
1. A file is written with content C1, size S and timestamp (ctime/mtime)
T.
2. Ccache hashes the file content and asks the inode cache to store the
digest with a hash of S and T (and some other data) as the key.
3. The file is quickly thereafter written with content C2 without
changing size S and timestamp T. The timestamp is not updated since
the file writes are made within a time interval smaller than the
granularity of the clock used for file system timestamps. At the time
of writing, a common granularity on a Linux system is 0.004 s (250
Hz).
4. The inode cache is asked for the file digest and the inode cache
delivers a digest of C1 even though the file's content is C2.
To avoid the race condition, the inode cache now only caches inodes
whose timestamp was updated more than two seconds ago. This conservative
value is chosen since not all file systems have subsecond resolution.
Joel Rosdahl [Sat, 5 Nov 2022 12:03:22 +0000 (13:03 +0100)]
feat: Include I_MPI_CC/I_MPI_CXX in the input hash
The I_MPI_CC and I_MPI_CXX variables affect which underlying compiler
ICC uses. Reference:
<https://www.intel.com/content/www/us/en/develop/documentation/
mpi-developer-reference-windows/top/environment-variable-reference/
compilation-environment-variables.html>.
rblx-kbuck [Fri, 28 Oct 2022 18:41:28 +0000 (11:41 -0700)]
fix: Process the argument following a -Xarch argument (#1199)
Since there are already checks enforcing that all -Xarch arguments match
each other and -arch, we can assume that the compiler would also
interpret the following argument, so ccache should interpret it too.
Joel Rosdahl [Sat, 15 Oct 2022 18:26:18 +0000 (20:26 +0200)]
refactor: Rename ShowIncludesParser to MsvcShowIncludesOutput
I think that this is more in line with what the namespace represents. I
also renamed ShowIncludesParser::tokenize to
MsvcShowIncludesOutput::get_includes since it's not returning generic
tokens but specifically includes files.
Orgad Shaneh [Wed, 12 Oct 2022 18:49:07 +0000 (21:49 +0300)]
test: Make the integration tests work under Windows (#1133)
Adapted the integration test scripts to be able to run on Windows.
- Added the ".sh" extension to most shell scripts. It looks like Windows needs
this to run the scripts.
- Added special handling of carriage return characters.
- Tests that fail are deactivated for the moment.
- Added additional runners in different Msys2 environments.
- Disabled the remote_http tests "Basic auth required" and "Basic auth failed"
due to intermittent failures.
- Disabled PCH tests for MSYS/Clang.
Co-authored-by: R. Voggenauer <rvogg@users.noreply.github.com>
Orgad Shaneh [Wed, 5 Oct 2022 18:24:14 +0000 (21:24 +0300)]
fix: Retain line CRLF in compiler output on Windows (#1173)
When the cached data is read, the output to fd is binary
(Util::send_to_fd), so in order to maintain the original
line endings, the output must be stored as binary too.
Joel Rosdahl [Tue, 4 Oct 2022 19:31:12 +0000 (21:31 +0200)]
feat: Improve handling of -frandom-seed and description of sloppiness
I should not be necessary to distinguish between existence and
non-existence of -frandom-seed if random_seed sloppiness is requested,
so don't hash the "-frandom-seed=" part either.
Joel Rosdahl [Mon, 3 Oct 2022 18:18:03 +0000 (20:18 +0200)]
feat: Improve statistics for remote hits/misses
ccache collects statistics about local and remote storage layer get/put
operations and describes them as "local/remote hits/misses" in the
output of "ccache -s". However, since "hits" and "misses" mean "result
hit/miss" in the "cacheable calls" section, it's easy to think that they
measure the same thing.
This commit improves the situation by:
- Adding new "local/remote hits/misses" counters that mean "result
hit/miss". These are shown if remote storage is used (since they
otherwise are redundant and equal to the normal "hits/misses"
counters) or if the -v/--verbose option is given.
- Presenting the previous "local/remote hits/misses" counters as
"local/remote reads". Only shown in verbose mode.
- Adding "local/remote writes" counters. Only shown in verbose mode.
Joel Rosdahl [Sun, 25 Sep 2022 18:28:40 +0000 (20:28 +0200)]
chore: Rename primary/secondary storage to local/remote storage
There is a feature request to be able not to use a local cache at all,
only a network cache. With such a feature, the names "primary storage"
and "secondary storage" make less sense since ccache would be operating
in "secondary only" mode, but then that storage would of course become
the primary (and only).
Let's rename "primary storage" to "local storage" and "secondary
storage" to "remote storage" – operating in "remote only" mode then
makes sense.
One of the original motivations to call networked storage "secondary" is
that the file storage can be used for local file systems as well, making
such storage "not quite remote", but in practice I guess the file
storage backend used primarily for network file systems.