Joel Rosdahl [Thu, 10 Nov 2022 09:15:12 +0000 (10:15 +0100)]
enhance: Only keep atime if needed
- For the --recompress case, only reset timestamps if mtime has changed
since local cache LRU cleanup always uses mtime.
- For the --trim-dir/--trim-recompress case, always reset timestamps
since atime may be used for LRU cleanup.
Erik Flodin [Sun, 27 Nov 2022 20:32:36 +0000 (21:32 +0100)]
fix: Fix edge case where a non-temporal identifier is misidentified (#1227)
If a non-temporal identifier, that ends with a temporal macro, happens
to be at the end of the buffer with the temporal suffix starting on the
avx boundary, then it would be incorrectly classified as a temporal
macro. This since the helper function lacks the context to see that the
data before the match is something that invalidates the match.
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.