| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
If a long-lived lock is stale and has no alive file,
LockFile::try_acquire will never succeed to acquire the lock. Fix this
by creating the alive file for all lock types and making
LockFile::try_acquire exit when lock activity is seen instead of
immediately after failing to acquire the lock.
Another advantage is that a stale lock can now always be broken right
away if the alive file exists.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
If the nominator is 99999 and the denominator is 100000, the percent
function in Statistics.cpp would return "(100.00%)" instead of the
wanted "(100.0%)". Fix this by using the alternate format string if the
result string overflows its target size.
|
| |
|
|
|
|
|
| |
This makes it possible to check ordinary log messages when debugging
"ccache -c" and similar options.
|
| |
|
|
|
|
|
|
| |
Progress bars will now be smoother since the operations are now divided
into 256 instead of 16 "read files + act on files" steps. This is also
in preparation for future improvements related to cache cleanup.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Changed the inode cache implementation to use spinlocks instead of pthread
mutexes. This makes the inode cache work on FreeBSD and other systems where the
pthread mutexes are destroyed when the last memory mapping containing the
mutexes is unmapped.
Also added tmpfs, ufs and zfs to the list of supported filesystems on macOS and
BSDs.
See also ccache discussion #1228.
|
|
|
|
|
|
|
| |
This fixes a problem where the original umask would be used when storing
a remote cache result in the local cache in from_cache.
Fixes #1235.
|
|
|
|
|
|
| |
The base directory will now match case-insensitively with absolute paths
in preprocessed output, or from /showIncludes in the depend mode case,
when compiling with MSVC.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Instead of running one keep-alive thread per lock, a long-lived LockFile
now lets a separate LongLivedLockFileManager object handle keep-alive
for several locks in a single thread.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This was kind of due to a typo in
0babd33e84147e923a729ee07a3b85097ec8baa8. Since the LongLivedLockFile
class is not used yet, the bug does not affect any released code.
|
| |
|
|
|
|
| |
This avoids extra stats in some scenarios.
|
| |
|
| |
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
| |
Note: Reading the header to check the current compression level affects
atime, so we need to restore atime even when recompression is not
performed.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Fixes #1215.
|
|
|
|
|
|
|
| |
posix_fallocate can return EINVAL if filesystem doesn't support it. Fall back to emulation in this case.
E.g. ZFS does so on FreeBSD (haven't tested with ZFS on linux).
This fixes Utill::fallocate unit tests on ZFS.
|
|
|
|
| |
See discussion in #1221.
|
|
|
|
| |
The bug only affected LongLivedLockFile, which is not used yet.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This is to please CodeQL's "For loop variable changed in body" check.
|
|
|
|
| |
This is to please CodeQL's "Futile condition" check.
|