summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* enhance: Make it possible for LockFile::try_acquire to break the lockJoel Rosdahl2023-01-151-11/+12
| | | | | | | | | | | 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.
* feat: Consistently show cache size and max size with one decimalJoel Rosdahl2023-01-111-3/+3
|
* enhance: Make util::LockFile movableJoel Rosdahl2023-01-112-0/+40
|
* chore: Add missing explicit keywords to some constructorsJoel Rosdahl2023-01-112-2/+2
|
* fix: Avoid sometimes too wide percent figure in --show-statsJoel Rosdahl2023-01-111-3/+6
| | | | | | | 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.
* enhance: Add offsetted get/set/increment methods for StatisticsCountersJoel Rosdahl2023-01-112-7/+33
|
* feat: Activate logging for command mode optionsJoel Rosdahl2023-01-111-0/+2
| | | | | This makes it possible to check ordinary log messages when debugging "ccache -c" and similar options.
* enhance: Make storage::local::StatsFile movableJoel Rosdahl2023-01-111-1/+1
|
* feat: Do clean/clear/evict-style operations per level 2 directoryJoel Rosdahl2023-01-114-299/+319
| | | | | | 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.
* refactor: Merge LocalStorage implemention filesJoel Rosdahl2023-01-117-542/+437
|
* chore: Remove special logic for cleaning up legacy ccache filesJoel Rosdahl2023-01-111-18/+0
|
* refactor: Use std::size to compute array sizeJoel Rosdahl2023-01-111-10/+5
|
* chore: Clean up minor things after 95e6375813f7Joel Rosdahl2023-01-041-12/+10
|
* fix: Use spinlocks for inode cache memory synchronization (#1229)Oleg Sidorkin2023-01-042-35/+65
| | | | | | | | | | | 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.
* fix: Only use original umask when retrieving resultJoel Rosdahl2022-12-231-2/+1
| | | | | | | 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.
* fix: Fix matching of base directory for MSVCJoel Rosdahl2022-12-233-11/+22
| | | | | | 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.
* fix: Don't crash in TextTable for a single heading rowJoel Rosdahl2022-12-231-0/+3
|
* fix: Do not escape backslashes in MSVC RSP files (#1233)Raihaan Shouhell2022-12-231-1/+1
|
* fix: Improve fix for local/remote cache misses in depend modeJoel Rosdahl2022-12-203-18/+20
|
* fix: Fix reporting of local/remote cache misses in depend modeJoel Rosdahl2022-12-133-0/+15
|
* fix: Fix conditions for --show-statsJoel Rosdahl2022-12-131-2/+4
|
* enhance: Extract lock keep-alive thread to a manager classJoel Rosdahl2022-12-137-75/+173
| | | | | | 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.
* enhance: Add AtomicFile::flush methodJoel Rosdahl2022-12-132-0/+10
|
* chore: Refine ProgressBar value calculationJoel Rosdahl2022-12-131-4/+10
|
* chore: Improve description of --set-configJoel Rosdahl2022-12-131-1/+1
|
* refactor: Make LockFile guard itself without a LockFileGuardJoel Rosdahl2022-12-134-166/+82
|
* fix: Don't use copy of mutex/condition in long-lived lock threadJoel Rosdahl2022-12-131-1/+1
| | | | | | 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.
* enhance: Allow short-lived lock file to wait for long-livedJoel Rosdahl2022-12-132-26/+20
|
* refactor: Improve FileRecompressor to take a statJoel Rosdahl2022-11-274-40/+40
| | | | This avoids extra stats in some scenarios.
* refactor: Remove CacheFile, using Stat with path member insteadJoel Rosdahl2022-11-279-129/+47
|
* enhance: Remember path in StatJoel Rosdahl2022-11-272-0/+11
|
* enhance: Only keep atime if neededJoel Rosdahl2022-11-274-6/+14
| | | | | | | - 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.
* feat: Add --trim-recompress and --trim-recompress-threadsJoel Rosdahl2022-11-272-32/+116
| | | | | | Note: Reading the header to check the current compression level affects atime, so we need to restore atime even when recompression is not performed.
* refactor: Extract file recompression code to a classJoel Rosdahl2022-11-274-136/+176
|
* enhance: Add Util::format_human_readable_diffJoel Rosdahl2022-11-272-0/+10
|
* feat: Improve Util::format_human_readable_size for small sizesJoel Rosdahl2022-11-271-1/+5
|
* feat: Add --recompress-threads optionJoel Rosdahl2022-11-273-4/+20
|
* fix: Fix edge case where a non-temporal identifier is misidentified (#1227)Erik Flodin2022-11-271-3/+3
| | | | | | | 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.
* chore: Fix typoJoel Rosdahl2022-11-201-1/+1
|
* fix: Avoid race condition in inode cache for quick updatesJoel Rosdahl2022-11-202-4/+39
| | | | | | | | | | | | | | | | | | | | | | | 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.
* fix: Fall back to emulation for unsupported posix_fallocate (#1222)Oleg Sidorkin2022-11-141-3/+7
| | | | | | | 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.
* fix: Use $XDG_RUNTIME_DIR/ccache-tmp as the default temporary directoryJoel Rosdahl2022-11-131-3/+4
| | | | See discussion in #1221.
* fix: Fix bug in Duration arithmetic operatorsJoel Rosdahl2022-11-131-4/+4
| | | | The bug only affected LongLivedLockFile, which is not used yet.
* perf: Optimize util::write_file for empty dataJoel Rosdahl2022-11-131-2/+2
|
* fix: Do not create /run directory on systems that don't have it (#1221)Oleg Sidorkin2022-11-131-3/+5
|
* fix: Don't consider temporary files incompressibleJoel Rosdahl2022-11-101-1/+2
|
* fix: Properly wait for recompression jobs if there is no f subdirJoel Rosdahl2022-11-101-0/+3
|
* enhance: Make subsequent calls to ThreadPool::shut_down NOPsJoel Rosdahl2022-11-101-0/+4
|
* refactor: Avoid changing loop variable in body of for loopJoel Rosdahl2022-11-102-2/+6
| | | | This is to please CodeQL's "For loop variable changed in body" check.
* refactor: Remove empty if clauseJoel Rosdahl2022-11-101-4/+5
| | | | This is to please CodeQL's "Futile condition" check.