]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
14 months agofix: Force run_second_cpp=true when generating profiling information
Joel Rosdahl [Wed, 8 May 2024 18:45:13 +0000 (20:45 +0200)] 
fix: Force run_second_cpp=true when generating profiling information

If run_second_cpp=false the coverage report will refer to the temporary
preprocessed file instead of the source file. Fix this by forcing
run_second_cpp=true if profiling information is being generated.

Fixes #1441.

14 months agofix: Hash "apparent real path" of object file when using -fprofile-arcs
Joel Rosdahl [Mon, 6 May 2024 18:43:43 +0000 (20:43 +0200)] 
fix: Hash "apparent real path" of object file when using -fprofile-arcs

The object file stores an absolute path based on apparent CWD when
-fprofile-arcs is used, not only the relative object filename.

14 months agotest: Improve verbose printing of test names
Joel Rosdahl [Mon, 6 May 2024 18:41:51 +0000 (20:41 +0200)] 
test: Improve verbose printing of test names

14 months agorefactor: Add more Hash::hash overloads
Joel Rosdahl [Mon, 6 May 2024 18:35:22 +0000 (20:35 +0200)] 
refactor: Add more Hash::hash overloads

15 months agodocs: Improve documentation of gcno_cwd sloppiness
Joel Rosdahl [Sun, 5 May 2024 17:03:47 +0000 (19:03 +0200)] 
docs: Improve documentation of gcno_cwd sloppiness

As suggested by Ben Portner in #1444.

15 months agofix: Handle -fdiagnostics-color for Clang again
Joel Rosdahl [Sun, 5 May 2024 16:56:39 +0000 (18:56 +0200)] 
fix: Handle -fdiagnostics-color for Clang again

Regression in 96ec6c9d98b88f00e1a69bdd0214c237bc7ed04e (ccache 4.6.2).

Fixes #1446.

15 months agochore: Clean up comment and debug log string
Joel Rosdahl [Sat, 4 May 2024 19:03:00 +0000 (21:03 +0200)] 
chore: Clean up comment and debug log string

15 months agotest: Improve printing of test suite
Joel Rosdahl [Thu, 2 May 2024 19:31:24 +0000 (21:31 +0200)] 
test: Improve printing of test suite

15 months agochore: Fix typo
Joel Rosdahl [Wed, 1 May 2024 19:33:36 +0000 (21:33 +0200)] 
chore: Fix typo

15 months agochore: Add Andrew Stubbs to typos ignore list
Joel Rosdahl [Wed, 1 May 2024 08:36:13 +0000 (10:36 +0200)] 
chore: Add Andrew Stubbs to typos ignore list

15 months agochore: Remove unnecessary depend_extra_args
Joel Rosdahl [Sun, 28 Apr 2024 19:50:58 +0000 (21:50 +0200)] 
chore: Remove unnecessary depend_extra_args

The ordinary compiler_args list can be used for executing the compiler
in the depend mode since dependency arguments are present there after
07b55f13e119a2a35d166a73929643911ea69d52.

15 months agotest: Improve verbose printing of test names
Joel Rosdahl [Sat, 27 Apr 2024 16:20:15 +0000 (18:20 +0200)] 
test: Improve verbose printing of test names

15 months agofeat: Support -Xpreprocessor -fopenmp in direct mode
Joel Rosdahl [Sat, 27 Apr 2024 13:22:40 +0000 (15:22 +0200)] 
feat: Support -Xpreprocessor -fopenmp in direct mode

All uses of -Xpreprocessor disable the direct mode as a safety measure
since the command line could include things like

  -Xpreprocessor -MF -Xpreprocessor file.d

which ccache needs to understand as

  -MF file.d

Ideally, ccache should handle this in a generic way. Meanwhile, let's
allow it in the a special case of "-Xpreprocessor -fopenmp" since that's
required on macOS to enable OpenMP.

Closes #1434.

15 months agorefactor: fs::path-ify some functions
Joel Rosdahl [Sun, 14 Apr 2024 08:03:24 +0000 (10:03 +0200)] 
refactor: fs::path-ify some functions

Fixes #1417.

15 months agobump: Update to nonstd-span 0.11.0
Joel Rosdahl [Sat, 27 Apr 2024 08:56:59 +0000 (10:56 +0200)] 
bump: Update to nonstd-span 0.11.0

15 months agobump: Update to zstd 1.5.6
Joel Rosdahl [Sat, 27 Apr 2024 08:55:54 +0000 (10:55 +0200)] 
bump: Update to zstd 1.5.6

15 months agorefactor: Improve util::copy_file implementation
Joel Rosdahl [Fri, 26 Apr 2024 16:44:53 +0000 (18:44 +0200)] 
refactor: Improve util::copy_file implementation

- Merge macOS and POSIX implementations into one.
- Improve error messages.
- Improve variable names.

15 months agorefactor: Improve dependency file parsing
Joel Rosdahl [Thu, 25 Apr 2024 19:32:16 +0000 (21:32 +0200)] 
refactor: Improve dependency file parsing

- Use Depfile::tokenize to parse the dep file in rewrite_source_paths
  instead of an even more ad-hoc parser.
- Add Depfile::untokenize to go from tokens back to text representation.

15 months agoci: Improve MSYS2 job names
Joel Rosdahl [Fri, 19 Apr 2024 18:07:18 +0000 (20:07 +0200)] 
ci: Improve MSYS2 job names

15 months agobuild: Improve handling of dependencies (#1429)
Joel Rosdahl [Sat, 27 Apr 2024 08:30:18 +0000 (10:30 +0200)] 
build: Improve handling of dependencies (#1429)

- Introduced a new CMake variable called `DEPS` with the following
semantics:
- `AUTO` (the default): Use dependencies from the local system if
available. Otherwise: Use bundled dependencies if available. Otherwise:
Download dependencies from the internet (dependencies will then be
linked statically).
- `DOWNLOAD`: Use bundled dependencies if available. Otherwise: Download
recommended versions from the internet (dependencies will then be linked
statically).
- `LOCAL`: Use dependencies from the local system if available.
Otherwise: Use bundled dependencies if available.

The old `HIREDIS_FROM_INTERNET`, `ZSTD_FROM_INTERNET` and `OFFLINE`
variables have been removed in favor of `DEPS`.
- Streamlined the CMake code for hiredis and zstd.
- Removed bundled `getopt_long` implementation.

It seems likely that getopt_long is available on all platforms where
ccache is built nowadays, except Windows. Therefore, remove the bundled
getopt_long implementation for now.

If it turns out that somebody wants to compile ccache on a system that
lacks getopt_long we can add support specifying a system or downloaded
version.
- Implemented our own AVX2 runtime detection instead of using a blake3's
ditto. This opens up for using blake3 from the system.
- Added support for using blake3, httplib, nonstd/span and tl/expected
from the system instead of bundled versions.
- Removed bundled doctest, fmt and xxhash dependencies. Instead,
download them if missing.

Closes #1396.
Closes #1424.

15 months agobuild: Add support for using system blake3 1429/head
Joel Rosdahl [Sat, 30 Mar 2024 19:45:30 +0000 (20:45 +0100)] 
build: Add support for using system blake3

15 months agorefactor: Implement AVX2 runtime detection instead of using blake3's
Joel Rosdahl [Sat, 30 Mar 2024 09:02:27 +0000 (10:02 +0100)] 
refactor: Implement AVX2 runtime detection instead of using blake3's

15 months agobuild: Avoid bundling xxhash
Joel Rosdahl [Wed, 27 Mar 2024 19:33:07 +0000 (20:33 +0100)] 
build: Avoid bundling xxhash

Download xxhash if missing locally instead of using a bundled version.

15 months agobuild: Extract win32-compatibility stuff to a separate library
Joel Rosdahl [Wed, 27 Mar 2024 20:00:06 +0000 (21:00 +0100)] 
build: Extract win32-compatibility stuff to a separate library

15 months agobuild: Let blake3 be a separate target not depended on by third_party
Joel Rosdahl [Wed, 27 Mar 2024 19:02:50 +0000 (20:02 +0100)] 
build: Let blake3 be a separate target not depended on by third_party

15 months agobuild: Improve build of bundled cxxurl third party dependency
Joel Rosdahl [Sun, 24 Mar 2024 10:00:10 +0000 (11:00 +0100)] 
build: Improve build of bundled cxxurl third party dependency

15 months agobuild: Add support for using system tl-expected
Joel Rosdahl [Sat, 23 Mar 2024 20:00:03 +0000 (21:00 +0100)] 
build: Add support for using system tl-expected

15 months agobuild: Add support for using system nonstd-span
Joel Rosdahl [Fri, 22 Mar 2024 20:40:58 +0000 (21:40 +0100)] 
build: Add support for using system nonstd-span

15 months agobuild: Add support for using system cpp-httplib
Joel Rosdahl [Wed, 20 Mar 2024 20:45:10 +0000 (21:45 +0100)] 
build: Add support for using system cpp-httplib

15 months agobuild: Remove bundled getopt_long implementation
Joel Rosdahl [Sun, 17 Mar 2024 08:52:50 +0000 (09:52 +0100)] 
build: Remove bundled getopt_long implementation

It seems likely that getopt_long is available on all platforms where
ccache is built nowadays, except Windows. Therefore, remove the bundled
getopt_long implementation for now.

If it turns out that somebody wants to compile ccache on a system that
lacks getopt_long we can add support specifying a system or downloaded
version.

15 months agobuild: Avoid bundling fmt
Joel Rosdahl [Sun, 17 Mar 2024 08:32:59 +0000 (09:32 +0100)] 
build: Avoid bundling fmt

Download fmt if missing locally instead of using a bundled version.

15 months agobuild: Avoid bundling doctest
Joel Rosdahl [Mon, 11 Mar 2024 19:25:03 +0000 (20:25 +0100)] 
build: Avoid bundling doctest

Download doctest if missing locally instead of using a bundled version.

15 months agobuild: Add add_header_only_library function
Joel Rosdahl [Mon, 18 Mar 2024 19:54:28 +0000 (20:54 +0100)] 
build: Add add_header_only_library function

15 months agobuild: Improve handling of hiredis and zstd dependencies
Joel Rosdahl [Sun, 25 Feb 2024 09:35:07 +0000 (10:35 +0100)] 
build: Improve handling of hiredis and zstd dependencies

Introduced a new CMake variable called DEPS with the following
semantics:

- AUTO (the default): Use dependencies from the local system if
  available. Otherwise: Use bundled dependencies if available.
  Otherwise: Download dependencies from the internet (dependencies will
  then be linked statically).
- DOWNLOAD: Use bundled dependencies if available. Otherwise: Download
  recommended versions from the internet (dependencies will then be
  linked statically).
- LOCAL: Use dependencies from the local system if available. Otherwise:
  Use bundled dependencies if available.

The old {HIREDIS,ZSTD}_FROM_INTERNET and OFFLINE variables have been
removed in favor of DEPS.

Also streamlined the CMake code for hiredis and zstd.

15 months agoperf: Use native file copy on Windows (#1431)
Raihaan Shouhell [Fri, 26 Apr 2024 16:41:08 +0000 (00:41 +0800)] 
perf: Use native file copy on Windows (#1431)

Copyfile improvement for windows.

15 months agoci: Add Windows arm64 build (#1433)
Raihaan Shouhell [Mon, 22 Apr 2024 19:28:46 +0000 (03:28 +0800)] 
ci: Add Windows arm64 build (#1433)

Basic arm64 build for windows

15 months agoci: Update macOS images used (#1432)
Raihaan Shouhell [Mon, 15 Apr 2024 19:16:49 +0000 (03:16 +0800)] 
ci: Update macOS images used (#1432)

Updates macos images used. macOS-14 is M1 arm64. Macos11 has been
deprecated and will be removed in june

15 months agoperf: Use copyfile(3) on apple systems (#1430)
Raihaan Shouhell [Sun, 14 Apr 2024 07:48:44 +0000 (15:48 +0800)] 
perf: Use copyfile(3) on apple systems (#1430)

Use copyfile for more efficient copying on OSX.

15 months agofeat: Add sloppiness for .incbin handling (#1423)
Raihaan Shouhell [Sun, 14 Apr 2024 07:44:40 +0000 (15:44 +0800)] 
feat: Add sloppiness for .incbin handling (#1423)

Code to address some issues in #1421.

15 months agoperf: Use sendfile(2) for file copying (#1427)
Raihaan Shouhell [Sat, 13 Apr 2024 18:33:31 +0000 (02:33 +0800)] 
perf: Use sendfile(2) for file copying (#1427)

Use sendfile for file copying as it avoids copying the data to
user-space and back to kernel space.

15 months agobump: Upgrade to blake3 1.5.1 (#1428)
Raihaan Shouhell [Sat, 13 Apr 2024 18:14:46 +0000 (02:14 +0800)] 
bump: Upgrade to blake3 1.5.1 (#1428)

Update our dependencies

15 months agoci: Disable building test on macOS binaries (#1426)
Raihaan Shouhell [Sat, 13 Apr 2024 14:42:33 +0000 (22:42 +0800)] 
ci: Disable building test on macOS binaries (#1426)

We don't run the tests when building macOS universal binaries as it's
covered elsewhere so we can save some compile time by removing test
builds.

15 months agochore: Fix path to build-in-docker
Joel Rosdahl [Wed, 10 Apr 2024 16:30:16 +0000 (18:30 +0200)] 
chore: Fix path to build-in-docker

15 months agofeat: Clear manifest on recache
Joel Rosdahl [Tue, 9 Apr 2024 17:47:44 +0000 (19:47 +0200)] 
feat: Clear manifest on recache

If there are bad entries in the manifest it doesn't help to run with
recache if the new entry (resulting from the recached compilation)
already exists as an older entry in the manifest.

Improve this by not populating the manifest in recache mode.

15 months agochore: Suppress false positive typos
Joel Rosdahl [Sat, 6 Apr 2024 08:09:13 +0000 (10:09 +0200)] 
chore: Suppress false positive typos

15 months agochore: Sort list
Joel Rosdahl [Sat, 6 Apr 2024 08:08:51 +0000 (10:08 +0200)] 
chore: Sort list

16 months agotest: Don't leave fs_test.tmp* files after InodeCache unit tests
Joel Rosdahl [Mon, 1 Apr 2024 19:24:14 +0000 (21:24 +0200)] 
test: Don't leave fs_test.tmp* files after InodeCache unit tests

16 months agochore: Add fedora-40 dockerfile
Joel Rosdahl [Sat, 30 Mar 2024 19:16:58 +0000 (20:16 +0100)] 
chore: Add fedora-40 dockerfile

16 months agochore: Fix typo in LICENSE.adoc
Joel Rosdahl [Wed, 27 Mar 2024 20:06:48 +0000 (21:06 +0100)] 
chore: Fix typo in LICENSE.adoc

16 months agobuild: Move add_compile_flag_if_supported to Utils.cmake
Joel Rosdahl [Sun, 17 Mar 2024 18:13:27 +0000 (19:13 +0100)] 
build: Move add_compile_flag_if_supported to Utils.cmake

16 months agoci: Sort package list
Joel Rosdahl [Sun, 17 Mar 2024 15:01:39 +0000 (16:01 +0100)] 
ci: Sort package list

16 months agochore: Remove redundant copy of DEF_WRAP_1_R
Joel Rosdahl [Sun, 17 Mar 2024 20:38:34 +0000 (21:38 +0100)] 
chore: Remove redundant copy of DEF_WRAP_1_R

16 months agochore: Remove unsupported ubuntu-18.04 build from misc/test-all-systems
Joel Rosdahl [Sun, 17 Mar 2024 14:57:02 +0000 (15:57 +0100)] 
chore: Remove unsupported ubuntu-18.04 build from misc/test-all-systems

16 months agochore: Make it possible to run misc/build-in-docker from any directory
Joel Rosdahl [Sun, 17 Mar 2024 14:56:47 +0000 (15:56 +0100)] 
chore: Make it possible to run misc/build-in-docker from any directory

16 months agochore: Fix build parallelism in ci/build again
Joel Rosdahl [Sun, 17 Mar 2024 14:55:19 +0000 (15:55 +0100)] 
chore: Fix build parallelism in ci/build again

The -j option was removed in 39dcc7488159e6812292ecbd15a1ed25ade493a2,
but that means that builds using make will be serial. Thus add the
option again.

16 months agochore: Start docker containers with --init
Joel Rosdahl [Sun, 17 Mar 2024 14:37:11 +0000 (15:37 +0100)] 
chore: Start docker containers with --init

16 months agochore: Fix grammar
Joel Rosdahl [Sun, 17 Mar 2024 09:53:21 +0000 (10:53 +0100)] 
chore: Fix grammar

16 months agorefactor: Use {read,write}_file for MSYS2 code paths in LockFile
Joel Rosdahl [Sat, 23 Mar 2024 15:39:07 +0000 (16:39 +0100)] 
refactor: Use {read,write}_file for MSYS2 code paths in LockFile

16 months agoenhance: Implement O_EXCL mode for util::write_file
Joel Rosdahl [Sat, 23 Mar 2024 15:29:59 +0000 (16:29 +0100)] 
enhance: Implement O_EXCL mode for util::write_file

16 months agorefactor: Let util::read_file stat fd on POSIX as well
Joel Rosdahl [Sat, 23 Mar 2024 15:03:34 +0000 (16:03 +0100)] 
refactor: Let util::read_file stat fd on POSIX as well

16 months agoenhance: Teach DirEntry how to stat a file descriptor
Joel Rosdahl [Sat, 23 Mar 2024 15:02:13 +0000 (16:02 +0100)] 
enhance: Teach DirEntry how to stat a file descriptor

16 months agofix: Adapt util::LockFile to MSYS2 (#1416)
Kreijstal [Sat, 23 Mar 2024 15:07:49 +0000 (16:07 +0100)] 
fix: Adapt util::LockFile to MSYS2 (#1416)

MSYS2 will not let you create a symlink to a nonexistent file, only to
an already existing file. To overcome this issue we use files, and write
content on it.

For Cygwin/MSYS2, the patch leverages POSIX `open` with the flags
`O_WRONLY | O_CREAT | O_EXCL`, effectively creating an exclusive lock
file. As suggested by @jrosdahl , thank you so much for the suggestion.
This still does not pass the test suite, but makes ccache usable.

16 months agoperf: Optimize file reading on Windows (#1418)
Joel Rosdahl [Sat, 23 Mar 2024 11:54:45 +0000 (12:54 +0100)] 
perf: Optimize file reading on Windows (#1418)

Reading the file in do_hash_file as Bytes skips CRLF to LF conversion
and is therefore way faster.

Optimize read_file size_hint on Windows by getting the file size of the
existing handle instead of opening a duplicate one.

16 months agoOptimize read_file size_hint on Windows 1418/head
Clemens Wasser [Wed, 20 Mar 2024 12:40:58 +0000 (13:40 +0100)] 
Optimize read_file size_hint on Windows

16 months agoRead file in do_hash_file as Bytes
Clemens Wasser [Wed, 20 Mar 2024 12:40:31 +0000 (13:40 +0100)] 
Read file in do_hash_file as Bytes

16 months agofix: Don't use Windows lockfile implementation on MSYS2
Joel Rosdahl [Sun, 17 Mar 2024 14:57:36 +0000 (15:57 +0100)] 
fix: Don't use Windows lockfile implementation on MSYS2

This reverts commit c6a6e6accefe9e79601e56be5f7438cb593ff016, as
requested in #1415.

16 months agobuild: Use Windows BLAKE3 implementation on MSYS2
Joel Rosdahl [Sun, 17 Mar 2024 11:41:06 +0000 (12:41 +0100)] 
build: Use Windows BLAKE3 implementation on MSYS2

Related to issue #1415.

16 months agofix: Use Windows lockfile implementation on MSYS2
Joel Rosdahl [Sun, 17 Mar 2024 11:37:55 +0000 (12:37 +0100)] 
fix: Use Windows lockfile implementation on MSYS2

Likely fixes #1415.

16 months agofeat: Add knowledge about Xcode -ivfsstatcache option
Joel Rosdahl [Sat, 16 Mar 2024 20:55:41 +0000 (21:55 +0100)] 
feat: Add knowledge about Xcode -ivfsstatcache option

Closes #1414.

16 months agobuild: Move CMake configuration of dependencies to a separate file
Joel Rosdahl [Sun, 25 Feb 2024 09:34:02 +0000 (10:34 +0100)] 
build: Move CMake configuration of dependencies to a separate file

16 months agoci: Add CMake toolchain files for cross-compiling to Windows
Joel Rosdahl [Mon, 11 Mar 2024 19:24:36 +0000 (20:24 +0100)] 
ci: Add CMake toolchain files for cross-compiling to Windows

16 months agobuild: Remove obsolete CMake version check
Joel Rosdahl [Fri, 8 Mar 2024 19:43:53 +0000 (20:43 +0100)] 
build: Remove obsolete CMake version check

16 months agotest: Include unistd.h for getpid
Joel Rosdahl [Thu, 7 Mar 2024 20:53:07 +0000 (21:53 +0100)] 
test: Include unistd.h for getpid

16 months agofix: Reduce the risk of false positive direct mode hits
Joel Rosdahl [Sat, 16 Mar 2024 13:42:00 +0000 (14:42 +0100)] 
fix: Reduce the risk of false positive direct mode hits

To reduce the risk of getting a false positive hit when a directory
early in the include path now exists, record whether include directories
and similar input paths exist. Note that this is not 100% waterproof
since it only detects newly appearing directories and not newly
appearing header files.

16 months agochore: Improve source tree structure
Joel Rosdahl [Wed, 21 Feb 2024 21:03:43 +0000 (22:03 +0100)] 
chore: Improve source tree structure

In preparation for adding support for using dependencies from the system
in addition to bundled or downloaded dependencies, restructure the
source tree so that:

- Third party headers are included without a third_party/ prefix, e.g.
  #include <xxhash.h> instead of #include <third_party/xxhash.h>.
- Ccache headers are included with a ccache/ prefix, e.g. #include
  <ccache/util/string.hpp> instead of #include <util/string.hpp>.

This keeps ccache and other headers separated but in another way than
before.

16 months agochore: Remove internal tracing framework
Joel Rosdahl [Wed, 21 Feb 2024 20:20:58 +0000 (21:20 +0100)] 
chore: Remove internal tracing framework

The internal tracing calls enabled by ENABLE_TRACING work fine, but I
have found that I never use them or add tracepoints to new code, so in
reality they mostly contribute with dead weight. In an effort to reduce
the amount of dependencies, I have therefore decided to remove the trace
calls, including the bundled minitrace sources.

16 months agofix: Hash arguments that affect PCH result with MSVC /Yu
Thomas Ferrand [Wed, 6 Mar 2024 19:41:13 +0000 (20:41 +0100)] 
fix: Hash arguments that affect PCH result with MSVC /Yu

Fixes #1410.

17 months agofeat: Add -fprofile-update support (#1408)
Raihaan Shouhell [Sat, 2 Mar 2024 08:37:14 +0000 (16:37 +0800)] 
feat: Add -fprofile-update support (#1408)

17 months agofix: Allow nonexistent include files in preprocessor mode
Joel Rosdahl [Wed, 21 Feb 2024 19:25:03 +0000 (20:25 +0100)] 
fix: Allow nonexistent include files in preprocessor mode

After 43c3a44aadcb nonexistent include files found in the preprocessed
output would increment "Could not read or parse input file" and fall
back to just running the compiler. This made ccache not attempt
preprocessor mode for generated code with #line header referencing files
that can't be found, e.g. in an out-of-source build scenario.

Fix this by just disabling direct mode, restoring the pre-43c3a44aadcb
behavior in such cases.

Fixes #1406.

17 months agochore: Rename util/fmtmacros.hpp to util/format.hpp
Joel Rosdahl [Mon, 19 Feb 2024 19:26:12 +0000 (20:26 +0100)] 
chore: Rename util/fmtmacros.hpp to util/format.hpp

17 months agochore: Add missing #includes
Joel Rosdahl [Mon, 19 Feb 2024 19:10:02 +0000 (20:10 +0100)] 
chore: Add missing #includes

17 months agorefactor: Use util::Bytes::insert for span<const uint8_t>
Joel Rosdahl [Sun, 18 Feb 2024 08:43:34 +0000 (09:43 +0100)] 
refactor: Use util::Bytes::insert for span<const uint8_t>

17 months agoenhance: Add util::Bytes::insert for span<const uint8_t>
Joel Rosdahl [Sun, 18 Feb 2024 08:40:15 +0000 (09:40 +0100)] 
enhance: Add util::Bytes::insert for span<const uint8_t>

17 months agorefactor: Avoid raw fmt::format call in TextTable
Joel Rosdahl [Sun, 18 Feb 2024 08:33:36 +0000 (09:33 +0100)] 
refactor: Avoid raw fmt::format call in TextTable

17 months agochore: Clean up usage of #include in headers
Joel Rosdahl [Sat, 17 Feb 2024 08:46:41 +0000 (09:46 +0100)] 
chore: Clean up usage of #include in headers

17 months agochore: Tweak formatting and comments
Joel Rosdahl [Mon, 12 Feb 2024 20:35:15 +0000 (21:35 +0100)] 
chore: Tweak formatting and comments

17 months agoci: Add new compilers and update actions (#1402)
Raihaan Shouhell [Sun, 11 Feb 2024 17:21:18 +0000 (01:21 +0800)] 
ci: Add new compilers and update actions (#1402)

17 months agofeat: Add support for -fcallgraph-info (#1401)
Raihaan Shouhell [Sun, 11 Feb 2024 17:20:38 +0000 (01:20 +0800)] 
feat: Add support for -fcallgraph-info (#1401)

17 months agofix: Mark -fcallgraph-info as too hard
Joel Rosdahl [Sun, 11 Feb 2024 15:26:03 +0000 (16:26 +0100)] 
fix: Mark -fcallgraph-info as too hard

-fcallgraph-info generates a .ci file which ccache currently doesn't
know how to store and restore.

Fixes #1400.

17 months agofeat: Port the inode cache to Windows (#1388)
Thomas Ferrand [Sun, 11 Feb 2024 15:11:47 +0000 (16:11 +0100)] 
feat: Port the inode cache to Windows (#1388)

This PR ports the existing InodeCache to make it work under Windows.
This speeds up ccache a lot, both in the hit and miss cases, when a lot
of headers files are included in several compilation units. In our case
this makes the difference between ccache being worth using or not.

The logic of the InodeCache itself is unchanged. I introduced a
MemoryMap helper class that does the platform specific calls to
mmap/MapViewOfFile. Despite its generic name, I've implemented what was
needed for the InodeCache, it only supports mapping a file (no anonymous
mmap) in a shared fashion with read/write access.
Due to differences in behavior between unix and Windows regarding
unlinking a file that is opened, I am not convinced that it will work
correctly in every situation (for example if a process hold a bucket
lock for more than 5 seconds, the cache is dropped and recreated, under
Windows that won't work as the unlink will fail). That being said it
seems to work well enough when nothing unexpected happens.

I made a small change to the unit test because under Windows, we can't
open() a directory so instead I try to open a temp file in that
directory. After that change the unit tests pass unmodified.
For the bash based test, only the symbolic link test fails. This is
quite strange, when I try to run the test, the call to `ln -fs test1.c
test2.c` fails, but when run manually the same command succeeds. I tried
to run the test manually and it fails anyway but I haven't done anything
to fix it, this looks like more an issue from the DirEntry side than the
InodeCache side. Because of that I've left the bash based test disabled
for Windows, maybe we want to change that to only disable the symbolic
link test?

17 months agochore: Use brace initialization for integer literals
Joel Rosdahl [Sun, 11 Feb 2024 11:07:27 +0000 (12:07 +0100)] 
chore: Use brace initialization for integer literals

17 months agochore: Bail out on too large files on 32-bit systems
Joel Rosdahl [Sat, 10 Feb 2024 20:33:08 +0000 (21:33 +0100)] 
chore: Bail out on too large files on 32-bit systems

17 months agochore: Improve log messages for selected compression level
Joel Rosdahl [Sat, 10 Feb 2024 09:35:56 +0000 (10:35 +0100)] 
chore: Improve log messages for selected compression level

17 months agoperf: Avoid value initialization of data in util::Bytes
Joel Rosdahl [Sat, 10 Feb 2024 09:14:44 +0000 (10:14 +0100)] 
perf: Avoid value initialization of data in util::Bytes

17 months agofix: Fix reading of files larger than 2^31 bytes
Joel Rosdahl [Sat, 10 Feb 2024 08:54:19 +0000 (09:54 +0100)] 
fix: Fix reading of files larger than 2^31 bytes

For some kernels read(2) makes a short read for counts larger than 2^31,
even for files on 64-bit architectures. Other kernels seem to not like
large counts at all, returning a failure.

Fix this by limiting the read buffer to a smaller value. This also
removes a short read optimization which should have been removed in
cff3bf417420ea88fe53e7267ae2a356898ae326.

17 months agochore: Further improve /Tc and /Tp handling
Joel Rosdahl [Wed, 7 Feb 2024 20:09:02 +0000 (21:09 +0100)] 
chore: Further improve /Tc and /Tp handling

- Remember if /Tc or /Tp was used and prepend it to the source file sent
  to the preprocessor and compiler.
- Mark non-concatenated versions of /Tc and /Tp as too hard for now.

17 months agochore: Fix grammar in NEWS
Joel Rosdahl [Wed, 7 Feb 2024 16:47:51 +0000 (17:47 +0100)] 
chore: Fix grammar in NEWS

17 months agochore: Update NEWS
Joel Rosdahl [Mon, 5 Feb 2024 19:27:16 +0000 (20:27 +0100)] 
chore: Update NEWS

(cherry picked from commit ec510e9b0f333b8e97aee98108de3e0858340d59)

17 months agochore: Update copyright years
Joel Rosdahl [Mon, 5 Feb 2024 19:17:16 +0000 (20:17 +0100)] 
chore: Update copyright years

17 months agofix: Fix MSVC crash when using /Zi /Fddebug.pdb
Joel Rosdahl [Mon, 5 Feb 2024 18:51:49 +0000 (19:51 +0100)] 
fix: Fix MSVC crash when using /Zi /Fddebug.pdb

With /Zi, MSVC starts a long-lived mspdbsrv.exe background process. The
implementation of #1274 kills all processes created by ccache including
mspdbsrv.exe, which can make cl.exe crash with this error message:

    fatal error C1090: PDB API call failed, error code '23': (0x000006BA)

Fix this by setting JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK to only kill
the compiler and not processes that the compiler creates.

Fixes #1386 in a better way.