]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
43 hours agochore: Update NEWS master v4.12
Joel Rosdahl [Sun, 14 Sep 2025 11:32:41 +0000 (13:32 +0200)] 
chore: Update NEWS

43 hours agochore: Update AUTHORS
Joel Rosdahl [Sun, 14 Sep 2025 11:32:30 +0000 (13:32 +0200)] 
chore: Update AUTHORS

43 hours agochore: Convert misc/update-authors to Python
Joel Rosdahl [Sun, 14 Sep 2025 11:30:51 +0000 (13:30 +0200)] 
chore: Convert misc/update-authors to Python

43 hours agochore: Update .mailmap
Joel Rosdahl [Sat, 13 Sep 2025 19:21:13 +0000 (21:21 +0200)] 
chore: Update .mailmap

43 hours agochore: Add alma-9 dockerfile
Joel Rosdahl [Sun, 14 Sep 2025 11:33:46 +0000 (13:33 +0200)] 
chore: Add alma-9 dockerfile

43 hours agochore: Add debian-13 dockerfile
Joel Rosdahl [Sat, 13 Sep 2025 09:42:54 +0000 (11:42 +0200)] 
chore: Add debian-13 dockerfile

5 days agotest: Simplify get_root()
Joel Rosdahl [Wed, 10 Sep 2025 16:49:29 +0000 (18:49 +0200)] 
test: Simplify get_root()

5 days agodocs: Document "Unsupported source encoding" statistics counter
Joel Rosdahl [Tue, 9 Sep 2025 19:17:10 +0000 (21:17 +0200)] 
docs: Document "Unsupported source encoding" statistics counter

5 days agotest: Handle GetVolumePathName errors, prevent access violation (#1626)
autoantwort [Wed, 10 Sep 2025 16:48:42 +0000 (18:48 +0200)] 
test: Handle GetVolumePathName errors, prevent access violation (#1626)

For example GetVolumePathName returns `F:/git_projects` on my computer which
does not fit in a char[4]. As a result GetVolumePathName returns an error and
a std::string is initialized from uninitialized memory which may not contain
a '\0' resulting in out of bounds memory reads.

Co-authored-by: Leander Schulten <Leander.Schulten@tetys.de>
6 days agofix: Avoid expanding symlinks in relative path candidates
Joel Rosdahl [Tue, 9 Sep 2025 16:34:34 +0000 (18:34 +0200)] 
fix: Avoid expanding symlinks in relative path candidates

Commit 8223ed38abd9cf75ab75cb19dc2081c44bf568d0 changed
make_relative_path to also try matching real_path(path) against the
apparent/actual CWD, assuming that an absolute path p could be
substituted with real_path(p).

This assumption is incorrect for source files: if the source file
includes a file via a relative path, expanding symlinks may cause the
include file to be searched in the wrong directory.

Fix by reverting that change. The new test case "Symlink to source file,
longer symlink path" fails without this fix.

Note: this effectively reverts #724.

Fixes #1620.

6 days agochore: Touch up basedir.bash
Joel Rosdahl [Tue, 9 Sep 2025 16:34:07 +0000 (18:34 +0200)] 
chore: Touch up basedir.bash

7 days agofix: Hash specs file actually used by GCC
Joel Rosdahl [Sun, 7 Sep 2025 17:10:47 +0000 (19:10 +0200)] 
fix: Hash specs file actually used by GCC

"gcc -specs=foo" (when "foo" doesn't include a slash) makes GCC search
in various system directories for the file, so ccache fails to hash the
file if it's found in such a directory.

Fix this by asking the compiler (using "-print-file-name") which file it
will actually read.

Fixes #1625.

7 days agofeat: Add support for Clang --config= option
Joel Rosdahl [Sun, 7 Sep 2025 15:29:18 +0000 (17:29 +0200)] 
feat: Add support for Clang --config= option

Clang >= 16 supports "--config=name" in addition to "--config name".

8 days agodocs: Fix markup in NEWS file
Joel Rosdahl [Sat, 6 Sep 2025 14:45:34 +0000 (16:45 +0200)] 
docs: Fix markup in NEWS file

8 days agorefactor: Simplify HTTP logging slightly
Joel Rosdahl [Wed, 3 Sep 2025 18:09:42 +0000 (20:09 +0200)] 
refactor: Simplify HTTP logging slightly

8 days agochore: Update .mailmap
Joel Rosdahl [Wed, 3 Sep 2025 17:58:28 +0000 (19:58 +0200)] 
chore: Update .mailmap

8 days agorefactor: Simplify UTF-16LE to UTF-8 conversion in util::read_file
Joel Rosdahl [Wed, 3 Sep 2025 17:58:00 +0000 (19:58 +0200)] 
refactor: Simplify UTF-16LE to UTF-8 conversion in util::read_file

9 days agobump: Upgrade to tl-expected 1.3.1
Joel Rosdahl [Mon, 1 Sep 2025 18:14:39 +0000 (20:14 +0200)] 
bump: Upgrade to tl-expected 1.3.1

10 days agobuild(blake3): Don't use NEON on aarch64_be (#1624)
J. Neuschäfer [Sat, 6 Sep 2025 07:21:16 +0000 (09:21 +0200)] 
build(blake3): Don't use NEON on aarch64_be (#1624)

10 days agoci: Fix version logic in prepare-release for PR workflows
Joel Rosdahl [Fri, 5 Sep 2025 20:13:39 +0000 (22:13 +0200)] 
ci: Fix version logic in prepare-release for PR workflows

10 days agoci: Fix ccache version for PR workflows
Joel Rosdahl [Fri, 5 Sep 2025 18:56:13 +0000 (20:56 +0200)] 
ci: Fix ccache version for PR workflows

12 days agofix: Fix crash on HTTP request failure (#1628)
autoantwort [Wed, 3 Sep 2025 18:01:43 +0000 (20:01 +0200)] 
fix: Fix crash on HTTP request failure (#1628)

If the request fails and `result.error() != Error::Success` `result->` can return
a `nullptr` resulting in a null pointer dereference.

Co-authored-by: Leander Schulten <Leander.Schulten@tetys.de>
12 days agofix: Fix bad conversion from UTF-16 in util::read_file on Windows (#1627)
autoantwort [Wed, 3 Sep 2025 17:39:13 +0000 (19:39 +0200)] 
fix: Fix bad conversion from UTF-16 in util::read_file on Windows (#1627)

When interpreting a char* string that is null terminated as wchar* string
it is not guaranteed that the wchar* string is also null terminated. A char[3]
string/memeory region with the content ['a', '\0', '\0', 100] interpreted as
wchar* has no ending null character resulting in out of bounds memory reads
when trying to construct a std::wstring from it.

Co-authored-by: Leander Schulten <Leander.Schulten@tetys.de>
2 weeks agoci: Add jobs to build and create release
Joel Rosdahl [Sat, 30 Aug 2025 10:39:55 +0000 (12:39 +0200)] 
ci: Add jobs to build and create release

This includes new binary releases for Linux aarch64 and Windows aarch64.

Closes #1579. See also discussion #1310.

2 weeks agoci: Add artifact retention
Joel Rosdahl [Sun, 31 Aug 2025 08:28:12 +0000 (10:28 +0200)] 
ci: Add artifact retention

2 weeks agoci: Verify llvm-mingw toolchain download
Joel Rosdahl [Wed, 27 Aug 2025 19:03:43 +0000 (21:03 +0200)] 
ci: Verify llvm-mingw toolchain download

2 weeks agoci: Rename binary jobs to common "-binary" suffix
Joel Rosdahl [Wed, 27 Aug 2025 19:03:03 +0000 (21:03 +0200)] 
ci: Rename binary jobs to common "-binary" suffix

2 weeks agoci: Add traces to CI jobs to make debug cycle shorter
Joel Rosdahl [Wed, 27 Aug 2025 18:57:45 +0000 (20:57 +0200)] 
ci: Add traces to CI jobs to make debug cycle shorter

2 weeks agobuild: Improve installation of documentation
Joel Rosdahl [Wed, 27 Aug 2025 18:53:45 +0000 (20:53 +0200)] 
build: Improve installation of documentation

- Make HTML and man page part of "cmake --install".
- Make modifications of man page in-place to avoid leaving a .tmp file
  behind.

2 weeks agoci: Rename macOS to Darwin in CI context
Joel Rosdahl [Wed, 27 Aug 2025 18:46:45 +0000 (20:46 +0200)] 
ci: Rename macOS to Darwin in CI context

2 weeks agoci: Rename macOS binary jobs to match others
Joel Rosdahl [Sun, 17 Aug 2025 12:23:47 +0000 (14:23 +0200)] 
ci: Rename macOS binary jobs to match others

2 weeks agoci: Add documentation build job
Joel Rosdahl [Sun, 17 Aug 2025 12:21:23 +0000 (14:21 +0200)] 
ci: Add documentation build job

2 weeks agoci: Run on ubuntu-24.04 instead of ubuntu-latest
Joel Rosdahl [Fri, 15 Aug 2025 15:23:51 +0000 (17:23 +0200)] 
ci: Run on ubuntu-24.04 instead of ubuntu-latest

I prefer to avoid *-latest tags.

2 weeks agoci: Improve binary build jobs
Joel Rosdahl [Sun, 10 Aug 2025 08:56:19 +0000 (10:56 +0200)] 
ci: Improve binary build jobs

For x86_64, build in an Alma Linux 8 container since RHEL 8 is the
oldest still active LTS mainstream Linux distribution to my knowledge.

For aarch64, cross compile in an x86_64 environment instead of in a
native aarch64 environment. This is because I want to be able to build
release binaries locally on my x86_64 machine if there is some problem
with the CI environment and it feels good to match that in CI. The build
is still on Ubuntu 22.04 – I made a quick attempt to get
cross-compilation working in Alma Linux 8 working but gave up.

2 weeks agoci: Bump to newer codespell and typos versions
Joel Rosdahl [Sun, 31 Aug 2025 08:24:12 +0000 (10:24 +0200)] 
ci: Bump to newer codespell and typos versions

3 weeks agobuild: Detect ccache version from GitHub Actions environment
Joel Rosdahl [Fri, 8 Aug 2025 18:33:41 +0000 (20:33 +0200)] 
build: Detect ccache version from GitHub Actions environment

3 weeks agorefactor: Use std::array instead of const char* array (#1623)
autoantwort [Thu, 21 Aug 2025 19:26:17 +0000 (21:26 +0200)] 
refactor: Use std::array instead of const char* array (#1623)

4 weeks agofeat: Add support for multiple directories in base_dir/CCACHE_BASEDIR
Joel Rosdahl [Sat, 16 Aug 2025 19:09:19 +0000 (21:09 +0200)] 
feat: Add support for multiple directories in base_dir/CCACHE_BASEDIR

Closes #597.

4 weeks agoenhance: Add util::join_path_list
Joel Rosdahl [Sat, 16 Aug 2025 19:07:29 +0000 (21:07 +0200)] 
enhance: Add util::join_path_list

4 weeks agoenhance: Implement util::to_string(const fs::path&)
Joel Rosdahl [Sat, 16 Aug 2025 19:06:39 +0000 (21:06 +0200)] 
enhance: Implement util::to_string(const fs::path&)

4 weeks agochore: Improve comments
Joel Rosdahl [Mon, 11 Aug 2025 18:22:24 +0000 (20:22 +0200)] 
chore: Improve comments

4 weeks agodocs: Reflow long line in manual
Joel Rosdahl [Mon, 11 Aug 2025 18:50:21 +0000 (20:50 +0200)] 
docs: Reflow long line in manual

4 weeks agofix: Support wide characters in filenames for MSVC
Joel Rosdahl [Wed, 13 Aug 2025 17:36:53 +0000 (19:36 +0200)] 
fix: Support wide characters in filenames for MSVC

Fixes #1619.

4 weeks agochore: Improve ccache.exe.manifest.in structure
Joel Rosdahl [Wed, 13 Aug 2025 17:36:27 +0000 (19:36 +0200)] 
chore: Improve ccache.exe.manifest.in structure

4 weeks agochore: Downgrade clang-format to 18.1.3, matching Ubuntu 24.04
Joel Rosdahl [Thu, 14 Aug 2025 19:51:07 +0000 (21:51 +0200)] 
chore: Downgrade clang-format to 18.1.3, matching Ubuntu 24.04

4 weeks agoci: Enable tests in the msys2 mingw64+clang configuration (#1618)
Martin Storsjö [Tue, 12 Aug 2025 18:10:40 +0000 (21:10 +0300)] 
ci: Enable tests in the msys2 mingw64+clang configuration (#1618)

Instead of disabling tests altogether, pass the -Wno-deprecated
option, working around https://github.com/doctest/doctest/issues/900
in a different fashion.

4 weeks agoci: Disable Windows MSYS2 clangarm64 job for now
Joel Rosdahl [Tue, 12 Aug 2025 17:55:22 +0000 (19:55 +0200)] 
ci: Disable Windows MSYS2 clangarm64 job for now

The job occasionally crashes with an "Exception: SegFault" message,
perhaps from CTest?

See #1618.

5 weeks agochore: Modernize Python code in test/http-*
Joel Rosdahl [Fri, 8 Aug 2025 11:10:56 +0000 (13:10 +0200)] 
chore: Modernize Python code in test/http-*

5 weeks agotest: Fix detection of test suites in test/run
Joel Rosdahl [Wed, 6 Aug 2025 20:10:27 +0000 (22:10 +0200)] 
test: Fix detection of test suites in test/run

Broke in 9da7c09c9390b2db5c745a8dad58d7a3ac3af9b0.

5 weeks agofix: Redact URLs logged by remote http backend
Joel Rosdahl [Fri, 8 Aug 2025 11:06:38 +0000 (13:06 +0200)] 
fix: Redact URLs logged by remote http backend

5 weeks agodocs: Mention that #pragma once could be problematic with PCH
Joel Rosdahl [Wed, 6 Aug 2025 16:52:28 +0000 (18:52 +0200)] 
docs: Mention that #pragma once could be problematic with PCH

Fixes #1615.

5 weeks agorefactor: Improve name and type of only_if_missing parameter
Joel Rosdahl [Wed, 6 Aug 2025 14:55:35 +0000 (16:55 +0200)] 
refactor: Improve name and type of only_if_missing parameter

5 weeks agoMerge pull request #1598 from mstorsjo/ci-arm
Joel Rosdahl [Tue, 5 Aug 2025 17:48:26 +0000 (19:48 +0200)] 
Merge pull request #1598 from mstorsjo/ci-arm

5 weeks agoci: Add jobs for building binaries for Windows and Linux 1598/head
Martin Storsjö [Tue, 10 Jun 2025 10:53:41 +0000 (13:53 +0300)] 
ci: Add jobs for building binaries for Windows and Linux

Build binaries for x86_64 and aarch64 on Linux, and i686, x86_64
and aarch64 for Windows.

The Windows binaries are cross compiled from Linux. For x86, it
uses distro provided compilers, while it uses llvm-mingw installed
separately for targeting aarch64. (Most distros don't have packages
for mingw cross compilers for targeting Windows on aarch64 yet. GCC
isn't mature for this target yet, but Clang has supported this
target for many years now. Llvm-mingw is essentially the same toolchain
setup as MSYS2 uses in their clangarm64 environment, but available
as a standalone cross compiler too.)

5 weeks agoci: Add a toolchain file for (cross) compilation for aarch64-w64-mingw32
Martin Storsjö [Wed, 30 Jul 2025 09:05:22 +0000 (12:05 +0300)] 
ci: Add a toolchain file for (cross) compilation for aarch64-w64-mingw32

Contrary to the existing toolchain files, this doesn't hardcode
CMAKE_FIND_ROOT_PATH to a location in /usr, but locates the
compiler from the path, and picks a sysroot adjacent to it - allowing
using a compiler installed in any path.

This uses a compiler named "${TOOLCHAIN_PREFIX}-gcc" - toolchains
such as llvm-mingw do provide cross tools named "-gcc" for
compatibility, even if they use Clang.

5 weeks agoci: Run build_and_test on Linux on ARM too
Martin Storsjö [Tue, 10 Jun 2025 10:40:32 +0000 (13:40 +0300)] 
ci: Run build_and_test on Linux on ARM too

5 weeks agoci: Run the Windows VS2022 ARM64 MSBuild tests on actual ARM hardware
Martin Storsjö [Tue, 10 Jun 2025 10:33:03 +0000 (13:33 +0300)] 
ci: Run the Windows VS2022 ARM64 MSBuild tests on actual ARM hardware

5 weeks agoci: Extend the msys2 testing to the "clangarm64" environment
Martin Storsjö [Tue, 10 Jun 2025 10:31:42 +0000 (13:31 +0300)] 
ci: Extend the msys2 testing to the "clangarm64" environment

The clangarm64 msys environment doesn't have a "gcc" command
by default, unless the "gcc-compat" package is installed.

One may consider using "cc" as well, which is available when
the "toolchain" package is installed in each environment, but
that tool in clang environments fails the "direct" test case.

5 weeks agoci: Use pacboy to simplify installation of msys2 packages
Martin Storsjö [Tue, 10 Jun 2025 10:28:53 +0000 (13:28 +0300)] 
ci: Use pacboy to simplify installation of msys2 packages

See [1] and [2] for reference on using pacboy to simplify installing
mingw packages in msys2. The relevant bit to know is that by
specifying plain package names with a ":p" suffix, in the "pacboy"
section in msys2/setup-msys2, those packages are installed within
the current msys2 environment.

This avoids needing to specify the long package prefix like
"mingw-w64-x86_64". For other environments like "ucrt64", "clang64"
and "clangarm64", the prefix is even longer and less obvious.

[1] https://github.com/msys2/setup-msys2?tab=readme-ov-file#pacboy
[2] https://www.msys2.org/docs/package-naming/#avoiding-writing-long-package-names

5 weeks agoci: Stop manually installing Ninja on Linux and macOS
Martin Storsjö [Tue, 10 Jun 2025 10:55:00 +0000 (13:55 +0300)] 
ci: Stop manually installing Ninja on Linux and macOS

Since https://github.com/actions/runner-images/pull/11706,
https://github.com/actions/runner-images/pull/11707 and
https://github.com/actions/runner-images/pull/11737, ninja is
preinstalled in the Ubuntu, macOS and x86 Windows runner images.

5 weeks agorefactor: Use TRY_ASSIGN and TRY
Joel Rosdahl [Tue, 5 Aug 2025 11:42:33 +0000 (13:42 +0200)] 
refactor: Use TRY_ASSIGN and TRY

5 weeks agofix: Properly make unique temporary name in TRY_ASSIGN
Joel Rosdahl [Tue, 5 Aug 2025 08:48:18 +0000 (10:48 +0200)] 
fix: Properly make unique temporary name in TRY_ASSIGN

5 weeks agorefactor: Extract macros for creating unique variable names
Joel Rosdahl [Tue, 5 Aug 2025 08:45:41 +0000 (10:45 +0200)] 
refactor: Extract macros for creating unique variable names

6 weeks agoci: Declare downloaded zstd as EXCLUDE_FROM_ALL
Joel Rosdahl [Sun, 3 Aug 2025 16:04:29 +0000 (18:04 +0200)] 
ci: Declare downloaded zstd as EXCLUDE_FROM_ALL

8648532e3cdcd6a0c4fb12b65e1ca9a8972a1e06 removed usage of
FetchContent_Populate to avoid warnings from newer CMake versions, but
the EXCLUDE_FROM_ALL part got lost in translation.

Corresponding semantics is available by passing EXCLUDE_FROM_ALL to
FetchContent_Declare, but only since CMake 3.28 so we need to add some
backward compatibility goo.

6 weeks agobuild: Remove obsolete variable in FindZstd.cmake
Joel Rosdahl [Sun, 3 Aug 2025 15:06:48 +0000 (17:06 +0200)] 
build: Remove obsolete variable in FindZstd.cmake

6 weeks agochore: Make code buildable with tl-expected 1.2.0
Joel Rosdahl [Sun, 3 Aug 2025 11:44:15 +0000 (13:44 +0200)] 
chore: Make code buildable with tl-expected 1.2.0

tl-expected 1.2.0 has made tl::expected objects [[nodiscard]], so make
sure to handle all tl::expected return values properly.

6 weeks agobump: Upgrade to tl-expected 1.2.0
Joel Rosdahl [Fri, 25 Jul 2025 18:48:13 +0000 (20:48 +0200)] 
bump: Upgrade to tl-expected 1.2.0

6 weeks agoenhance: Add TRY_ASSIGN macro
Joel Rosdahl [Sun, 3 Aug 2025 11:43:51 +0000 (13:43 +0200)] 
enhance: Add TRY_ASSIGN macro

6 weeks agoenhance: Improve TRY macro
Joel Rosdahl [Sun, 3 Aug 2025 11:43:32 +0000 (13:43 +0200)] 
enhance: Improve TRY macro

6 weeks agorefactor: Simplify EINTR check for waitpid
Joel Rosdahl [Sun, 3 Aug 2025 06:00:05 +0000 (08:00 +0200)] 
refactor: Simplify EINTR check for waitpid

6 weeks agofeat: Don't log failure when removing output file in hard link mode
Joel Rosdahl [Sat, 2 Aug 2025 19:09:31 +0000 (21:09 +0200)] 
feat: Don't log failure when removing output file in hard link mode

If there is no preexisting output object file then we shouldn't indicate
an error.

6 weeks agorefactor: Rename local variable in macro to avoid clashes
Joel Rosdahl [Sat, 2 Aug 2025 16:40:42 +0000 (18:40 +0200)] 
refactor: Rename local variable in macro to avoid clashes

6 weeks agochore: Remove redundant logging of error
Joel Rosdahl [Sat, 2 Aug 2025 16:40:10 +0000 (18:40 +0200)] 
chore: Remove redundant logging of error

6 weeks agoci: Avoid using windows-latest runner image
Joel Rosdahl [Sat, 2 Aug 2025 12:16:33 +0000 (14:16 +0200)] 
ci: Avoid using windows-latest runner image

7 weeks agofix: Expand system-dependent -m{arch,cpu,tune}=native options
Joel Rosdahl [Thu, 24 Jul 2025 13:35:47 +0000 (15:35 +0200)] 
fix: Expand system-dependent -m{arch,cpu,tune}=native options

The -march=native, -mcpu=native and -mtune=native options have different
effects depending on which system the compiler is run.

Fix this by asking the compiler which cc1 options the -m*=native options
expand to and including them in the input hash.

Fixes #824.

7 weeks agorefactor: Extract command execution code from hashutil to util function
Joel Rosdahl [Thu, 24 Jul 2025 11:18:40 +0000 (13:18 +0200)] 
refactor: Extract command execution code from hashutil to util function

7 weeks agofeat: Improve logging in execute* functions
Joel Rosdahl [Thu, 24 Jul 2025 10:55:32 +0000 (12:55 +0200)] 
feat: Improve logging in execute* functions

7 weeks agochore: Simplify Windows-specific hacks for shell scripts in test suite
Joel Rosdahl [Wed, 23 Jul 2025 12:46:39 +0000 (14:46 +0200)] 
chore: Simplify Windows-specific hacks for shell scripts in test suite

7 weeks agorefactor: Improve variable name in win32execute
Joel Rosdahl [Thu, 24 Jul 2025 08:58:03 +0000 (10:58 +0200)] 
refactor: Improve variable name in win32execute

7 weeks agochore: Remove dead code in hash_command_output
Joel Rosdahl [Wed, 23 Jul 2025 11:17:02 +0000 (13:17 +0200)] 
chore: Remove dead code in hash_command_output

7 weeks agorefactor: Move Args to util namespace
Joel Rosdahl [Wed, 23 Jul 2025 08:44:00 +0000 (10:44 +0200)] 
refactor: Move Args to util namespace

7 weeks agoenhance: Add Args initializer list constructor
Joel Rosdahl [Mon, 21 Jul 2025 19:00:27 +0000 (21:00 +0200)] 
enhance: Add Args initializer list constructor

7 weeks agochore: Add build-ccache-with-itself script
Joel Rosdahl [Tue, 22 Jul 2025 12:43:25 +0000 (14:43 +0200)] 
chore: Add build-ccache-with-itself script

This script can be used to verify that ccache is able to cache a build
of itself.

Example usage:

    COMMAND=/source/misc/build-ccache-with-itself misc/build-in-docker debian-12

8 weeks agochore: Finalize renaming of namespaces to lowercase
Joel Rosdahl [Mon, 21 Jul 2025 11:17:26 +0000 (13:17 +0200)] 
chore: Finalize renaming of namespaces to lowercase

8 weeks agofix: Keep original order of compiler arguments
Joel Rosdahl [Sun, 20 Jul 2025 13:41:44 +0000 (15:41 +0200)] 
fix: Keep original order of compiler arguments

Now when CCACHE_NOCPP2 (run_second_cpp = false) has been removed (see
fd9de83446aeaf1eb1b33a2d900ea1ff757c4509) we can simplify compiler
argument juggling: instead of partitioning arguments into different
lists and reassemble them later, we can build up the preprocessor and
compiler command lines while we go, thus keeping the original order of
arguments.

Fixes #738.

8 weeks agochore: Remove ability to avoid 2nd call to preprocessor (run_second_cpp)
Joel Rosdahl [Sat, 19 Jul 2025 18:43:32 +0000 (20:43 +0200)] 
chore: Remove ability to avoid 2nd call to preprocessor (run_second_cpp)

ccache before version 1.6 (2002) always sent precompiled source to the
compiler as an optimization to avoid running the preprocessor a second
time. ccache 1.6 (2002) introduced CCACHE_CPP2 to optionally disable
this optimization. This seemed to work well until mid 2010s when
compilers started to behave differently when compiling preprocessed and
non-preprocessed source code. Thus, ccache 3.3 (2016) flipped the
default to make the optimization opt-in via CCACHE_NOCPP2 (or
"run_second_cpp = false").

Fast forward to 2025:

- As far as I can tell, CCACHE_NOCPP2 is used by essentially nobody
  which isn't surprising since it generally doesn't work well.
- The feature comes with increased code complexity. The most painful
  part is that compiler arguments need to be carefully filtered and sent
  to only the preprocessor, only the compiler or both, depending on
  whether run_second_cpp is true or false. And it can be forced to true
  in the middle of argument parsing when an argument that is
  incompatible with "run_second_cpp = false" is found.
- There have been a non-trivial amount of bugs related to CCACHE_NOCPP2
  during the years due to the added complexity and due to new compiler
  behavior that is incompatible with the mode.a
- The depend mode is a more performant alternative to "run_second_cpp =
  false" since ccache 3.6 (2019), though with different tradeoffs.

Thus it's time to make the code less complex and more maintainable:
remove the optimization to send the precompiled source code to the
compiler.

This opens up making argument juggling simpler and fixing bug #738.

8 weeks agochore: Improve code style
Joel Rosdahl [Sat, 19 Jul 2025 11:08:52 +0000 (13:08 +0200)] 
chore: Improve code style

8 weeks agochore: Bump to Clang-Format 18
Joel Rosdahl [Sat, 19 Jul 2025 09:06:56 +0000 (11:06 +0200)] 
chore: Bump to Clang-Format 18

8 weeks agodocs: Mention mitigation for direct mode caveat
Joel Rosdahl [Sat, 19 Jul 2025 10:49:31 +0000 (12:49 +0200)] 
docs: Mention mitigation for direct mode caveat

8 weeks agofix: Fix bug in support for Clang to compile CUDA code on Windows
senhtry [Thu, 17 Jul 2025 14:01:51 +0000 (22:01 +0800)] 
fix: Fix bug in support for Clang to compile CUDA code on Windows

8 weeks agochore: Remove ubuntu-20.04 Dockerfile as its CMake is too old
Joel Rosdahl [Thu, 17 Jul 2025 13:47:50 +0000 (15:47 +0200)] 
chore: Remove ubuntu-20.04 Dockerfile as its CMake is too old

8 weeks agobuild: Drop minimum CMake version to 3.18
Joel Rosdahl [Thu, 17 Jul 2025 13:25:05 +0000 (15:25 +0200)] 
build: Drop minimum CMake version to 3.18

This is to keep supporting Debian 11 for a while longer.

Note that 8648532e3cdcd6a0c4fb12b65e1ca9a8972a1e06 requires CMake > 3.16
(not sure whether 3.17 works), so dropping back to 3.15 is not possible.

Closes #1611.

2 months agofix: Include MSVC variables INCLUDE and EXTERNAL_INCLUDE in input hash
Joel Rosdahl [Tue, 15 Jul 2025 14:48:00 +0000 (16:48 +0200)] 
fix: Include MSVC variables INCLUDE and EXTERNAL_INCLUDE in input hash

See discussion #1606.

2 months agoci: Small GH actions cleanup (#1602)
Maksym Sobolyev [Mon, 14 Jul 2025 18:17:01 +0000 (11:17 -0700)] 
ci: Small GH actions cleanup (#1602)

Remove superfluous ${{ }}.

2 months agoLink libatomic statically when STATIC_LINK is set (#1601)
Maksym Sobolyev [Mon, 14 Jul 2025 18:16:23 +0000 (11:16 -0700)] 
Link libatomic statically when STATIC_LINK is set (#1601)

Link libatomic statically when STATIC_LINK is set.

2 months agobuild: Avoid warning from downloaded zstd's CMake scripts
Joel Rosdahl [Mon, 14 Jul 2025 13:56:24 +0000 (15:56 +0200)] 
build: Avoid warning from downloaded zstd's CMake scripts

2 months agobuild: Use FetchContent_MakeAvailable instead of FetchContent_Populate
Joel Rosdahl [Mon, 14 Jul 2025 13:44:22 +0000 (15:44 +0200)] 
build: Use FetchContent_MakeAvailable instead of FetchContent_Populate

Closes #1501.

2 months agobuild: Require CMake 3.22 or newer
Joel Rosdahl [Mon, 14 Jul 2025 09:12:38 +0000 (11:12 +0200)] 
build: Require CMake 3.22 or newer

For reference, CMake 3.22 is available in Debian 11 as well as Ubuntu
22.04. Distributions based on RHEL 8 have 3.25 or later.

2 months agofeat: Embed manifest to enable long paths on Windows (#1596)
Morten Engelhardt Olsen [Wed, 9 Jul 2025 10:39:58 +0000 (03:39 -0700)] 
feat: Embed manifest to enable long paths on Windows (#1596)

On a windows build, add a ccache.exe manifest which enables long path awareness in Windows 10+.

Fixes #1595.

2 months agotest: Add test for tricky preprocessed cache hit case
Joel Rosdahl [Thu, 26 Jun 2025 19:16:57 +0000 (21:16 +0200)] 
test: Add test for tricky preprocessed cache hit case

See PR #1594.