Joel Rosdahl [Sat, 25 Apr 2026 14:40:46 +0000 (16:40 +0200)]
fix: Increase default storage helper data/request timeouts to 10s/1m
On heavily loaded systems, ccache may see multi-second delays waiting
for responses from the storage helper. This can happen because of local
load, helper queueing or slow remote storage responses, even when
nothing is actually broken. The previous defaults were therefore too
aggressive and could cause spurious timeouts, leading to more local
compilation load and, in turn, even more timeouts.
Increase the default data and request timeouts to 10s and 1m
respectively while still keeping them low enough to detect a stuck
helper or malfunctioning remote storage in reasonable time.
Joel Rosdahl [Sat, 18 Apr 2026 19:06:11 +0000 (21:06 +0200)]
feat: Add diagnostics messages and identity to storage helper greeting
Storage helpers may need to report startup problems back to ccache, e.g.
unknown or malformed attributes. This can now be done in a new greeting
format where such diagnostic messages can be included. It also adds a
server identity field so that ccache can log the storage helper version.
Joel Rosdahl [Thu, 26 Mar 2026 08:13:39 +0000 (09:13 +0100)]
fix: Disable base directory when using MSVC's /Yc option
When creating a precompiled header (PCH), MSVC does not like relative
paths for /Yc and /FI arguments, so don't rewrite paths to relative in
that case.
Björn Svensson [Mon, 23 Mar 2026 19:29:32 +0000 (20:29 +0100)]
fix(http): Treat HTTP 2xx with empty body as cache miss (#1707)
fix(storage): Treat empty remote storage entries as errors
A remote storage backend returning a value with an empty body indicates
a corrupt or misconfigured entry, not a cache miss. Check for empty
values in the storage layer so that all current and future backends are
covered. The error is logged but the backend is not marked as failed,
since other entries may still be valid.
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
The POSIX error for a missing command is not stable across systems. Some
environments report the posix_spawnp failure directly, while others
return a shell-style "Non-zero exit code: 127" instead.
Accept both outcomes in the test and capture the actual error string to
make future failures easier to diagnose.
Joel Rosdahl [Sat, 14 Mar 2026 12:06:18 +0000 (13:06 +0100)]
test: Don't check `.ltrans0.ltrans.su` files in `-flto` tests (#1704)
Different compilers produce different stack-usage files when linking
object files compiled with `-fstack-usage -flto`. Since ccache does not
cache linking anyway, skip checking the linking results to avoid
compiler-specific expectations.
Joel Rosdahl [Sun, 8 Mar 2026 12:19:11 +0000 (13:19 +0100)]
fix: Use OS-specific methods to reliably find the ccache executable path
argv[0] is not guaranteed to reflect the actual location of the
executable (e.g. when invoked via a symlink). Use platform-specific APIs
instead. Fall back to the argv[0]-based approach if the OS method fails.
Joel Rosdahl [Sat, 7 Mar 2026 21:42:11 +0000 (22:42 +0100)]
fix: Search for storage helper in libexec before PATH
Previously ccache searched for storage helpers in PATH before libexec
directories. The idea was that users could easily override a
system-installed helper by placing a newer version earlier in PATH.
However, this also meant that PATH was consulted even when a libexec
directory had been explicitly configured, or when the helper was
installed in the intended system location. In these cases, helpers found
in PATH could take precedence over the expected libexec helper.
Since installing helpers in a libexec directory is the intended
deployment model, prefer libexec locations over PATH.
Joel Rosdahl [Thu, 26 Feb 2026 10:40:43 +0000 (11:40 +0100)]
feat: Add support for directory-specific configuration file
Ccache now searches for a ccache.conf file (separate from the
cache-specific config) in the current working directory and its parent
directories. This allows per-project configuration without modifying the
user's cache-specific config.
Directory config has higher priority than other config files but lower
priority than environment variables.
The search stops when reaching a ceiling_dirs entry (default: $HOME), a
ceiling_marker (default: .git), a mount point or a directory owned by
another user. A found file is accepted only if it is owned by the
effective user and not world-writable.
For security, unsafe settings are rejected by default, where unsafe
means affecting which commands to execute, which files to write and
which network connections to make. They are only allowed when the
directory config file is under a trusted path listed in safe_dirs.
Joel Rosdahl [Thu, 12 Feb 2026 20:05:30 +0000 (21:05 +0100)]
refactor: Generalize "already preprocessed" compiler language slightly (#1684)
- Rename ArgsInfo::direct_i_file to preprocess_input_file, since that's
what it now means.
- Add "ir" as a language and let "-fthinlto-index=" use that language
implicitly instead of piggybacking on "assembler".