]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
13 months agochore: Update copyright years v4.8
Joel Rosdahl [Sun, 12 Mar 2023 21:00:43 +0000 (22:00 +0100)] 
chore: Update copyright years

13 months agochore: Update NEWS
Joel Rosdahl [Sun, 12 Mar 2023 21:00:38 +0000 (22:00 +0100)] 
chore: Update NEWS

13 months agoRevert "bump: Upgrade to zstd 1.5.4"
Joel Rosdahl [Sun, 12 Mar 2023 20:57:39 +0000 (21:57 +0100)] 
Revert "bump: Upgrade to zstd 1.5.4"

This reverts commit 1853902f75567089a5ef46511573c7f352c6c232.

zstd 1.5.4 requires CMake 3.18+ (by mistake), so downgrade for now.

13 months agochore: Fix typos
Joel Rosdahl [Wed, 8 Mar 2023 19:24:25 +0000 (20:24 +0100)] 
chore: Fix typos

13 months agochore: Add typos configuration
Joel Rosdahl [Wed, 8 Mar 2023 17:49:44 +0000 (18:49 +0100)] 
chore: Add typos configuration

13 months agofeat: Support overriding MSVC /Z* options
Joel Rosdahl [Wed, 8 Mar 2023 07:10:27 +0000 (08:10 +0100)] 
feat: Support overriding MSVC /Z* options

MSVC options /Zi and /ZI are too hard since they produce separate PDB
files. /Z7 is OK, but if the command line contains /Zi or /ZI followed
by /Z7, MSVC will use the latter (with a warning) but ccache will still
consider the command line too hard.

This commit makes ccache understand that only the last /Z* option will
be used and thus accepts the command line if the last /Z* option is /Z7.

Closes #1239.

13 months agorefactor: Improve InodeCache::get signature
Joel Rosdahl [Tue, 7 Mar 2023 19:40:10 +0000 (20:40 +0100)] 
refactor: Improve InodeCache::get signature

13 months agofeat: Make it possible to disable ccache for a certain source code file
Joel Rosdahl [Mon, 6 Mar 2023 20:22:25 +0000 (21:22 +0100)] 
feat: Make it possible to disable ccache for a certain source code file

13 months agoenhance: Add util::read_file_part<std::string> implementation
Joel Rosdahl [Mon, 6 Mar 2023 20:22:05 +0000 (21:22 +0100)] 
enhance: Add util::read_file_part<std::string> implementation

13 months agorefactor: Use util::BitSet for hash_source_code_file
Joel Rosdahl [Mon, 6 Mar 2023 19:26:06 +0000 (20:26 +0100)] 
refactor: Use util::BitSet for hash_source_code_file

13 months agorefactor: Use util::BitSet for core::Sloppiness
Joel Rosdahl [Sun, 5 Mar 2023 11:25:57 +0000 (12:25 +0100)] 
refactor: Use util::BitSet for core::Sloppiness

13 months agoenhance: Add util::BitSet
Joel Rosdahl [Sun, 5 Mar 2023 11:17:31 +0000 (12:17 +0100)] 
enhance: Add util::BitSet

14 months agobump: Upgrade to doctest 2.4.10
Joel Rosdahl [Sat, 4 Mar 2023 09:18:47 +0000 (10:18 +0100)] 
bump: Upgrade to doctest 2.4.10

14 months agofeat: Improve cache size presentation and specification
Joel Rosdahl [Thu, 2 Mar 2023 17:14:49 +0000 (18:14 +0100)] 
feat: Improve cache size presentation and specification

Aligned how cache size is presented (in "ccache --show-stats", "ccache
--show-compression", "ccache --recompress", debug logs, etc.) and
specified (in configuration files, "ccache --max-size" and "ccache
--trim-max-size"). The size units are now formatted according to the
type of size unit prefix used for the max_size/CCACHE_MAXSIZE setting: a
decimal size unit prefix (k/M/G/T with or without B for bytes) in
max_size means using decimal size unit prefix for presented sizes, and
similar for binary size unit prefixes (Ki/Mi/Gi/Ti with or without B for
bytes). If no unit is specified, GiB is assumed, . For example, "ccache -M
10" means 10 GiB.

Also aligned how cache sizes are calculated. Now all sizes are computed
as "apparent size", i.e., rounded up to the disk block size. This means
that the cache size in "--show-stats" and the sizes presented in
"--show-compression" and "--recompress" now match.

14 months agoenhance: Add util::TextTable::Cell::Cell(std::string_view)
Joel Rosdahl [Wed, 1 Mar 2023 18:06:26 +0000 (19:06 +0100)] 
enhance: Add util::TextTable::Cell::Cell(std::string_view)

14 months agofeat: Improve disk size calculation on Windows
Joel Rosdahl [Tue, 28 Feb 2023 20:46:46 +0000 (21:46 +0100)] 
feat: Improve disk size calculation on Windows

Windows file system block size is typically 4096 bytes, not 1024.

14 months agoenhance: Add util::likely_size_on_disk
Joel Rosdahl [Tue, 28 Feb 2023 20:46:11 +0000 (21:46 +0100)] 
enhance: Add util::likely_size_on_disk

14 months agoenhance: Add util::split_once(std::string&&, char)
Joel Rosdahl [Sat, 25 Feb 2023 13:27:32 +0000 (14:27 +0100)] 
enhance: Add util::split_once(std::string&&, char)

14 months agorefactor: Move Util::parse_size to util
Joel Rosdahl [Tue, 21 Feb 2023 20:34:18 +0000 (21:34 +0100)] 
refactor: Move Util::parse_size to util

14 months agorefactor: Move Util::format_{human,parsable}_* to util
Joel Rosdahl [Mon, 20 Feb 2023 20:12:03 +0000 (21:12 +0100)] 
refactor: Move Util::format_{human,parsable}_* to util

14 months agofeat: Improve error message when failing to parse command line config
Joel Rosdahl [Mon, 20 Feb 2023 19:56:09 +0000 (20:56 +0100)] 
feat: Improve error message when failing to parse command line config

14 months agochore: Remove now superfluous "this->" in lambda
Joel Rosdahl [Mon, 20 Feb 2023 19:51:27 +0000 (20:51 +0100)] 
chore: Remove now superfluous "this->" in lambda

It was needed for compatibility with older compilers.

14 months agochore: Always add -Wdouble-promotion to dev mode flags
Joel Rosdahl [Mon, 27 Feb 2023 20:13:19 +0000 (21:13 +0100)] 
chore: Always add -Wdouble-promotion to dev mode flags

Clang 3.4 is not longer supported anyway.

14 months agochore: Enable and fix some more warnings
Joel Rosdahl [Mon, 27 Feb 2023 18:22:45 +0000 (19:22 +0100)] 
chore: Enable and fix some more warnings

14 months agochore: Clean up Redis helper scripts a bit (#1254)
Anders Björklund [Wed, 22 Feb 2023 18:38:26 +0000 (19:38 +0100)] 
chore: Clean up Redis helper scripts a bit (#1254)

- Support any version of manifest and result.
- Skip over tmp dir and allow avoiding setnx.

14 months agofeat: Add support for setting per-compilation config on command line
Joel Rosdahl [Fri, 17 Feb 2023 07:26:08 +0000 (08:26 +0100)] 
feat: Add support for setting per-compilation config on command line

Closes #1035.

14 months agochore: Fix typos
Joel Rosdahl [Thu, 16 Feb 2023 06:40:58 +0000 (07:40 +0100)] 
chore: Fix typos

14 months agobump: Upgrade to zstd 1.5.4
Joel Rosdahl [Fri, 10 Feb 2023 19:32:56 +0000 (20:32 +0100)] 
bump: Upgrade to zstd 1.5.4

14 months agofix: Log config and command line before finding compiler
Joel Rosdahl [Wed, 8 Feb 2023 21:24:01 +0000 (22:24 +0100)] 
fix: Log config and command line before finding compiler

If the compiler can't be found then ccache exits early and doesn't print
the config and command line to the log. This makes it harder to debug
problems with finding the compiler, like issue #1249.

Improve this by logging "safe things" before searching for the compiler.

14 months agoperf: Don't update stats file when there are no incremented counters
Joel Rosdahl [Wed, 8 Feb 2023 21:08:43 +0000 (22:08 +0100)] 
perf: Don't update stats file when there are no incremented counters

This can happen for instance when ccache is about to exit with a fatal
error.

14 months agofix: Don't read first character of empty strings
Joel Rosdahl [Sat, 4 Feb 2023 14:33:45 +0000 (15:33 +0100)] 
fix: Don't read first character of empty strings

14 months agofix: Handle Unix-style paths as non-options to MSVC
Joel Rosdahl [Fri, 3 Feb 2023 12:11:57 +0000 (13:11 +0100)] 
fix: Handle Unix-style paths as non-options to MSVC

For MSVC, ccache treats all arguments starting with a slash as an
option, which makes it fail to detect the source code file if it's
passed as a Unix-style absolute path.

Fix this by not treating an argument as an option if it's (a) an unknown
option, and (b) the argument exists as a file in the file system.

Fixes #1230.

14 months agochore: Fix spelling in comment
Joel Rosdahl [Fri, 3 Feb 2023 06:32:45 +0000 (07:32 +0100)] 
chore: Fix spelling in comment

14 months agofeat: Log executed command lines on Windows
Joel Rosdahl [Thu, 2 Feb 2023 19:27:37 +0000 (20:27 +0100)] 
feat: Log executed command lines on Windows

14 months agofeat: Add quotes around arguments with space in logged command lines
Joel Rosdahl [Thu, 2 Feb 2023 19:25:34 +0000 (20:25 +0100)] 
feat: Add quotes around arguments with space in logged command lines

15 months agodocs: Fix bad reference to "Remote storage backends"
Joel Rosdahl [Wed, 1 Feb 2023 20:50:03 +0000 (21:50 +0100)] 
docs: Fix bad reference to "Remote storage backends"

15 months agofix: Fix rare crash in signal handler
Joel Rosdahl [Wed, 1 Feb 2023 20:04:39 +0000 (21:04 +0100)] 
fix: Fix rare crash in signal handler

If the process is signaled after SignalHandler::~SignalHandler has run
then this assert will trigger:

    ccache: SignalHandler.cpp:87: static void SignalHandler::on_signal(int): failed assertion: g_the_signal_handler

Fix this by deregistering the signal handler function before destructing
the SignalHandler object.

Fixes #1246.

15 months agobump: Upgrade to cpp-httplib 0.11.4
Joel Rosdahl [Tue, 31 Jan 2023 19:56:21 +0000 (20:56 +0100)] 
bump: Upgrade to cpp-httplib 0.11.4

15 months agobuild: Fix Zstd and Hiredis downloads for unstable GitHub archives
Joel Rosdahl [Mon, 30 Jan 2023 20:23:43 +0000 (21:23 +0100)] 
build: Fix Zstd and Hiredis downloads for unstable GitHub archives

The content of the Zstd and Hiredis GitHub source achive URLs like
<https://github.com/$X/$Y/archive/$tag.tar.gz> apparently change from
time to time. Color me surprised. [1] says that this is intentional
(although, at the time of writing, reverted temporarily). Let's use
another URL for Zstd and not verify the checksum for Hiredis (since
there is no release source archive).

[1]: https://github.blog/changelog/2023-01-30-git-archive-checksums-may-change/

15 months agoci: Upgrade to Node 16-based actions
Joel Rosdahl [Mon, 30 Jan 2023 19:31:34 +0000 (20:31 +0100)] 
ci: Upgrade to Node 16-based actions

Reference:
<https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/>

15 months agofix: Cache path relativization in preprocessed output
Joel Rosdahl [Sun, 29 Jan 2023 12:12:30 +0000 (13:12 +0100)] 
fix: Cache path relativization in preprocessed output

After PR #1033 and [1], a stat call is made each time a note about an
include file is found in the preprocessed output. Such calls are very
performant on Linux (and therefore unnoticed until now), but apparently
costly on Windows.

Fix this by caching the calculation of relative paths in
process_preprocessed_file.

[1]: 9a05332915d2808f4713437006b3f7c812d9fd74

Closes #1245.

15 months agofix: Disable inode cache if filesystem risks getting full soon
Joel Rosdahl [Mon, 23 Jan 2023 21:14:54 +0000 (22:14 +0100)] 
fix: Disable inode cache if filesystem risks getting full soon

Some filesystems, for instance btrfs with compression enabled,
apparently make a posix_fallocate call succeed without actually
allocating the requested space for the file. This means that if the file
is mapped into memory, like done by the inode cache, the process can
crash when accessing the memory if the filesystem is full.

This commit implements a workaround: the inode cache is disabled if the
filesystem reports that it has less than 100 MiB free space. The free
space check is valid for one second before it is done again. This should
hopefully make crashes very rare in practice.

Closes #1236.

15 months agoci: Build macOS binary in release mode
Joel Rosdahl [Sun, 29 Jan 2023 11:36:13 +0000 (12:36 +0100)] 
ci: Build macOS binary in release mode

15 months agofeat: Allow forcing download of zstd and hiredis again
Joel Rosdahl [Fri, 27 Jan 2023 12:09:25 +0000 (13:09 +0100)] 
feat: Allow forcing download of zstd and hiredis again

Before it was possible to force downloading of the Zstandard library
using "-D ZSTD_FROM_INTERNET=ON" and similar for Hiredis. That ability
was lost in 2c742c2c7ca9, so if you for some reason want to not use a
locally installed library you're out of luck.

Improve this by letting ZSTD_FROM_INTERNET and HIREDIS_FROM_INTERNET be
tristate variables:

    ON: Always download
    AUTO (default): Download if local installation not found
    OFF: Never download

As mentioned in #1240.

15 months agochore: Improve variable name and comments
Joel Rosdahl [Mon, 23 Jan 2023 20:52:18 +0000 (21:52 +0100)] 
chore: Improve variable name and comments

15 months agodoc: Fix spelling
Joel Rosdahl [Thu, 19 Jan 2023 19:57:18 +0000 (20:57 +0100)] 
doc: Fix spelling

15 months agoci: Build macOS universal binary (#1240)
Raihaan Shouhell [Fri, 27 Jan 2023 12:02:38 +0000 (20:02 +0800)] 
ci: Build macOS universal binary (#1240)

15 months agofeat: Add support for -Wp,-U<macro> in direct mode
Joel Rosdahl [Wed, 18 Jan 2023 20:34:00 +0000 (21:34 +0100)] 
feat: Add support for -Wp,-U<macro> in direct mode

15 months agofix: Don't treat -Wp,-D as interchangeable with -D
Joel Rosdahl [Wed, 18 Jan 2023 20:30:25 +0000 (21:30 +0100)] 
fix: Don't treat -Wp,-D as interchangeable with -D

Fixes #1238.

15 months agotest: Use grep -E/-F instead of obsolescent egrep/fgrep
Joel Rosdahl [Tue, 17 Jan 2023 19:59:21 +0000 (20:59 +0100)] 
test: Use grep -E/-F instead of obsolescent egrep/fgrep

15 months agofeat: Improve automatic cache cleanup mechanism
Joel Rosdahl [Thu, 5 Jan 2023 18:14:27 +0000 (19:14 +0100)] 
feat: Improve automatic cache cleanup mechanism

The cache cleanup mechanism has worked essentially the same ever since
ccache was initially created in 2002:

- The total number and size of all files in one of the 16 subdirectories
  (AKA level 1) are kept in the stats file in said subdirectory.
- On a cache miss, the new compilation result file is written (based on
  the first digits of the hash) to a subdirectory of one of those 16
  subdirectories, and the stats file is updated accordingly.
- Automatic cleanup is triggered if the size of the level 1 subdirectory
  becomes larger than max_size / 16.
- ccache then lists all files in the subdirectory recursively, stats
  them to check their size and mtime, sorts the file list on mtime and
  deletes the 20% oldest files.

Some problems with the approach described above:

- (A) If several concurrent ccache invocations result in a cache miss
  and write their results to the same subdirectory then all of them will
  start cleaning up the same subdirectory simultaneously, doing
  unnecessary work.
- (B) The ccache invocation that resulted in a cache miss will perform
  cleanup and then exit, which means that an arbitrary ccache process
  that happens to trigger cleanup will take a long time to finish.
- (C) Listing all files in a subdirectory of a large cache can be quite
  slow.
- (D) stat-ing all files in a subdirectory of a large cache can be quite
  slow.
- (E) Deleting many files can be quite slow.
- (F) Since a cleanup by default removes 20% of the files in a
  subdirectory, the actual cache size will (once the cache limit is
  reached) on average hover around 90% of the configured maximum size,
  which can be confusing.

This commit solves or improves on all of the listed problems:

- Before starting automatic cleanup, a global "auto cleanup" lock is
  acquired (non-blocking) so that at most one process is performing
  cleanup at a time. This solves the potential "cache cleanup stampede"
  described in (A).
- Automatic cleanup is now performed in just one of the 256 level 2
  directories. This means that a single cleanup on average will be 16
  times faster than before. This improves on (B), (C), (D) and (E) since
  the cleanup made by a single compilation will not have to access a
  large part of the cache. On the other hand, cleanups will be triggered
  16 times more often, but the cleanup duty will be more evenly spread
  out during a build.
- The total cache size is calculated and compared with the configured
  maximum size before starting automatic cleanup. This, in combination
  with performing cleanup on level 2, means that the actual cache size
  will stay very close to the maximum size instead of about 90%. This
  solves (F).

The limit_multiple configuration option has been removed since it is no
longer used.

Closes #417.

15 months agochore: Add unit tests for parsing size with (undocumented) B suffix
Joel Rosdahl [Thu, 5 Jan 2023 18:14:17 +0000 (19:14 +0100)] 
chore: Add unit tests for parsing size with (undocumented) B suffix

15 months agoenhance: Delay LongLivedLockFileManager thread start to first register
Joel Rosdahl [Thu, 5 Jan 2023 10:38:55 +0000 (11:38 +0100)] 
enhance: Delay LongLivedLockFileManager thread start to first register

15 months agofix: Fix logging of inactive lock duration
Joel Rosdahl [Thu, 5 Jan 2023 10:16:28 +0000 (11:16 +0100)] 
fix: Fix logging of inactive lock duration

15 months agoenhance: Make it possible for LockFile::try_acquire to break the lock
Joel Rosdahl [Thu, 5 Jan 2023 10:07:06 +0000 (11:07 +0100)] 
enhance: Make it possible for LockFile::try_acquire to break the lock

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.

15 months agofeat: Consistently show cache size and max size with one decimal
Joel Rosdahl [Mon, 2 Jan 2023 19:46:25 +0000 (20:46 +0100)] 
feat: Consistently show cache size and max size with one decimal

15 months agoenhance: Make util::LockFile movable
Joel Rosdahl [Fri, 30 Dec 2022 21:00:17 +0000 (22:00 +0100)] 
enhance: Make util::LockFile movable

15 months agochore: Add missing explicit keywords to some constructors
Joel Rosdahl [Fri, 30 Dec 2022 20:59:18 +0000 (21:59 +0100)] 
chore: Add missing explicit keywords to some constructors

15 months agofix: Avoid sometimes too wide percent figure in --show-stats
Joel Rosdahl [Fri, 30 Dec 2022 20:49:23 +0000 (21:49 +0100)] 
fix: Avoid sometimes too wide percent figure in --show-stats

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.

15 months agoenhance: Add offsetted get/set/increment methods for StatisticsCounters
Joel Rosdahl [Wed, 28 Dec 2022 09:15:23 +0000 (10:15 +0100)] 
enhance: Add offsetted get/set/increment methods for StatisticsCounters

15 months agofeat: Activate logging for command mode options
Joel Rosdahl [Wed, 28 Dec 2022 09:11:55 +0000 (10:11 +0100)] 
feat: Activate logging for command mode options

This makes it possible to check ordinary log messages when debugging
"ccache -c" and similar options.

15 months agoenhance: Make storage::local::StatsFile movable
Joel Rosdahl [Wed, 14 Dec 2022 20:10:03 +0000 (21:10 +0100)] 
enhance: Make storage::local::StatsFile movable

15 months agodoc: Add note that "stats = false" will disable automatic cleanup
Joel Rosdahl [Wed, 14 Dec 2022 19:52:08 +0000 (20:52 +0100)] 
doc: Add note that "stats = false" will disable automatic cleanup

15 months agofeat: Do clean/clear/evict-style operations per level 2 directory
Joel Rosdahl [Tue, 29 Nov 2022 20:54:08 +0000 (21:54 +0100)] 
feat: Do clean/clear/evict-style operations per level 2 directory

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.

15 months agorefactor: Merge LocalStorage implemention files
Joel Rosdahl [Tue, 29 Nov 2022 19:56:36 +0000 (20:56 +0100)] 
refactor: Merge LocalStorage implemention files

15 months agochore: Remove special logic for cleaning up legacy ccache files
Joel Rosdahl [Wed, 9 Nov 2022 20:36:03 +0000 (21:36 +0100)] 
chore: Remove special logic for cleaning up legacy ccache files

15 months agorefactor: Use std::size to compute array size
Joel Rosdahl [Tue, 10 Jan 2023 19:21:51 +0000 (20:21 +0100)] 
refactor: Use std::size to compute array size

15 months agochore: Clean up minor things after 95e6375813f7
Joel Rosdahl [Wed, 4 Jan 2023 14:17:11 +0000 (15:17 +0100)] 
chore: Clean up minor things after 95e6375813f7

15 months agofix: Use spinlocks for inode cache memory synchronization (#1229)
Oleg Sidorkin [Wed, 4 Jan 2023 13:53:21 +0000 (16:53 +0300)] 
fix: Use spinlocks for inode cache memory synchronization (#1229)

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.

16 months agoci: Test more compilers (#1234)
Raihaan Shouhell [Mon, 26 Dec 2022 11:48:55 +0000 (19:48 +0800)] 
ci: Test more compilers (#1234)

16 months agofix: Only use original umask when retrieving result
Joel Rosdahl [Fri, 23 Dec 2022 18:03:13 +0000 (19:03 +0100)] 
fix: Only use original umask when retrieving result

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.

16 months agofix: Fix matching of base directory for MSVC
Joel Rosdahl [Wed, 21 Dec 2022 12:16:12 +0000 (13:16 +0100)] 
fix: Fix matching of base directory for MSVC

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.

16 months agofix: Don't crash in TextTable for a single heading row
Joel Rosdahl [Wed, 21 Dec 2022 14:15:41 +0000 (15:15 +0100)] 
fix: Don't crash in TextTable for a single heading row

16 months agochore: Remove defunct LGTM badges
Joel Rosdahl [Fri, 23 Dec 2022 09:55:27 +0000 (10:55 +0100)] 
chore: Remove defunct LGTM badges

lgtm.com has been shut down.

16 months agofix: Do not escape backslashes in MSVC RSP files (#1233)
Raihaan Shouhell [Fri, 23 Dec 2022 09:52:45 +0000 (17:52 +0800)] 
fix: Do not escape backslashes in MSVC RSP files (#1233)

16 months agofix: Improve fix for local/remote cache misses in depend mode
Joel Rosdahl [Tue, 20 Dec 2022 20:57:33 +0000 (21:57 +0100)] 
fix: Improve fix for local/remote cache misses in depend mode

16 months agofix: Fix reporting of local/remote cache misses in depend mode
Joel Rosdahl [Tue, 13 Dec 2022 19:32:15 +0000 (20:32 +0100)] 
fix: Fix reporting of local/remote cache misses in depend mode

16 months agofix: Fix conditions for --show-stats
Joel Rosdahl [Mon, 12 Dec 2022 13:33:26 +0000 (14:33 +0100)] 
fix: Fix conditions for --show-stats

16 months agochore: Bump clang-format version requirement to 11+
Joel Rosdahl [Mon, 12 Dec 2022 18:46:01 +0000 (19:46 +0100)] 
chore: Bump clang-format version requirement to 11+

16 months agodoc: Fix markup
Joel Rosdahl [Mon, 12 Dec 2022 12:41:04 +0000 (13:41 +0100)] 
doc: Fix markup

16 months agoenhance: Extract lock keep-alive thread to a manager class
Joel Rosdahl [Mon, 5 Dec 2022 19:50:58 +0000 (20:50 +0100)] 
enhance: Extract lock keep-alive thread to a manager class

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.

16 months agoenhance: Add AtomicFile::flush method
Joel Rosdahl [Sat, 3 Dec 2022 12:33:33 +0000 (13:33 +0100)] 
enhance: Add AtomicFile::flush method

16 months agochore: Refine ProgressBar value calculation
Joel Rosdahl [Sat, 26 Nov 2022 15:26:45 +0000 (16:26 +0100)] 
chore: Refine ProgressBar value calculation

16 months agochore: Improve description of --set-config
Joel Rosdahl [Sat, 26 Nov 2022 10:17:21 +0000 (11:17 +0100)] 
chore: Improve description of --set-config

16 months agorefactor: Make LockFile guard itself without a LockFileGuard
Joel Rosdahl [Sun, 13 Nov 2022 08:02:16 +0000 (09:02 +0100)] 
refactor: Make LockFile guard itself without a LockFileGuard

16 months agofix: Don't use copy of mutex/condition in long-lived lock thread
Joel Rosdahl [Wed, 23 Nov 2022 19:11:12 +0000 (20:11 +0100)] 
fix: Don't use copy of mutex/condition in long-lived lock 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.

16 months agoenhance: Allow short-lived lock file to wait for long-lived
Joel Rosdahl [Thu, 10 Nov 2022 15:37:08 +0000 (16:37 +0100)] 
enhance: Allow short-lived lock file to wait for long-lived

17 months agochore: Add discussions badge
Joel Rosdahl [Thu, 24 Nov 2022 19:49:34 +0000 (20:49 +0100)] 
chore: Add discussions badge

17 months agodoc: Fix spelling of potentially
Joel Rosdahl [Mon, 21 Nov 2022 19:55:03 +0000 (20:55 +0100)] 
doc: Fix spelling of potentially

17 months agorefactor: Improve FileRecompressor to take a stat
Joel Rosdahl [Thu, 10 Nov 2022 09:07:33 +0000 (10:07 +0100)] 
refactor: Improve FileRecompressor to take a stat

This avoids extra stats in some scenarios.

17 months agorefactor: Remove CacheFile, using Stat with path member instead
Joel Rosdahl [Thu, 10 Nov 2022 08:38:37 +0000 (09:38 +0100)] 
refactor: Remove CacheFile, using Stat with path member instead

17 months agoenhance: Remember path in Stat
Joel Rosdahl [Thu, 10 Nov 2022 08:03:08 +0000 (09:03 +0100)] 
enhance: Remember path in Stat

17 months agoenhance: Only keep atime if needed
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.

17 months agofeat: Add --trim-recompress and --trim-recompress-threads
Joel Rosdahl [Tue, 8 Nov 2022 07:48:07 +0000 (08:48 +0100)] 
feat: Add --trim-recompress and --trim-recompress-threads

Note: Reading the header to check the current compression level affects
atime, so we need to restore atime even when recompression is not
performed.

17 months agorefactor: Extract file recompression code to a class
Joel Rosdahl [Mon, 7 Nov 2022 20:46:25 +0000 (21:46 +0100)] 
refactor: Extract file recompression code to a class

17 months agoenhance: Add Util::format_human_readable_diff
Joel Rosdahl [Mon, 14 Nov 2022 08:55:09 +0000 (09:55 +0100)] 
enhance: Add Util::format_human_readable_diff

17 months agofeat: Improve Util::format_human_readable_size for small sizes
Joel Rosdahl [Mon, 7 Nov 2022 20:04:01 +0000 (21:04 +0100)] 
feat: Improve Util::format_human_readable_size for small sizes

17 months agofeat: Add --recompress-threads option
Joel Rosdahl [Mon, 7 Nov 2022 19:22:19 +0000 (20:22 +0100)] 
feat: Add --recompress-threads option

17 months agofix: Fix edge case where a non-temporal identifier is misidentified (#1227)
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.

17 months agochore: Update NEWS v4.7.4
Joel Rosdahl [Mon, 21 Nov 2022 18:53:32 +0000 (19:53 +0100)] 
chore: Update NEWS