]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
2 years agofeat: Use subsecond timestamps for include file check
Joel Rosdahl [Tue, 20 Sep 2022 17:05:38 +0000 (19:05 +0200)] 
feat: Use subsecond timestamps for include file check

To avoid a race condition, ccache disables the direct mode if an include
file has a too new mtime or ctime. Previously this check used one second
resolution timestamps, which meant that a generated include file often
would disable direct mode hits for up to one second. Now ccache uses
timestamps with subsecond resolution (nanoseconds on Linux), so the
direct mode will in practice no longer have to be disabled for generated
include files.

2 years agofeat: Use subsecond resolution timestamps in manifest files
Joel Rosdahl [Tue, 20 Sep 2022 17:02:18 +0000 (19:02 +0200)] 
feat: Use subsecond resolution timestamps in manifest files

This improves accuracy in with "file_stat_matches" sloppiness.

2 years agorefactor: Use util::TimePoint for timestamps
Joel Rosdahl [Tue, 20 Sep 2022 17:01:38 +0000 (19:01 +0200)] 
refactor: Use util::TimePoint for timestamps

2 years agoenhance: Add util::TimePoint and util::Duration
Joel Rosdahl [Sun, 18 Sep 2022 11:36:55 +0000 (13:36 +0200)] 
enhance: Add util::TimePoint and util::Duration

2 years agotest: Silence output from $COMPILER --version
Joel Rosdahl [Sun, 18 Sep 2022 11:33:59 +0000 (13:33 +0200)] 
test: Silence output from $COMPILER --version

2 years agofeat: Merge local manifest with fetched remote manifest
Joel Rosdahl [Wed, 14 Sep 2022 19:19:14 +0000 (21:19 +0200)] 
feat: Merge local manifest with fetched remote manifest

With read-only secondary storage, it can happen that primary storage has
a manifest named M with a result entry R1, while secondary storage also
has a manifest M but with result R2. On a compilation that matches R2,
ccache will first succeed to look up M in primary storage, fail to find
R2 and then get M from secondary storage where R2 can be found. Since M
already exists locally, ccache will simply return the cache hit but not
store knowledge of R2 locally. On a rebuild of R2, ccache therefore
needs to fetch from secondary storage again.

The improvement brought by this commit is that ccache now merges the
manifests from primary and secondary storage and stores the merged
version in primary storage. In other words, ccache setups with read-only
secondary storage will be able to accumulate local header file
combinations and seamlessly combine them with changes from secondary
storage.

Closes #1049.

2 years agorefactor: Extract timestamp logic from Manifest
Joel Rosdahl [Tue, 13 Sep 2022 20:00:08 +0000 (22:00 +0200)] 
refactor: Extract timestamp logic from Manifest

2 years agorefactor: Improve Storage::get API to be able to return multiple times
Joel Rosdahl [Mon, 12 Sep 2022 19:27:52 +0000 (21:27 +0200)] 
refactor: Improve Storage::get API to be able to return multiple times

2 years agofix: Don't reshare results with raw files to secondary storage
Joel Rosdahl [Mon, 12 Sep 2022 13:25:42 +0000 (15:25 +0200)] 
fix: Don't reshare results with raw files to secondary storage

2 years agorefactor(storage): Pass cache entries via memory instead of files
Joel Rosdahl [Mon, 12 Sep 2022 12:06:45 +0000 (14:06 +0200)] 
refactor(storage): Pass cache entries via memory instead of files

2 years agofix: Make sure that temporary files always have .tmp. in the name
Joel Rosdahl [Mon, 12 Sep 2022 11:25:45 +0000 (13:25 +0200)] 
fix: Make sure that temporary files always have .tmp. in the name

PrimaryStorage::clean_dir relies on being able to classify temporary
files from the filename.

2 years agofeat: Print result format version and no of files in --inspect
Joel Rosdahl [Sun, 11 Sep 2022 13:36:13 +0000 (15:36 +0200)] 
feat: Print result format version and no of files in --inspect

2 years agochore: Simplify cache entry reading and writing
Joel Rosdahl [Sun, 11 Sep 2022 11:48:05 +0000 (13:48 +0200)] 
chore: Simplify cache entry reading and writing

Cache entries are now fully read into memory before (de)compressing,
checksumming and parsing, instead of streaming data like before. While
this increases memory usage when working with large object files, it
also simplifies the code a lot. Another motivation for this change is
that cache entry data is not streamed from secondary storage anyway, and
it makes sense to keep the architecture simple and similar for primary
and secondary storage code paths.

The cache entry format has modified so that the checksum covers the
potentially compressed payload (plus the header), not the uncompressed
payload (plus the header) like before. The checksum is now also stored
in an uncompressed epilogue. Since the cache entry format has been
changed, the input hash has been changed as well.

2 years agoenhance: Add util::zstd_* functions
Joel Rosdahl [Sun, 11 Sep 2022 11:27:40 +0000 (13:27 +0200)] 
enhance: Add util::zstd_* functions

2 years agorefactor: Let core::CacheEntryDataWriter work with util::Bytes
Joel Rosdahl [Sun, 11 Sep 2022 11:10:48 +0000 (13:10 +0200)] 
refactor: Let core::CacheEntryDataWriter work with util::Bytes

2 years agofeat: Improve logging for Util::clone_hard_link_or_copy_file
Joel Rosdahl [Sun, 11 Sep 2022 10:50:27 +0000 (12:50 +0200)] 
feat: Improve logging for Util::clone_hard_link_or_copy_file

2 years agorefactor: Let util::DataReceiver take uint8_t
Joel Rosdahl [Sun, 11 Sep 2022 09:12:03 +0000 (11:12 +0200)] 
refactor: Let util::DataReceiver take uint8_t

2 years agorefactor: Use util::throw_on_error
Joel Rosdahl [Thu, 8 Sep 2022 11:54:02 +0000 (13:54 +0200)] 
refactor: Use util::throw_on_error

2 years agoenhance: Add util::throw_on_error functions
Joel Rosdahl [Thu, 8 Sep 2022 11:53:58 +0000 (13:53 +0200)] 
enhance: Add util::throw_on_error functions

2 years agoenhance: Add prefix parameter to util::value_or_throw
Joel Rosdahl [Thu, 8 Sep 2022 11:26:25 +0000 (13:26 +0200)] 
enhance: Add prefix parameter to util::value_or_throw

2 years agoenhance: Add util::read_file_part function
Joel Rosdahl [Wed, 7 Sep 2022 12:57:17 +0000 (14:57 +0200)] 
enhance: Add util::read_file_part function

2 years agoperf: Use util::Bytes
Joel Rosdahl [Wed, 7 Sep 2022 09:22:36 +0000 (11:22 +0200)] 
perf: Use util::Bytes

2 years agoenhance: Add util::Bytes class
Joel Rosdahl [Wed, 7 Sep 2022 08:17:21 +0000 (10:17 +0200)] 
enhance: Add util::Bytes class

2 years agorefactor: Use memory buffers instead of streams for manifests
Joel Rosdahl [Tue, 6 Sep 2022 13:06:11 +0000 (15:06 +0200)] 
refactor: Use memory buffers instead of streams for manifests

This is part of a larger refactoring effort with the goal of simplifying
how cache entries are read and processed.

2 years agorefactor: Use memory buffers instead of streams for results
Joel Rosdahl [Mon, 5 Sep 2022 18:23:21 +0000 (20:23 +0200)] 
refactor: Use memory buffers instead of streams for results

- Result objects now only know and care about the result payload part of
  a result cache entry.
- Result object are no longer tightly coupled with the primary storage
  implementation.

This is part of a larger refactoring effort with the goal of simplifying
how cache entries are read and processed.

2 years agobuild: Remove now redundant CMAKE_CURRENT_SOURCE_DIR usage
Joel Rosdahl [Wed, 7 Sep 2022 20:06:56 +0000 (22:06 +0200)] 
build: Remove now redundant CMAKE_CURRENT_SOURCE_DIR usage

As of CMake 3.13, target_sources works as expected with relative paths
in subdirectories.

2 years agoci: Add minimum GitHub token permissions for workflows (#1159)
Varun Sharma [Tue, 13 Sep 2022 19:41:16 +0000 (12:41 -0700)] 
ci: Add minimum GitHub token permissions for workflows (#1159)

2 years agorefactor: Reuse local reference in process_args (#1157)
Orgad Shaneh [Tue, 13 Sep 2022 16:16:54 +0000 (19:16 +0300)] 
refactor: Reuse local reference in process_args (#1157)

2 years agofix: Don't crash with no or nonexistent source file with base_dir
Joel Rosdahl [Fri, 9 Sep 2022 07:09:06 +0000 (09:09 +0200)] 
fix: Don't crash with no or nonexistent source file with base_dir

Regression in fec405539bca90ebd0992ae6606bd10eec3a64da.

Fixes #1155.

2 years agochore: Support clang-format 14
Joel Rosdahl [Tue, 6 Sep 2022 07:12:45 +0000 (09:12 +0200)] 
chore: Support clang-format 14

clang-format 14 chokes on a construction in unittest/test_Stat.cpp. Work
around this by moving ifdefs around.

2 years agofix: Unlink destination before opening in util::write_file
Joel Rosdahl [Mon, 5 Sep 2022 18:22:00 +0000 (20:22 +0200)] 
fix: Unlink destination before opening in util::write_file

This allows for writing to a file that already exists with read-only
permissions.

2 years agoenhance: Let util::write_file take an std::string_view
Joel Rosdahl [Mon, 5 Sep 2022 11:21:33 +0000 (13:21 +0200)] 
enhance: Let util::write_file take an std::string_view

2 years agoenhance: Add util::to_span and util::to_string_view functions
Joel Rosdahl [Mon, 5 Sep 2022 11:19:03 +0000 (13:19 +0200)] 
enhance: Add util::to_span and util::to_string_view functions

2 years agoenhance: Short circuit StatisticsCounters::increment for zero value
Joel Rosdahl [Mon, 5 Sep 2022 11:17:26 +0000 (13:17 +0200)] 
enhance: Short circuit StatisticsCounters::increment for zero value

2 years agoenhance: Improve error messages for Util::copy_file
Joel Rosdahl [Mon, 5 Sep 2022 11:03:43 +0000 (13:03 +0200)] 
enhance: Improve error messages for Util::copy_file

2 years agorefactor: Pass Config instead of Context to Result::Writer
Joel Rosdahl [Sun, 4 Sep 2022 11:07:49 +0000 (13:07 +0200)] 
refactor: Pass Config instead of Context to Result::Writer

2 years agorefactor: Use more std::string_view
Joel Rosdahl [Sat, 3 Sep 2022 18:11:47 +0000 (20:11 +0200)] 
refactor: Use more std::string_view

2 years agorefactor: Replace util::Blob alias
Joel Rosdahl [Sat, 3 Sep 2022 17:47:11 +0000 (19:47 +0200)] 
refactor: Replace util::Blob alias

I want to introduce more use of nonstd::span<const uint8_t> and I think
that it makes more sense to use unaliased types.

2 years agoenhance: Support nonstd::span<const uint8_t> for util::write_file
Joel Rosdahl [Sat, 3 Sep 2022 11:59:23 +0000 (13:59 +0200)] 
enhance: Support nonstd::span<const uint8_t> for util::write_file

2 years agoenhance: Add nonstd::span 0.10.3
Joel Rosdahl [Wed, 31 Aug 2022 17:51:29 +0000 (19:51 +0200)] 
enhance: Add nonstd::span 0.10.3

2 years agofix: Don't fail if object file exists and is unwritable
Joel Rosdahl [Mon, 5 Sep 2022 11:00:59 +0000 (13:00 +0200)] 
fix: Don't fail if object file exists and is unwritable

2 years agochore: Remove share-hits attribute for secondary storage
Joel Rosdahl [Tue, 30 Aug 2022 18:34:32 +0000 (20:34 +0200)] 
chore: Remove share-hits attribute for secondary storage

[1] added a share-hits attribute for secondary storages so that it's
possible to avoid sharing hits to primary storage for a specific
secondary storage. I believe that nobody needs that level of control --
what one would like is the ability to not use the primary storage at
all. Such a feature will be added in a a future commit, but for now the
share-hits=false functionality is just in the way, so let's remove it.

[1]: 1924ad69cc42336a61ee69d0042de53db2a2a52c

(cherry picked from commit fd91ae11db7b49ad26a347f08517b81c7d549153)

2 years agorefactor: Split calculate_result_and_manifest_key function
Joel Rosdahl [Tue, 30 Aug 2022 18:34:10 +0000 (20:34 +0200)] 
refactor: Split calculate_result_and_manifest_key function

2 years agofeat: Add support for Clang "--" option
Joel Rosdahl [Sun, 28 Aug 2022 10:31:41 +0000 (12:31 +0200)] 
feat: Add support for Clang "--" option

Closes #1149.

2 years agochore: Tweak code format and comment
Joel Rosdahl [Sun, 28 Aug 2022 09:04:25 +0000 (11:04 +0200)] 
chore: Tweak code format and comment

2 years agofeat: Add support for caching assembler listing files
Joel Rosdahl [Sun, 28 Aug 2022 08:06:22 +0000 (10:06 +0200)] 
feat: Add support for caching assembler listing files

Closes #1090.

2 years agofix: Handle failure to write to stderr when failing to write to log file
Joel Rosdahl [Sat, 27 Aug 2022 19:56:03 +0000 (21:56 +0200)] 
fix: Handle failure to write to stderr when failing to write to log file

This can happen with

    CCACHE_LOGFILE=/dev/stdout ccache compiler ... |& head -n 1

or similar.

2 years agotest: Disable "output file failure" test for unsupported filesystem
Joel Rosdahl [Sat, 27 Aug 2022 18:04:26 +0000 (20:04 +0200)] 
test: Disable "output file failure" test for unsupported filesystem

The "Failure to write output file" test assumes that the filesystem
supports read-only directories. Improve this by probing this assumption
before running the test.

Fixes #1150.

2 years agofix: Use -P -Fi for saving MSVC preprocessor output
Joel Rosdahl [Thu, 25 Aug 2022 19:15:01 +0000 (21:15 +0200)] 
fix: Use -P -Fi for saving MSVC preprocessor output

Even though MSVC supports "-E" and "-c -o" it apparently doesn't support
"-E -o", so [1] broke MSVC.

[1]: 64fc42ca2c5c9fe60ef4f1dc3882edb5f35579d6

Fixes #1146.

2 years agofix: Fix build with musl when using GCC 12 (#1145)
Khem Raj [Thu, 25 Aug 2022 19:36:18 +0000 (12:36 -0700)] 
fix: Fix build with musl when using GCC 12 (#1145)

2 years agofix: Detect PCH for concatenated -include option
Joel Rosdahl [Wed, 24 Aug 2022 17:41:07 +0000 (19:41 +0200)] 
fix: Detect PCH for concatenated -include option

Fixes #1143.

2 years agofix: Avoid narrowing warning for struct statfs f_type field
Joel Rosdahl [Wed, 24 Aug 2022 17:12:32 +0000 (19:12 +0200)] 
fix: Avoid narrowing warning for struct statfs f_type field

As noted in #1142.

2 years agodoc: Touch up config file and cache directory documentation
Joel Rosdahl [Tue, 23 Aug 2022 20:01:44 +0000 (22:01 +0200)] 
doc: Touch up config file and cache directory documentation

2 years agochore: Tweak formatting
Joel Rosdahl [Tue, 23 Aug 2022 19:58:27 +0000 (21:58 +0200)] 
chore: Tweak formatting

2 years agochore: Touch up documentation of Util::make_path
Joel Rosdahl [Tue, 23 Aug 2022 19:58:05 +0000 (21:58 +0200)] 
chore: Touch up documentation of Util::make_path

2 years agobuild: Improve descriptions of installation variables
Joel Rosdahl [Tue, 23 Aug 2022 19:57:21 +0000 (21:57 +0200)] 
build: Improve descriptions of installation variables

2 years agorefactor: Use FMT macro to format exception messages
Joel Rosdahl [Tue, 23 Aug 2022 16:21:57 +0000 (18:21 +0200)] 
refactor: Use FMT macro to format exception messages

Using the FMT macro explicitly makes invalid format message
constructions compile-time errors instead of run-time errors.

2 years agochore: Update NEWS
Joel Rosdahl [Mon, 22 Aug 2022 19:10:07 +0000 (21:10 +0200)] 
chore: Update NEWS

(cherry picked from commit ee6ea5f33dd18710730d22416a91ea1e0178bef2)

2 years agochore: Update authors
Joel Rosdahl [Mon, 22 Aug 2022 19:09:27 +0000 (21:09 +0200)] 
chore: Update authors

(cherry picked from commit b4f0a18f30ba65b9f291fdc820955189b895c896)

2 years agofix: Add missing format argument to error message
Joel Rosdahl [Mon, 22 Aug 2022 18:59:50 +0000 (20:59 +0200)] 
fix: Add missing format argument to error message

2 years agofix: Don't crash in race between file read and cleanup
Joel Rosdahl [Thu, 18 Aug 2022 19:15:39 +0000 (21:15 +0200)] 
fix: Don't crash in race between file read and cleanup

As mentioned in discussion #1102.

Regression in 02dac1f18084c0931aa6b8c1a07e9aedfadb5642.

2 years agofix: Strip .exe from executable name on version output (#1135)
Orgad Shaneh [Thu, 18 Aug 2022 17:19:39 +0000 (20:19 +0300)] 
fix: Strip .exe from executable name on version output (#1135)

2 years agotest: Add version output on failure (#1134)
Orgad Shaneh [Thu, 18 Aug 2022 17:16:35 +0000 (20:16 +0300)] 
test: Add version output on failure (#1134)

2 years agofix: Fix Clang/Windows build (#1132)
Orgad Shaneh [Thu, 18 Aug 2022 17:15:37 +0000 (20:15 +0300)] 
fix: Fix Clang/Windows build (#1132)

2 years agochore: Remove now unused Util::{read_fd,read_file,write_file} functions
Joel Rosdahl [Mon, 15 Aug 2022 19:31:31 +0000 (21:31 +0200)] 
chore: Remove now unused Util::{read_fd,read_file,write_file} functions

2 years agorefactor: Use util::{read_fd,read_file,write_file} functions
Joel Rosdahl [Mon, 15 Aug 2022 19:25:37 +0000 (21:25 +0200)] 
refactor: Use util::{read_fd,read_file,write_file} functions

2 years agorefactor: Use new util::Blob typedef
Joel Rosdahl [Mon, 15 Aug 2022 19:15:53 +0000 (21:15 +0200)] 
refactor: Use new util::Blob typedef

2 years agorefactor: Use util::Blob for binary data in storage API
Joel Rosdahl [Mon, 15 Aug 2022 19:10:39 +0000 (21:10 +0200)] 
refactor: Use util::Blob for binary data in storage API

2 years agoenhance: Add util::{read_fd,read_file,write_file} functions
Joel Rosdahl [Mon, 15 Aug 2022 05:39:24 +0000 (07:39 +0200)] 
enhance: Add util::{read_fd,read_file,write_file} functions

2 years agochore: Improve log message about too many raw file entries
Joel Rosdahl [Tue, 9 Aug 2022 12:44:14 +0000 (14:44 +0200)] 
chore: Improve log message about too many raw file entries

2 years agochore: Touch up {download,upload}-redis scripts
Joel Rosdahl [Tue, 9 Aug 2022 12:48:54 +0000 (14:48 +0200)] 
chore: Touch up {download,upload}-redis scripts

3 years agobump: Upgrade to nonstd::expected 0.6.2
Joel Rosdahl [Sun, 7 Aug 2022 12:35:39 +0000 (14:35 +0200)] 
bump: Upgrade to nonstd::expected 0.6.2

3 years agofeat: Enable inode cache by default
Joel Rosdahl [Fri, 5 Aug 2022 14:42:16 +0000 (16:42 +0200)] 
feat: Enable inode cache by default

See discussion #1086.

3 years agofeat: Improve inode cache robustness
Joel Rosdahl [Fri, 5 Aug 2022 14:39:29 +0000 (16:39 +0200)] 
feat: Improve inode cache robustness

- Only enable the inode cache at compile-time if it's possible to
  determine filesystem type.
- Only use the inode cache at run-time if the filesystem type is known
  to work with the inode cache instead of refusing just on NFS.

3 years agotest: Refactor InodeCache unit tests
Joel Rosdahl [Fri, 5 Aug 2022 13:53:14 +0000 (15:53 +0200)] 
test: Refactor InodeCache unit tests

3 years agoenhance: Add Config::set_temporary_dir
Joel Rosdahl [Fri, 5 Aug 2022 13:52:55 +0000 (15:52 +0200)] 
enhance: Add Config::set_temporary_dir

For usage by unit tests.

3 years agofix: Only enable inode cache if subsecond stat timestamps are available
Joel Rosdahl [Thu, 4 Aug 2022 18:55:19 +0000 (20:55 +0200)] 
fix: Only enable inode cache if subsecond stat timestamps are available

If such fields are not available we risk false positive inode cache
hits.

3 years agochore: Remove unused InodeCache::Key::sloppy_time_macros field
Joel Rosdahl [Thu, 4 Aug 2022 18:21:16 +0000 (20:21 +0200)] 
chore: Remove unused InodeCache::Key::sloppy_time_macros field

3 years agoenhance: Support Stat::{atim,ctim,mtim} on macOS
Joel Rosdahl [Thu, 4 Aug 2022 18:01:40 +0000 (20:01 +0200)] 
enhance: Support Stat::{atim,ctim,mtim} on macOS

3 years agobump: Upgrade to cpp-httplib 0.11.1
Joel Rosdahl [Wed, 3 Aug 2022 19:38:51 +0000 (21:38 +0200)] 
bump: Upgrade to cpp-httplib 0.11.1

3 years agofix: Hash time information on inode cache hit
Joel Rosdahl [Wed, 3 Aug 2022 08:04:03 +0000 (10:04 +0200)] 
fix: Hash time information on inode cache hit

As mentioned in discussion #1086: If the inode cache is enabled,
hash_source_code_file will on an inode cache hit fail to hash time
information if there are temporal macros in the code. This is because
hash_source_code_string (called from hash_source_code_file via
hash_source_code_file_nocache) on an inode cache miss adds time
information to the hash in case one of those macros were found. However,
on an inode cache hit the return value of hash_source_code_file will be
correctly fetched from the cache, but the hash sum will only be updated
with (the hash of) the include file and not the time information.

The fix is to let the inode cache only cache the effects of hashing the
file and checking for macros, not the hashing of time information since
that's volatile.

After the fix:

- The new do_hash_file function performs file hashing and macro
  checking. The inode cache caches this step.
- hash_source_code_file returns a Digest instead of adding data to a
  Hash.
- hash_source_code_file calls do_hash_file and then potentially hashes
  time information. If there are no temporal macros the returned digest
  will be identical to the file hash, otherwise the returned digest will
  be of a hash of file content hash + time information.

This also improves hashes that are stored in the direct mode manifest:
Previously they were always the hash of the file content hash but now
they are just the file content hash in the common case when there is no
__DATE__ or __TIMESTAMP__ macro in the file.

3 years agofix: Hash sanitizeblacklist delimiter correctly
Joel Rosdahl [Tue, 2 Aug 2022 20:18:13 +0000 (22:18 +0200)] 
fix: Hash sanitizeblacklist delimiter correctly

Regression in a502145296044ea32b24e329d75122e777c598e6.

3 years agotest: Ignore clang warning from -fdebug-prefix-map test
Joel Rosdahl [Tue, 2 Aug 2022 19:26:45 +0000 (21:26 +0200)] 
test: Ignore clang warning from -fdebug-prefix-map test

3 years agotest: Only run -ftest-coverage + -fprofile-dir tests for GCC
Joel Rosdahl [Tue, 2 Aug 2022 19:16:09 +0000 (21:16 +0200)] 
test: Only run -ftest-coverage + -fprofile-dir tests for GCC

Clang complains with "warning: argument unused during compilation:
'-fprofile-dir=dir'".

3 years agoenhance: Make Hash::add_debug_text public
Joel Rosdahl [Tue, 2 Aug 2022 13:37:09 +0000 (15:37 +0200)] 
enhance: Make Hash::add_debug_text public

3 years agofix: Always rewrite dependency file if base_dir is used
Joel Rosdahl [Mon, 1 Aug 2022 12:53:52 +0000 (14:53 +0200)] 
fix: Always rewrite dependency file if base_dir is used

[1] added the has_absolute_include_headers variable as a performance
optimization for base_dir/CCACHE_BASEDIR so that the dependency file
only has to be parsed/rewritten when necessary. This is based on the
assumption that if no include file has an absolute path then no rewrite
is needed, but apparently Clang can insert other paths into the
dependency file as well, for instance the asan_blacklist.txt file when
using -fsanitize=address.

Fix this by simply always parsing the dependency file when base_dir is
active.

Fixes #1128.

[1]: 60178b7a8eb8d03b364afb2fb8bd6753924cd9b7

3 years agofix: Handle --hash-file/--checksum-file error properly
Joel Rosdahl [Sat, 30 Jul 2022 10:58:12 +0000 (12:58 +0200)] 
fix: Handle --hash-file/--checksum-file error properly

3 years agofeat: Move Windows config and cache to LOCALAPPDATA (#1124)
Rafael Kitover [Mon, 1 Aug 2022 12:34:16 +0000 (15:34 +0300)] 
feat: Move Windows config and cache to LOCALAPPDATA (#1124)

3 years agofeat: Log configuration file locations
Joel Rosdahl [Fri, 29 Jul 2022 09:42:32 +0000 (11:42 +0200)] 
feat: Log configuration file locations

See #1127.

3 years agochore: Remove redundant include of algorithm header
Joel Rosdahl [Fri, 29 Jul 2022 09:30:59 +0000 (11:30 +0200)] 
chore: Remove redundant include of algorithm header

Closes #1126.

3 years agochore: Remove unused CMake code
Joel Rosdahl [Thu, 28 Jul 2022 19:48:17 +0000 (21:48 +0200)] 
chore: Remove unused CMake code

3 years agofeat: Improve handling of dependency files
Joel Rosdahl [Thu, 28 Jul 2022 08:58:05 +0000 (10:58 +0200)] 
feat: Improve handling of dependency files

- Cache entries are now shared for different -MT/-MQ options. This is
  implemented by (on a cache hit) rewriting the stored dependency file
  data to have the correct dependency target before writing it to the
  destination. Closes #359.
- An intentional side effect of the above is that the correct dependency
  target will be produced even when base_dir/CCACHE_BASEDIR is used -
  the dependency target will still be an absolute path. Fixes #1042.
- Buggy support for GCC-specific environment variables
  DEPENDENCIES_OUTPUT and SUNPRO_DEPENDENCIES has been removed. When one
  of those variables was set, ccache used to store and fetch the content
  just as if -MMD or -MD were used. This is however incorrect since GCC
  *appends* to the destination file instead of (like -MMD/-MD)
  *rewriting* it. Since there is no way for ccache to know what the
  compiler appended to the dependency file, we simply can't support it.
  Reverts #349.

3 years agochore: Improve comment
Joel Rosdahl [Wed, 27 Jul 2022 17:35:54 +0000 (19:35 +0200)] 
chore: Improve comment

3 years agotest: Add support for negative content pattern matching
Joel Rosdahl [Tue, 26 Jul 2022 16:47:08 +0000 (18:47 +0200)] 
test: Add support for negative content pattern matching

3 years agofix: Restore order of cpp and cppstderr sections in input hash
Joel Rosdahl [Fri, 22 Jul 2022 20:35:35 +0000 (22:35 +0200)] 
fix: Restore order of cpp and cppstderr sections in input hash

This retains input hash compatibility with revisions before
64fc42ca2c5c9fe60ef4f1dc3882edb5f35579d6.

3 years agoci: Bump to macOS 11
Joel Rosdahl [Fri, 22 Jul 2022 11:08:21 +0000 (13:08 +0200)] 
ci: Bump to macOS 11

The macOS 10.15 runners are being deprecated.

3 years agofix: Work around Clang bug when outputting to full NFS disk
Joel Rosdahl [Wed, 20 Jul 2022 20:55:56 +0000 (22:55 +0200)] 
fix: Work around Clang bug when outputting to full NFS disk

See <https://github.com/llvm/llvm-project/issues/56499>.

Fixes #1115.

3 years agotest: Remove superfluous period from error message
Joel Rosdahl [Wed, 20 Jul 2022 20:54:45 +0000 (22:54 +0200)] 
test: Remove superfluous period from error message

3 years agotest: Fix printing of error messages with embedded newlines
Joel Rosdahl [Wed, 20 Jul 2022 20:53:25 +0000 (22:53 +0200)] 
test: Fix printing of error messages with embedded newlines

3 years agofeat: Don't remove inode cache file on -C/--clear
Joel Rosdahl [Tue, 19 Jul 2022 13:31:34 +0000 (15:31 +0200)] 
feat: Don't remove inode cache file on -C/--clear

-C/--clear is tied to the cache directory while the inode cache file is
a temporary file. I think it makes more sense to not consider the inode
cache part of the main cache directory.