]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
23 months agochore: Prepare for version 4.8.3 4.8-maint v4.8.3
Joel Rosdahl [Tue, 29 Aug 2023 19:38:11 +0000 (21:38 +0200)] 
chore: Prepare for version 4.8.3

23 months agofix: Exit more gracefully on invalid sharded remote storage URL
Joel Rosdahl [Tue, 29 Aug 2023 19:06:23 +0000 (21:06 +0200)] 
fix: Exit more gracefully on invalid sharded remote storage URL

As mentioned in #1321.

(cherry picked from commit 8d47ee7e5d289bd92102f082002631ad70a5046d)

23 months agofix: Fix bookkeeping of raw files
Joel Rosdahl [Fri, 18 Aug 2023 20:17:40 +0000 (22:17 +0200)] 
fix: Fix bookkeeping of raw files

Ccache 4.8-4.8.2 notes the size and count of raw files (written to the
cache if hard link or file clone mode is enabled) to a level 2 stats
file. However, the new cleanup algorithm (also introduced in 4.8)
assumes that all size/count statistics are placed in a level 1 stats
file. After a "ccache -c", the raw files will be "rediscovered" and
noted in level 1 stats files, thus duplicating bookkeeping in level 2
stats files, resulting in a too high cache size figure in "ccache -s".

To fix this, ccache will now:

- Note size/count of raw files in the proper level 1 stats file.
- When storing an entry on a cache miss, detect if the corresponding
  level 2 stats file has non-zero size/count statistics and propagate
  them to the level 1 stats file if so.
- Zero out files/count statistics for level 2 stats file on "ccache -c".

This means that the reported cache size will gradually correct itself
automatically. Alternatively, the user can run "ccache -c" to fix all
counters immediately.

Fixes #1320.

(cherry picked from commit 69f2bcc5cfe836128224acd4c215e2831f757fdf)

23 months agorefactor: Improve name of LocalStorage::increment_level_2_counters
Joel Rosdahl [Fri, 18 Aug 2023 19:30:33 +0000 (21:30 +0200)] 
refactor: Improve name of LocalStorage::increment_level_2_counters

(cherry picked from commit 0df72d6809f188cd294f95ddd5c18f2ffc5f96eb)

23 months agoenhance: Support updating stats file only if values have changed
Joel Rosdahl [Sat, 19 Aug 2023 11:09:10 +0000 (13:09 +0200)] 
enhance: Support updating stats file only if values have changed

(cherry picked from commit 4d13759bb9413e2ffab4c0c3e3694924d193be36)

23 months agobump: Upgrade to xxHash 0.8.2
Joel Rosdahl [Mon, 24 Jul 2023 17:18:05 +0000 (19:18 +0200)] 
bump: Upgrade to xxHash 0.8.2

Closes #1085.

(cherry picked from commit 4a00bb9055a053eff948547d6980d803efdc1905)

23 months agofix: Work around GCC 12.3 bug 109241
Joel Rosdahl [Tue, 1 Aug 2023 10:30:12 +0000 (12:30 +0200)] 
fix: Work around GCC 12.3 bug 109241

See also #1289.

(cherry picked from commit 689168c292f1ed26c5f4a3070aeb649dad7facb5)

23 months agofix: Improve nvcc handling of -Xcompiler and --Werror (#1304)
Andrew Hardin [Thu, 29 Jun 2023 19:38:06 +0000 (13:38 -0600)] 
fix: Improve nvcc handling of -Xcompiler and --Werror (#1304)

(cherry picked from commit ce11e31a54c1708776d13c47ec10286410519499)

23 months agofix: Improve MSVC .rsp file parsing (#1303)
Jiri Hörner [Thu, 29 Jun 2023 19:03:59 +0000 (21:03 +0200)] 
fix: Improve MSVC .rsp file parsing (#1303)

(cherry picked from commit 5e0e46eb54461ef20f679028a725638b309fd3a9)

2 years agochore: Update authors v4.8.2
Joel Rosdahl [Mon, 12 Jun 2023 19:17:31 +0000 (21:17 +0200)] 
chore: Update authors

2 years agochore: Update NEWS
Joel Rosdahl [Mon, 12 Jun 2023 18:58:30 +0000 (20:58 +0200)] 
chore: Update NEWS

2 years agochore: Update .mailmap
Joel Rosdahl [Sun, 11 Jun 2023 16:11:00 +0000 (18:11 +0200)] 
chore: Update .mailmap

2 years agobump: Upgrade to cpp-httplib 0.12.6
Joel Rosdahl [Sat, 10 Jun 2023 11:25:40 +0000 (13:25 +0200)] 
bump: Upgrade to cpp-httplib 0.12.6

2 years agobump: Upgrade to BLAKE3 1.4.0
Joel Rosdahl [Fri, 9 Jun 2023 14:21:47 +0000 (16:21 +0200)] 
bump: Upgrade to BLAKE3 1.4.0

2 years agorefactor: Use std::size to compute array size (#1297)
Gregor Jasny [Wed, 7 Jun 2023 19:11:51 +0000 (21:11 +0200)] 
refactor: Use std::size to compute array size (#1297)

2 years agobuild: Fix Xcode build of zstd (#1296)
Gregor Jasny [Wed, 7 Jun 2023 19:11:07 +0000 (21:11 +0200)] 
build: Fix Xcode build of zstd (#1296)

Reproducer (CMake 3.26.4, Xcode 14.3):

    cmake -B _build -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64 \
          -DZSTD_FROM_INTERNET=ON -DREDIS_STORAGE_BACKEND=OFF
    cmake --build _build

See facebook/zstd#3622

2 years agofix: Keep the order of MSVC showIncludes output (#1295)
huangqinjin [Wed, 7 Jun 2023 06:51:38 +0000 (14:51 +0800)] 
fix: Keep the order of MSVC showIncludes output (#1295)

The bug is introduced in commit 3ec0d4ec961cb0c67ff1603b83a6026d9f3abbb5.

2 years agofix: Don't pass -v to the preprocessor
Joel Rosdahl [Tue, 6 Jun 2023 19:42:12 +0000 (21:42 +0200)] 
fix: Don't pass -v to the preprocessor

The -v option tells the compiler to print various diagnostics to stdout,
including randomly generated filenames. When ccache calls the
preprocessor and -v is on the command line, the random information will
become part of the input hash, making the preprocessor mode always
produce cache misses.

Fix this by only passing -v when compiling, not preprocessing.

Closes #1293.

2 years agoMerge pull request #1290 from rkitover/cmake-fixes
Joel Rosdahl [Tue, 6 Jun 2023 19:34:18 +0000 (21:34 +0200)] 
Merge pull request #1290 from rkitover/cmake-fixes

2 years agochore: Add basic CMakeSettings.json for VS IDE 1290/head
Rafael Kitover [Mon, 22 May 2023 22:54:56 +0000 (22:54 +0000)] 
chore: Add basic CMakeSettings.json for VS IDE

Add a basic CMakeSettings.json for the Visual Studio IDE using defaults
and Ninja as the generator, for x64, x86 and arm64.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2 years agofix: Quiet cmake warning for extracted timestamps
Rafael Kitover [Tue, 23 May 2023 21:42:12 +0000 (21:42 +0000)] 
fix: Quiet cmake warning for extracted timestamps

For zstd and hiredis downloaded from the Internet, set cmake policy
CMP0135 to NEW to set the timestamps of extracted archive members to the
time of extraction to suppress the cmake dev warning on newer versions
of cmake.

Check that the policy exists so that this works on older versions of
cmake.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2 years agochore: Re-enable 64 bit msbuild ci jobs
Rafael Kitover [Mon, 22 May 2023 22:19:22 +0000 (22:19 +0000)] 
chore: Re-enable 64 bit msbuild ci jobs

Fixed by 70bf22a5 (fix: Disable masm on msbuild for blake3 with VS,
2023-05-22).

References #1278

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2 years agofix: Disable masm on msbuild for blake3 with VS
Rafael Kitover [Mon, 22 May 2023 22:13:19 +0000 (22:13 +0000)] 
fix: Disable masm on msbuild for blake3 with VS

Because of some bug with either msbuild or the cmake generator, the C
compiler flags are passed to the masm assembler making it fail.

Use the C intrinsic versions for blake3 when msbuild is in use.

Fix #1278

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2 years agobump: Update blake3 1.3.1 -> 71a2646
Rafael Kitover [Tue, 23 May 2023 21:04:36 +0000 (21:04 +0000)] 
bump: Update blake3 1.3.1 -> 71a2646

Update blake3 to master, commit 71a2646 .

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2 years agodocs: Clarify --evict-older-than semantics
Joel Rosdahl [Wed, 31 May 2023 17:39:06 +0000 (19:39 +0200)] 
docs: Clarify --evict-older-than semantics

Closes #1292.

2 years agofix: Support Windows drive letter in file URLs for remote storage
Joel Rosdahl [Wed, 24 May 2023 19:04:30 +0000 (21:04 +0200)] 
fix: Support Windows drive letter in file URLs for remote storage

Closes #1291.

2 years agofix: Make --trim-max-size accept 0 for no limit
Joel Rosdahl [Tue, 23 May 2023 19:30:11 +0000 (21:30 +0200)] 
fix: Make --trim-max-size accept 0 for no limit

2 years agotest: Simplify util::read_file_part test again
Joel Rosdahl [Mon, 22 May 2023 19:35:30 +0000 (21:35 +0200)] 
test: Simplify util::read_file_part test again

2 years agobuild: Enable _GLIBCXX_ASSERTIONS in debug build mode
Joel Rosdahl [Mon, 22 May 2023 18:09:46 +0000 (20:09 +0200)] 
build: Enable _GLIBCXX_ASSERTIONS in debug build mode

See also #1288.

2 years agofix: Fix undefined behavior in util::read_file_part for zero count
Joel Rosdahl [Mon, 22 May 2023 17:58:41 +0000 (19:58 +0200)] 
fix: Fix undefined behavior in util::read_file_part for zero count

If util::read_file_part's count argument is 0 (which can currently only
happen in unit tests), we'll do &result[0] where result is
default-initialized std::unique_ptr<uint8_t[]>. This is not allowed even
though we won't actually dereference the pointer. Found by compiling
with -D_GLIBCXX_ASSERTIONS.

Fixes #1288.

2 years agotest: Fix typo (missing line continuation) (#1287)
Sam James [Mon, 22 May 2023 17:58:20 +0000 (18:58 +0100)] 
test: Fix typo (missing line continuation) (#1287)

Fixes  typo in ef634bdb292e1e24b8d1b5490e7857144a77c0fd.

2 years agochore: Update authors v4.8.1
Joel Rosdahl [Fri, 19 May 2023 18:15:08 +0000 (20:15 +0200)] 
chore: Update authors

2 years agochore: Update NEWS
Joel Rosdahl [Fri, 19 May 2023 18:12:17 +0000 (20:12 +0200)] 
chore: Update NEWS

2 years agobump: Upgrade to cpp-httplib 0.12.3
Joel Rosdahl [Sun, 14 May 2023 14:34:10 +0000 (16:34 +0200)] 
bump: Upgrade to cpp-httplib 0.12.3

2 years agotest: Fix test failure in GitHub CI mingw64 jobs
Joel Rosdahl [Sun, 7 May 2023 19:23:56 +0000 (21:23 +0200)] 
test: Fix test failure in GitHub CI mingw64 jobs

2 years agodoc: Add remote file storage example with URL-encoded space
Joel Rosdahl [Sat, 6 May 2023 18:19:28 +0000 (20:19 +0200)] 
doc: Add remote file storage example with URL-encoded space

As suggested in #1281.

2 years agobump: Upgrade to doctest 2.4.11
Joel Rosdahl [Sat, 22 Apr 2023 12:23:24 +0000 (14:23 +0200)] 
bump: Upgrade to doctest 2.4.11

Fixes #1194.

2 years agochore: Suppress clang-tidy warnings we don't want to fix
Joel Rosdahl [Wed, 19 Apr 2023 20:03:22 +0000 (22:03 +0200)] 
chore: Suppress clang-tidy warnings we don't want to fix

2 years agorefactor: Improve calculate_result_and_manifest_key parameters
Joel Rosdahl [Wed, 19 Apr 2023 20:02:00 +0000 (22:02 +0200)] 
refactor: Improve calculate_result_and_manifest_key parameters

As suggested by clang-tidy
(readability-suspicious-call-argument,-warnings-as-errors).

2 years agorefactor: Use constructor member initializer lists
Joel Rosdahl [Wed, 19 Apr 2023 20:00:38 +0000 (22:00 +0200)] 
refactor: Use constructor member initializer lists

As suggested by clang-tidy
(cppcoreguidelines-prefer-member-initializer).

2 years agorefactor: Use std::unique_ptr for data in util::Bytes
Joel Rosdahl [Wed, 19 Apr 2023 19:00:35 +0000 (21:00 +0200)] 
refactor: Use std::unique_ptr for data in util::Bytes

2 years agochore: Sort .clang-tidy check list
Joel Rosdahl [Wed, 19 Apr 2023 16:58:26 +0000 (18:58 +0200)] 
chore: Sort .clang-tidy check list

2 years agochore: Add comments for all statistics counters
Joel Rosdahl [Wed, 19 Apr 2023 15:08:18 +0000 (17:08 +0200)] 
chore: Add comments for all statistics counters

As suggested in discussion #1271.

2 years agorefactor: Extract MSVC debug option logic to a function
Joel Rosdahl [Wed, 19 Apr 2023 14:24:14 +0000 (16:24 +0200)] 
refactor: Extract MSVC debug option logic to a function

2 years agofix: Limit MSVC debug flag detection to documented parameters (#1263)
Stephan Rohmen [Wed, 19 Apr 2023 14:16:03 +0000 (16:16 +0200)] 
fix: Limit MSVC debug flag detection to documented parameters (#1263)

2 years agofix: Don't add additional depend mode options after Clang -- option
Joel Rosdahl [Mon, 17 Apr 2023 18:51:38 +0000 (20:51 +0200)] 
fix: Don't add additional depend mode options after Clang -- option

With the depend mode enabled, ccache executes the original command line
verbatim, potentially with the addition of a few extra options. However,
for clang or clang-cl it is not possible to simply append the additional
options to the end of the original command line since there may be a
"--" option to indicate the end of options.

Fix this by inserting the additional options directly after the compiler
instead of at the end.

Fixes #1273.

2 years agobump: Update to zstd 1.5.5 (#1272)
Raihaan Shouhell [Mon, 17 Apr 2023 17:58:10 +0000 (01:58 +0800)] 
bump: Update to zstd 1.5.5 (#1272)

2 years agofix: Find Ccache version from lightweight Git tag
Joel Rosdahl [Mon, 17 Apr 2023 16:08:24 +0000 (18:08 +0200)] 
fix: Find Ccache version from lightweight Git tag

Ccache calculates its version from a matching Git tag by using the "git
describe" command, which only considers annotated tags. All ccache tags
are annotated. However, when running a GitHub action job for a tag the
local Git repository is (at least by default) a shallow clone with the
tag being converted to a lightweight tag. This makes "git describe" not
see the tag.

Fix this by adding --tags to "git describe" to make it consider
lightweight tags as well.

Fixes #1270.

2 years agotest: Add test for default value of inode_cache
Joel Rosdahl [Sun, 19 Mar 2023 12:25:50 +0000 (13:25 +0100)] 
test: Add test for default value of inode_cache

2 years agofix: Make output of "ccache -k max_size" parsable
Joel Rosdahl [Mon, 13 Mar 2023 18:26:50 +0000 (19:26 +0100)] 
fix: Make output of "ccache -k max_size" parsable

2 years agoci: Disable Windows 64-bit MSBuild jobs for now
Joel Rosdahl [Mon, 17 Apr 2023 06:26:13 +0000 (08:26 +0200)] 
ci: Disable Windows 64-bit MSBuild jobs for now

The Windows VS2019 64-bit MSBuild and Windows VS2022 64-bit MSBuild
GitHub actions jobs have started failing on master due to some changes
in the CI environment. See issue #1278.

2 years agofeat: Don't treat /Zi as unsupported for clang-cl (#1266)
Tobias Hieta [Tue, 28 Mar 2023 19:45:37 +0000 (21:45 +0200)] 
feat: Don't treat /Zi as unsupported for clang-cl (#1266)

For MSVC /Zi is unsupported since it writes a additional
.pdb file per each .obj file and it creates some messy
interaction with ccache. But for clang-cl /Zi is actually
treated as /Z7 and only embeds the debug info in the .obj
file so it makes sense to allow this flag when compiling
with clang-cl.

2 years agoUpdate NEWS
Joel Rosdahl [Mon, 20 Mar 2023 19:42:14 +0000 (20:42 +0100)] 
Update NEWS

(cherry picked from commit 9b1033f3ae534e5aad02c10f663b589b8f28c026)

2 years agobuild: Make ccache compile with clang-cl on Windows (#1260)
Tobias Hieta [Thu, 16 Mar 2023 17:27:16 +0000 (18:27 +0100)] 
build: Make ccache compile with clang-cl on Windows (#1260)

2 years agochore: Update copyright years v4.8
Joel Rosdahl [Sun, 12 Mar 2023 21:00:43 +0000 (22:00 +0100)] 
chore: Update copyright years

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

2 years 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.

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

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

2 years 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.

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

2 years 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

2 years 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

2 years 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

2 years 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

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

2 years 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

2 years 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.

2 years 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)

2 years 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.

2 years 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

2 years 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)

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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.

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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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.

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

2 years 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

2 years 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

2 years 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"

2 years 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.

2 years 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

2 years 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/

2 years 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/>

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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

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