]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
4 years agoUse URL class for URL parsing 881/head
Gregor Jasny [Mon, 5 Jul 2021 20:08:46 +0000 (22:08 +0200)] 
Use URL class for URL parsing

4 years agoAdd CxxUrl v0.2
Gregor Jasny [Fri, 2 Jul 2021 11:39:46 +0000 (13:39 +0200)] 
Add CxxUrl v0.2

from https://github.com/chmike/CxxUrl

4 years agoGlobally define WIN32_LEAN_AND_MEAN (#882)
Gregor Jasny [Mon, 5 Jul 2021 18:20:46 +0000 (20:20 +0200)] 
Globally define WIN32_LEAN_AND_MEAN (#882)

4 years agoFix CMake feature detection (#883)
Gregor Jasny [Mon, 5 Jul 2021 18:18:18 +0000 (20:18 +0200)] 
Fix CMake feature detection (#883)

When enabling CMake policy
<https://cmake.org/cmake/help/latest/policy/CMP0067.html> by either enabling it
directly or via a `cmake_minimum_required` of `3.8` or later, the
`test.inode_cache` test starts to fail.

This happens because this policy slightly changes the `CheckCSourceCompiles`
logic by passing-in any configured C-standard. The detection of the following
features now report absence:

    --- CMakeCache-old.txt 2021-07-05 15:50:25.698278961 +0200
    +++ CMakeCache-new.txt 2021-07-05 15:50:54.626397301 +0200
    @@ -657,7 +657,7 @@
     //Have function pthread_mutexattr_setpshared
     HAVE_PTHREAD_MUTEXATTR_SETPSHARED:INTERNAL=1
     //Test HAVE_PTHREAD_MUTEX_ROBUST
    -HAVE_PTHREAD_MUTEX_ROBUST:INTERNAL=1
    +HAVE_PTHREAD_MUTEX_ROBUST:INTERNAL=
     //Have include pwd.h
     HAVE_PWD_H:INTERNAL=1
     //Have function realpath
    @@ -675,9 +675,9 @@
     //Test HAVE_STRUCT_STATFS_F_FSTYPENAME
     HAVE_STRUCT_STATFS_F_FSTYPENAME:INTERNAL=
     //Test HAVE_STRUCT_STAT_ST_CTIM
    -HAVE_STRUCT_STAT_ST_CTIM:INTERNAL=1
    +HAVE_STRUCT_STAT_ST_CTIM:INTERNAL=
     //Test HAVE_STRUCT_STAT_ST_MTIM
    -HAVE_STRUCT_STAT_ST_MTIM:INTERNAL=1
    +HAVE_STRUCT_STAT_ST_MTIM:INTERNAL=
     //Have function syslog
     HAVE_SYSLOG:INTERNAL=1
     //Have include syslog.h

In case of `HAVE_PTHREAD_MUTEX_ROBUST` the now passed-in `-std=c99` does not
enable the required `__USE_XOPEN2K` extension:

    #ifdef __USE_XOPEN2K
    /* Robust mutex or not flags.  */
    enum
    {
      PTHREAD_MUTEX_STALLED,
      PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
      PTHREAD_MUTEX_ROBUST,
      PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
    };
    #endif

To remedy the situation CMake now checks for those features within a C++
language context. In C++ those features seem to be available without enabling
any extra extensions.

It also makes the check more precise because all of the consumers are C++ (and
not C) compilation units.

4 years agoDon’t collapse empty lines in rewrite_stderr_to_absolute_paths
Joel Rosdahl [Mon, 5 Jul 2021 17:10:20 +0000 (19:10 +0200)] 
Don’t collapse empty lines in rewrite_stderr_to_absolute_paths

4 years agoDon’t collapse empty lines in Depfile::rewrite_paths
Joel Rosdahl [Mon, 5 Jul 2021 17:08:04 +0000 (19:08 +0200)] 
Don’t collapse empty lines in Depfile::rewrite_paths

4 years agoAdd mode parameter to split_into_* and Tokenizer
Joel Rosdahl [Mon, 5 Jul 2021 12:41:48 +0000 (14:41 +0200)] 
Add mode parameter to split_into_* and Tokenizer

4 years agoFix typo in Util::split_into_views doc string
Joel Rosdahl [Sun, 4 Jul 2021 16:45:14 +0000 (18:45 +0200)] 
Fix typo in Util::split_into_views doc string

4 years agoFix bug in debug_dir (CCACHE_DEBUGDIR)
Joel Rosdahl [Sun, 4 Jul 2021 05:13:02 +0000 (07:13 +0200)] 
Fix bug in debug_dir (CCACHE_DEBUGDIR)

The absolute path to the object file is not created correctly if the
object file doesn’t already exist.

4 years agoAdd util::to_absolute_path
Joel Rosdahl [Sun, 4 Jul 2021 05:12:53 +0000 (07:12 +0200)] 
Add util::to_absolute_path

4 years agoMove is_absolute_path to util
Joel Rosdahl [Sun, 4 Jul 2021 04:59:07 +0000 (06:59 +0200)] 
Move is_absolute_path to util

4 years agoAdd magic file for identifying ccache files (#880)
Anders Björklund [Sat, 3 Jul 2021 18:17:53 +0000 (20:17 +0200)] 
Add magic file for identifying ccache files (#880)

Useful when working with streams from server.

4 years agodoc: Mention “-” for standard input consistently
Joel Rosdahl [Sat, 3 Jul 2021 18:13:42 +0000 (20:13 +0200)] 
doc: Mention “-” for standard input consistently

4 years agoAdd integration test for stats_log
Joel Rosdahl [Fri, 2 Jul 2021 18:00:09 +0000 (20:00 +0200)] 
Add integration test for stats_log

4 years agoTweak stats_log documentation
Joel Rosdahl [Fri, 2 Jul 2021 17:59:03 +0000 (19:59 +0200)] 
Tweak stats_log documentation

4 years agoSimplify format_stats_log implementation
Joel Rosdahl [Fri, 2 Jul 2021 17:58:48 +0000 (19:58 +0200)] 
Simplify format_stats_log implementation

4 years agoAllow dumping stdin by giving - as path (#879)
Anders Björklund [Sat, 3 Jul 2021 18:10:36 +0000 (20:10 +0200)] 
Allow dumping stdin by giving - as path (#879)

Similar to other commands, such as tar.

4 years agoUse generator expression for ccache location (#878)
Gregor Jasny [Sat, 3 Jul 2021 18:03:34 +0000 (20:03 +0200)] 
Use generator expression for ccache location (#878)

With multi-config generators like Xcode the binary is stored
within an extra Debug / Release directory.

Tested with CMake 3.4.3

4 years agoMerge pull request #873 from gjasny/fix-appleclang-detection
Joel Rosdahl [Thu, 1 Jul 2021 18:51:40 +0000 (20:51 +0200)] 
Merge pull request #873 from gjasny/fix-appleclang-detection

4 years agoFix source file suffix selection for libblake3
Joel Rosdahl [Thu, 1 Jul 2021 06:34:54 +0000 (08:34 +0200)] 
Fix source file suffix selection for libblake3

In the add_source_if_enabled function in
src/third_party/blake3/CMakeLists.txt, the suffix variable is unset on a
CMake reconfigure in an already configured build tree. This makes CMake
guess the extension and always choose “.c” on a reconfigure.

Fix this by always setting the suffix variable.

4 years agoAllow one -Xarch_* option that matches -arch (#874)
Joel Rosdahl [Tue, 29 Jun 2021 18:09:49 +0000 (20:09 +0200)] 
Allow one -Xarch_* option that matches -arch (#874)

Closes #871.

4 years agoDefault to clang compiler on macOS 873/head
Gregor Jasny [Tue, 29 Jun 2021 09:45:10 +0000 (11:45 +0200)] 
Default to clang compiler on macOS

4 years agoFix Apple Clang detection
Gregor Jasny [Tue, 29 Jun 2021 09:42:50 +0000 (11:42 +0200)] 
Fix Apple Clang detection

Apple Clang, when called via `gcc` emits a `Configured with` line
on stderr which confuses the compiler detection. We just ignore
stderr for the `--version` query now.

4 years agoMark tests as skipped for unsupported compilers
Gregor Jasny [Tue, 29 Jun 2021 09:27:38 +0000 (11:27 +0200)] 
Mark tests as skipped for unsupported compilers

4 years agoSimplify header categorization rules
Joel Rosdahl [Tue, 29 Jun 2021 06:14:51 +0000 (08:14 +0200)] 
Simplify header categorization rules

4 years agoUse .clang-format regexes instead of comments to group system includes
Joel Rosdahl [Tue, 29 Jun 2021 05:42:21 +0000 (07:42 +0200)] 
Use .clang-format regexes instead of comments to group system includes

4 years agoDisable some clang-tidy checks that don’t contribute much
Joel Rosdahl [Mon, 28 Jun 2021 19:20:42 +0000 (21:20 +0200)] 
Disable some clang-tidy checks that don’t contribute much

4 years agoRemove unused function
Joel Rosdahl [Mon, 28 Jun 2021 05:18:47 +0000 (07:18 +0200)] 
Remove unused function

4 years agoImprove SecondaryStorage comments
Joel Rosdahl [Mon, 28 Jun 2021 05:18:12 +0000 (07:18 +0200)] 
Improve SecondaryStorage comments

4 years agoInclude $PWD in hash for -fprofile-generate with relative directory
Joel Rosdahl [Sun, 27 Jun 2021 18:34:06 +0000 (20:34 +0200)] 
Include $PWD in hash for -fprofile-generate with relative directory

For a relative profile directory D, GCC stores $PWD/D as part of the
profile filename in an object file generated with -fprofile-generate, so
we need to include the same information in the hash.

Fixes #872.

4 years agoAdd secondary file storage backend
Joel Rosdahl [Wed, 23 Jun 2021 14:29:15 +0000 (16:29 +0200)] 
Add secondary file storage backend

Closes #857.

4 years agoImplement configurations, API and framework for secondary storage
Joel Rosdahl [Wed, 23 Jun 2021 14:27:51 +0000 (16:27 +0200)] 
Implement configurations, API and framework for secondary storage

This introduces the possibility to add one or several secondary storage
backends to query after the primary cache storage. Note that cache
statistics counters will still be kept in the primary cache directory --
secondary storage backends only store cache results and manifests.

The API should now be ready enough to implement secondary storage
backends.

The framework is also ready enough for usage, but lacks two major things
that are still to be implemented:

1. Improved statistics handling. Up until now, ccache always increments
   exactly one statistics counter for each invocation (e.g. “hit”,
   “miss” or “some error”). Since I want to have separate statistics for
   primary and secondary storage, this model no longer works since an
   invocation can result in both a “primary miss” and a “secondary hit”.

2. Improved PrimaryStorage interface. The SecondaryStorage interface
   works with memory data, but PrimaryStorage, Result and Manifest still
   work with files at the API level. This means that if an invocation is
   a primary storage miss but a secondary storage hit, the data from
   secondary storage has to be written to a temporary file only to be
   read back into memory again by the Result/Manifest deserialization
   code.

Closes #855.
Closes #856.

4 years agoImprove parsing of umask values
Joel Rosdahl [Fri, 25 Jun 2021 13:06:10 +0000 (15:06 +0200)] 
Improve parsing of umask values

4 years agoAdd base parameter to Util::parse_unsigned
Joel Rosdahl [Fri, 25 Jun 2021 16:59:27 +0000 (18:59 +0200)] 
Add base parameter to Util::parse_unsigned

4 years agoCorrect documentation of Util::unlink_safe
Joel Rosdahl [Tue, 22 Jun 2021 17:27:14 +0000 (19:27 +0200)] 
Correct documentation of Util::unlink_safe

4 years agoAdd util::percent_decode
Joel Rosdahl [Mon, 21 Jun 2021 18:38:49 +0000 (20:38 +0200)] 
Add util::percent_decode

4 years agoAdd util::split_once
Joel Rosdahl [Mon, 21 Jun 2021 06:20:44 +0000 (08:20 +0200)] 
Add util::split_once

4 years agoRefactor main primary storage backend code into storage/primary
Joel Rosdahl [Tue, 15 Jun 2021 19:13:10 +0000 (21:13 +0200)] 
Refactor main primary storage backend code into storage/primary

This is the code that deals with retrieving and storing cache entries.

4 years agoRefactor config and context setup
Joel Rosdahl [Sun, 20 Jun 2021 13:36:33 +0000 (15:36 +0200)] 
Refactor config and context setup

4 years agoRemove now superfluous std::make_unique shim
Joel Rosdahl [Sun, 20 Jun 2021 17:48:49 +0000 (19:48 +0200)] 
Remove now superfluous std::make_unique shim

4 years agoAdd Tokenizer class
Joel Rosdahl [Wed, 15 Apr 2020 19:33:58 +0000 (21:33 +0200)] 
Add Tokenizer class

The class behaves like a collection and can be used in a range-based for
loop.

4 years agoRevise include file order to work with new directory structure
Joel Rosdahl [Fri, 25 Jun 2021 11:52:18 +0000 (13:52 +0200)] 
Revise include file order to work with new directory structure

4 years agoRemove superfluous context instance in test case
Joel Rosdahl [Sat, 19 Jun 2021 18:50:58 +0000 (20:50 +0200)] 
Remove superfluous context instance in test case

4 years agoUse single command line arg for /FI (#869)
Michael Kruse [Sun, 20 Jun 2021 19:20:40 +0000 (14:20 -0500)] 
Use single command line arg for /FI (#869)

CMake seems to interpret /FI and its argument as two separate options.
For instance, CMake de-duplicates arguments, leading any to non-first
/FI flag to be removed. This might be the reason why the option is not
honored with Visual Studio 16.10.2 / CMake 3.20.3.

Fix by combining /FI and its argument into a single command line option.

4 years agoAdd sloppy include_file_mtime to ivfsoverlay test (#868)
Michael Kruse [Sun, 20 Jun 2021 19:19:52 +0000 (14:19 -0500)] 
Add sloppy include_file_mtime to ivfsoverlay test (#868)

Add CCACHE_SLOPPINESS=include_file_mtime to ivfsoverlay test. This is
possibly due to me using my self-compiled clang since it does not fail
with the version of Clang that comes with Ubuntu 20.04.

4 years agoSkip nvcc_ldir test with non-working nvcc (#867)
Michael Kruse [Sun, 20 Jun 2021 19:19:20 +0000 (14:19 -0500)] 
Skip nvcc_ldir test with non-working nvcc (#867)

Add detection to nvcc_ldir of whether nvcc works with chosen host
compiler. For instance, nvcc aborts with

    #error -- unsupported clang version! clang version must be less than 9 and greater than 3.2

if the version of clang (or gcc) is too new. The test should be skipped in
this case.

4 years agoUse some generic lambda expressions
Joel Rosdahl [Fri, 18 Jun 2021 19:09:12 +0000 (21:09 +0200)] 
Use some generic lambda expressions

4 years agoRequire C++14-compatible compiler to build ccache
Joel Rosdahl [Fri, 18 Jun 2021 18:47:17 +0000 (20:47 +0200)] 
Require C++14-compatible compiler to build ccache

Ccache 4.0 introduced a requirement on a C++11-compatible compiler. The
language version was primarily chosen to support CentOS 7.

The time has now come to bump to C++14, to among other things get access
to generic lambda expressions and improved constexpr functions. Another
side effect is to get usable support for std::regex due to requiring a
newer GCC than 4.8 which lacks such support.

4 years agoRemove Ubuntu 16.04/Clang 3.8 build
Joel Rosdahl [Sat, 19 Jun 2021 14:38:48 +0000 (16:38 +0200)] 
Remove Ubuntu 16.04/Clang 3.8 build

It no longer works.

4 years agoExplicitly select C++ when using -fcxx-modules (#861)
r-burns [Thu, 17 Jun 2021 18:16:52 +0000 (11:16 -0700)] 
Explicitly select C++ when using -fcxx-modules (#861)

Typically, clang is able to auto-detect C++ files and switch to C++
mode, even when `argv[0]` is simply `clang` (without the `++`).

However, Nixpkgs provides `clang` as a wrapper script over the
underlying compiler binary, and only enables C++ standard library
include paths when it thinks it's being invoked as a C++ compiler:

https://github.com/NixOS/nixpkgs/blob/961cae37edeb34b5dec8060e49e5abbde3af9c00/pkgs/build-support/cc-wrapper/cc-wrapper.sh#L28

https://github.com/NixOS/nixpkgs/blob/961cae37edeb34b5dec8060e49e5abbde3af9c00/pkgs/build-support/cc-wrapper/cc-wrapper.sh#L54-L55

https://github.com/NixOS/nixpkgs/blob/961cae37edeb34b5dec8060e49e5abbde3af9c00/pkgs/build-support/cc-wrapper/cc-wrapper.sh#L135-L138

So for the benefit of less clever compiler toolchains which
can't always see that these invocations are using C++ mode,
we explicitly specify `-x c++` so they do the right thing.

4 years agoIgnore CLion files (#862)
Gregor Jasny [Thu, 17 Jun 2021 17:50:59 +0000 (19:50 +0200)] 
Ignore CLion files (#862)

4 years agoDon’t crash on relative PWD value
Joel Rosdahl [Wed, 16 Jun 2021 16:19:04 +0000 (18:19 +0200)] 
Don’t crash on relative PWD value

Even though PWD “shall represent an absolute pathname of the current
working directory”[1], we shouldn’t crash if a user sets it to a
relative path.

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03

Fixes #860.

4 years agoImprove architecture document
Joel Rosdahl [Wed, 16 Jun 2021 12:44:55 +0000 (14:44 +0200)] 
Improve architecture document

- framework -> core
- Describe source code directories in a section of their own.

4 years agoAdd stats log file, logging input file and result (#854)
Anders Björklund [Tue, 15 Jun 2021 19:21:35 +0000 (21:21 +0200)] 
Add stats log file, logging input file and result (#854)

4 years agoDocument the plan of changing naming conventions for namespaces
Joel Rosdahl [Tue, 15 Jun 2021 19:02:29 +0000 (21:02 +0200)] 
Document the plan of changing naming conventions for namespaces

Namespaces are from now on planned to be in snake_case instead of
UpperCamelCase. This is of course entirely due to cosmetical reasons,
but I feel that it maps better to the upcoming changes in directory
structure where I don’t want camel-case directory names.

4 years agoDocument the new directory structure plan
Joel Rosdahl [Tue, 15 Jun 2021 18:53:15 +0000 (20:53 +0200)] 
Document the new directory structure plan

See also #660 and #753.

4 years agoRemove now mostly obsolete note about transitioning to C++
Joel Rosdahl [Tue, 15 Jun 2021 18:20:01 +0000 (20:20 +0200)] 
Remove now mostly obsolete note about transitioning to C++

4 years agoTest Clang 11 in CI
Joel Rosdahl [Tue, 15 Jun 2021 05:50:01 +0000 (07:50 +0200)] 
Test Clang 11 in CI

4 years agoRemove Ubuntu 16.04 from CI
Joel Rosdahl [Tue, 15 Jun 2021 05:44:34 +0000 (07:44 +0200)] 
Remove Ubuntu 16.04 from CI

Ubuntu 16.04 has reached end of life already and GitHub Actions will
drop support for it soon anyway.

4 years agoRefactor away Result::Writer knowledge about counter_updates
Joel Rosdahl [Sun, 13 Jun 2021 18:41:32 +0000 (20:41 +0200)] 
Refactor away Result::Writer knowledge about counter_updates

4 years agoAdd nonstd::expected 0.5.0
Joel Rosdahl [Sun, 13 Jun 2021 18:21:05 +0000 (20:21 +0200)] 
Add nonstd::expected 0.5.0

4 years agoSilence stray printout from "-P -c" test case
Joel Rosdahl [Sun, 13 Jun 2021 18:43:03 +0000 (20:43 +0200)] 
Silence stray printout from "-P -c" test case

4 years agoAdd missing MTR_BEGIN call for file/file_put
Joel Rosdahl [Sat, 12 Jun 2021 08:13:06 +0000 (10:13 +0200)] 
Add missing MTR_BEGIN call for file/file_put

4 years agodoc: Switch to common AsciiDoc heading syntax
Joel Rosdahl [Mon, 7 Jun 2021 18:29:16 +0000 (20:29 +0200)] 
doc: Switch to common AsciiDoc heading syntax

4 years agoInclude config.h via command line instead of via system.h
Joel Rosdahl [Sun, 30 May 2021 18:40:35 +0000 (20:40 +0200)] 
Include config.h via command line instead of via system.h

This makes the definitions in config.h available to all source code,
including third_party_lib. It’s also a first step towards not having to
include system.hpp and its libc headers from all files.

4 years agoImprove defines for third_party_lib
Joel Rosdahl [Sun, 30 May 2021 18:20:07 +0000 (20:20 +0200)] 
Improve defines for third_party_lib

- Don’t filter out useful warnings like warning about implicit function
  declarations.
- Apply definitions in config.h to third party source code instead of
  passing feature defines as a special case.

4 years agoEnable minitrace tracing and stop it from crashing (#852)
Anders Björklund [Sun, 30 May 2021 18:18:58 +0000 (20:18 +0200)] 
Enable minitrace tracing and stop it from crashing (#852)

Need to make sure to pass the -DMTR_ENABLED also when compiling
the library and not only in the ccache internal config.h file.

When setting a standard (like C99), also need to define features.
The "strdup" function requires macro: _POSIX_C_SOURCE >= 200809L

4 years agoAdd support for clang's --config option (#850)
Tom Stellard [Sun, 23 May 2021 12:28:15 +0000 (08:28 -0400)] 
Add support for clang's --config option (#850)

This is more or less equivalent to gcc's --specs option except that the
contents of the file have different syntaxes.

4 years agoUpgrade to zstd 1.5.0
Joel Rosdahl [Fri, 14 May 2021 18:11:23 +0000 (20:11 +0200)] 
Upgrade to zstd 1.5.0

4 years agoFix typo in NEWS
Joel Rosdahl [Sun, 9 May 2021 18:49:42 +0000 (20:49 +0200)] 
Fix typo in NEWS

4 years agoFix typo in NEWS
Joel Rosdahl [Sun, 9 May 2021 18:48:38 +0000 (20:48 +0200)] 
Fix typo in NEWS

4 years agoUpdate NEWS v4.3
Joel Rosdahl [Sun, 9 May 2021 18:39:46 +0000 (20:39 +0200)] 
Update NEWS

4 years agoRe-add clang-format off/on for formatting bug
Joel Rosdahl [Sun, 9 May 2021 18:39:15 +0000 (20:39 +0200)] 
Re-add clang-format off/on for formatting bug

4 years agoImprove checksumming of downloaded clang-format binary
Joel Rosdahl [Sun, 9 May 2021 18:35:06 +0000 (20:35 +0200)] 
Improve checksumming of downloaded clang-format binary

4 years agoUpdate authors
Joel Rosdahl [Sun, 9 May 2021 13:15:28 +0000 (15:15 +0200)] 
Update authors

4 years agoUpdate .mailmap
Joel Rosdahl [Sun, 9 May 2021 13:15:15 +0000 (15:15 +0200)] 
Update .mailmap

4 years agoFix documentation of ivfsoverlay sloppiness
Joel Rosdahl [Sun, 9 May 2021 11:59:17 +0000 (13:59 +0200)] 
Fix documentation of ivfsoverlay sloppiness

4 years agoQuote CMake variables expansions in `CIBuildType.cmake`
Joel Rosdahl [Sun, 9 May 2021 10:49:09 +0000 (12:49 +0200)] 
Quote CMake variables expansions in `CIBuildType.cmake`

This avoids CMake errors when `${CMAKE_C_FLAGS_CI}` or
`${CMAKE_CXX_FLAGS_CI}` expands to the empty string.

Fixes #846.

4 years agoTweak comment
Joel Rosdahl [Sat, 8 May 2021 17:14:13 +0000 (19:14 +0200)] 
Tweak comment

4 years agoRevert "ci: Fix build on Ubuntu 16.04"
Joel Rosdahl [Sat, 8 May 2021 15:42:04 +0000 (17:42 +0200)] 
Revert "ci: Fix build on Ubuntu 16.04"

This reverts commit aa7fd27609bea5ec78fd85afaec297d028119ee0.

GitLab has apparently reverted its changes to the Ubuntu 16.04
environment again.

4 years agoInclude object path in input hash for -fprofile-arcs (--coverage)
Joel Rosdahl [Sat, 8 May 2021 14:47:22 +0000 (16:47 +0200)] 
Include object path in input hash for -fprofile-arcs (--coverage)

The object file contains a .gcda path based on the object file path.

Fixes #845.

4 years agoImprove comment
Joel Rosdahl [Sat, 8 May 2021 14:46:56 +0000 (16:46 +0200)] 
Improve comment

4 years agosource formatting: Don’t bin pack constructor initializer lists
Joel Rosdahl [Mon, 3 May 2021 17:08:56 +0000 (19:08 +0200)] 
source formatting: Don’t bin pack constructor initializer lists

4 years agoSupport `-specs file.specs` and `--specs file.specs` (#843)
Josh Triplett [Mon, 3 May 2021 17:00:19 +0000 (10:00 -0700)] 
Support `-specs file.specs` and `--specs file.specs` (#843)

* Support `-specs file.specs` and `--specs file.specs`

ccache currently supports specs files supplied via `-specs=file.specs`
and `--specs=file.specs`, but using a space instead of an `=` will cause
ccache to error out on the subsequent .specs file with
"unsupported source language".

Add support for `-specs file.specs` and `--specs file.specs`.

4 years agoCMake: make build of documentation optional (#842)
Petr Štetiar [Mon, 3 May 2021 16:44:53 +0000 (18:44 +0200)] 
CMake: make build of documentation optional (#842)

So we don't need to support corner cases as for example one fixed in
commit f6202db308e3 ("doc/MANUAL.adoc: Don't use non-ASCII quotes
(#761)") when the documentation is actually not needed at all as ccache
is used as a build tool only.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoFix detection of pthread features (#840)
Olle Liljenzin [Wed, 28 Apr 2021 18:22:53 +0000 (20:22 +0200)] 
Fix detection of pthread features (#840)

Add the -pthread flag to the compiler when building the test
program. Otherwise the compiler will build with wrong defines.

Fixes failing unit tests in Ubuntu 18.04.

4 years agoIgnore -ivfsoverlay parameter (#839)
Yoshimasa Niwa [Wed, 28 Apr 2021 18:20:35 +0000 (11:20 -0700)] 
Ignore -ivfsoverlay parameter (#839)

Co-authored-by: Peter Steinberger <steipete@gmail.com>
4 years agoci: Fix build on Ubuntu 16.04
Joel Rosdahl [Tue, 27 Apr 2021 20:04:58 +0000 (22:04 +0200)] 
ci: Fix build on Ubuntu 16.04

For some reason libzstd1-dev now has broken dependencies in GitLab’s
Ubuntu 16.04 environment. Fix this by installing libzstd-dev instead.

See also 59202ffbe57cc81679c02abafd2222819e4bde41.

4 years agoFix AsciiDoc markup in NEWS
Joel Rosdahl [Wed, 21 Apr 2021 19:18:38 +0000 (21:18 +0200)] 
Fix AsciiDoc markup in NEWS

4 years agoCanonicalize header path earlier to improve performance (#838)
binli71 [Sat, 17 Apr 2021 09:11:58 +0000 (05:11 -0400)] 
Canonicalize header path earlier to improve performance (#838)

The ctx.included_files.find(path) check was done before removing the "./" prefix
from the path, leading to decreased performance for such headers since the check
would always fail for such paths.

4 years agoImprove statistics for “-P -E”
Joel Rosdahl [Tue, 13 Apr 2021 06:45:09 +0000 (08:45 +0200)] 
Improve statistics for “-P -E”

“-P” is currently considered too hard, so when it’s used in conjunction
with “-E” the “unsupported compiler option” statistics counter is
increased since “-P” is found before “-E” on the command line.

Improve this by not passing “-P” to the preprocessor so that’s it’s in
effect supported. “-P -E” will then instead bail out on “-E”, increasing
“called for preprocessing” instead.

Closes #812.

4 years agoDisable split-dwarf code paths when outputting to /dev/null
Joel Rosdahl [Mon, 5 Apr 2021 17:12:10 +0000 (19:12 +0200)] 
Disable split-dwarf code paths when outputting to /dev/null

This avoids an attempt to delete /dev/null.dwo, which is harmless but
apparently flagged by the sandboxing feature of Gentoo’s build system.

Fixes #833.

4 years agoUse Clang-Format executable from muttleyxd/clang-tools-static-binaries
Joel Rosdahl [Mon, 5 Apr 2021 11:19:19 +0000 (13:19 +0200)] 
Use Clang-Format executable from muttleyxd/clang-tools-static-binaries

misc/format-files now executes misc/clang-format, which works like this:

1. If environment variable CLANG_FORMAT is set, execute $CLANG_FORMAT.
2. Otherwise, if <ccache-top-dir>/misc/.clang-format-exe exists, execute
   that program.
3. Otherwise, download a statically linked clang-format executable,
   verify its integrity, place it in
   <ccache-top-dir>/misc/.clang-format-exe and execute it.

This makes it possible for us to lock Clang-Format to version 10 and
remove most “// clang-format off/on” comments.

4 years agoMerge pull request #832 from nickhutchinson/win-stat-pending-delete
Joel Rosdahl [Mon, 5 Apr 2021 08:43:19 +0000 (10:43 +0200)] 
Merge pull request #832 from nickhutchinson/win-stat-pending-delete

4 years agoStat: treat pending deletes as missing files on Windows 832/head
Nicholas Hutchinson [Sun, 4 Apr 2021 15:44:43 +0000 (16:44 +0100)] 
Stat: treat pending deletes as missing files on Windows

Win32 functions like `CreateFile` return `ERROR_ACCESS_DENIED` when a
file is in the process of being deleted, which gets mapped to an errno
of `EACCES`. For the purposes of `Stat::stat` and `Stat::lstat`, it's
more useful to treat this as a missing file and mapping this to an errno
of `ENOENT`.

4 years agoFix clang-tidy job
Nicholas Hutchinson [Sun, 4 Apr 2021 16:01:19 +0000 (17:01 +0100)] 
Fix clang-tidy job

Explicitly specify versions of clang, clang++ and clang-tidy so we don't
run with mismatched versions.

GitHub seems to have recently bumped the version of clang installed in
its Ubuntu 18.04 runners to version 9, and aliased it to
`/usr/bin/clang` / `/usr/bin/clang++`. But running `apt-get install
clang-tidy` would install an older version of clang-tidy from LLVM _6.0_
at `/usr/bin/clang-tidy`.

See: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md

4 years agoPrepare for v4.2.1 v4.2.1
Joel Rosdahl [Sat, 27 Mar 2021 18:41:08 +0000 (19:41 +0100)] 
Prepare for v4.2.1

4 years agoUpdate authors
Joel Rosdahl [Sat, 27 Mar 2021 18:30:13 +0000 (19:30 +0100)] 
Update authors

4 years agoSimplify linker probing
Joel Rosdahl [Sat, 27 Mar 2021 17:30:54 +0000 (18:30 +0100)] 
Simplify linker probing

4 years agoFix probing of faster linker when cross compiling
Joel Rosdahl [Sat, 27 Mar 2021 15:10:31 +0000 (16:10 +0100)] 
Fix probing of faster linker when cross compiling