]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
4 years agoDetect errors in fmt::format format strings at compile time
Joel Rosdahl [Thu, 22 Oct 2020 17:30:41 +0000 (19:30 +0200)] 
Detect errors in fmt::format format strings at compile time

See also 4413d842e23c6fa52ec411951a4ab442f42227de.

4 years agoDetect errors in fmt::print format strings at compile time
Joel Rosdahl [Thu, 22 Oct 2020 17:12:51 +0000 (19:12 +0200)] 
Detect errors in fmt::print format strings at compile time

See also 4413d842e23c6fa52ec411951a4ab442f42227de.

4 years agoDetect errors in log strings at compile time
Joel Rosdahl [Tue, 20 Oct 2020 18:49:50 +0000 (20:49 +0200)] 
Detect errors in log strings at compile time

fmtlib can detect format string errors at compile time if (1) applying
FMT_STRING to the format string literal and (2) compiling for C++14 or
higher.

Requirement 1 is implemented by introducing a LOG macro which applies
FMT_STRING to the first argument and calls Logging::log (if logging is
enabled). Also added are a companion LOG_RAW macro (since C++11 requires
at least one argument for the “...” part in variadic macros) and a
BULK_LOG macro which calls Logging::bulk_log (if logging is enabled).

Requirement 2 is implemented by setting CMAKE_CXX_STANDARD to 14 for one
CI build with a known C++14-capable compiler. We can’t set it to 14 by
default since we still want the code to be buildable with C++11
compilers.

This will catch errors such as the one fixed by PR #691.

4 years agoFail gracefully on ancient compilers (#702)
Alexander Lanin [Fri, 23 Oct 2020 13:30:54 +0000 (15:30 +0200)] 
Fail gracefully on ancient compilers (#702)

4 years agoFix order of commands in third_party CMakeLists.txt (#699)
Alexander Lanin [Thu, 22 Oct 2020 20:25:32 +0000 (22:25 +0200)] 
Fix order of commands in third_party CMakeLists.txt (#699)

4 years agoRefer to the platform-compiler-language-support page in INSTALL.md
Joel Rosdahl [Thu, 22 Oct 2020 18:01:21 +0000 (20:01 +0200)] 
Refer to the platform-compiler-language-support page in INSTALL.md

As mentioned in #695.

4 years agoRequire CLONE_NOOWNERCOPY to be defined for clone on mac (#694)
Erik Flodin [Thu, 22 Oct 2020 17:52:36 +0000 (19:52 +0200)] 
Require CLONE_NOOWNERCOPY to be defined for clone on mac (#694)

Fixes #688.

4 years agoUse BLAKE3 machinery for detecting AVX2 support (#696)
Erik Flodin [Thu, 22 Oct 2020 17:51:36 +0000 (19:51 +0200)] 
Use BLAKE3 machinery for detecting AVX2 support (#696)

* Use BLAKE3 machinery for detecting AVX2 support

Instead of relying on the sometimes broken __builtin_cpu_support. See
discussion in #689.

* Require GCC >= 5.0 to enable AVX2 support

On e.g. GCC 4.8.5 the build fails with:
error: ‘__m256i’ does not name a type

4 years agoBLAKE3: Use C version on ancient Clang (#692)
Alexander Lanin [Thu, 22 Oct 2020 17:41:52 +0000 (19:41 +0200)] 
BLAKE3: Use C version on ancient Clang (#692)

4 years agoAdd missing parameters to log() call (#691)
Erik Flodin [Tue, 20 Oct 2020 18:27:12 +0000 (20:27 +0200)] 
Add missing parameters to log() call (#691)

4 years agoSupport ccache ccache gcc (#687)
Alexander Lanin [Tue, 20 Oct 2020 07:00:17 +0000 (09:00 +0200)] 
Support ccache ccache gcc (#687)

4 years agoFix badly named man page filename (Ccache.1 instead of ccache.1)
Joel Rosdahl [Mon, 19 Oct 2020 19:53:21 +0000 (21:53 +0200)] 
Fix badly named man page filename (Ccache.1 instead of ccache.1)

Apparently a2x deduces the man page name from the name section and there
is no way to specify another name.

Regression in a684bb356c9f0d6154f19ecefcc348167b975e5c.

Partial fix of #684.

4 years agoUse CMake A2X_EXE variable instead of hardcoded a2x
Joel Rosdahl [Mon, 19 Oct 2020 17:56:54 +0000 (19:56 +0200)] 
Use CMake A2X_EXE variable instead of hardcoded a2x

4 years agoPrepare for v4.0 v4.0
Joel Rosdahl [Sun, 18 Oct 2020 18:12:56 +0000 (20:12 +0200)] 
Prepare for v4.0

4 years agoUpdate authors
Joel Rosdahl [Sun, 18 Oct 2020 18:12:48 +0000 (20:12 +0200)] 
Update authors

4 years agoRemove apparently unnecessary ::add-path command
Joel Rosdahl [Thu, 15 Oct 2020 19:24:22 +0000 (21:24 +0200)] 
Remove apparently unnecessary ::add-path command

4 years agoUse $GITHUB_PATH to set PATH from install-cuda
Joel Rosdahl [Thu, 15 Oct 2020 19:11:28 +0000 (21:11 +0200)] 
Use $GITHUB_PATH to set PATH from install-cuda

The ::set-env command is deprecated according to
<https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/>.

4 years agoRun cross-compiled 64-bit MinGW unit tests in Wine
Joel Rosdahl [Thu, 15 Oct 2020 18:52:48 +0000 (20:52 +0200)] 
Run cross-compiled 64-bit MinGW unit tests in Wine

4 years agoAdd codespell build job
Joel Rosdahl [Wed, 14 Oct 2020 18:06:28 +0000 (20:06 +0200)] 
Add codespell build job

4 years agoImprove NEWS
Joel Rosdahl [Tue, 13 Oct 2020 18:13:40 +0000 (20:13 +0200)] 
Improve NEWS

4 years agoAdd “Compatibility with older versions” section to NEWS
Joel Rosdahl [Mon, 12 Oct 2020 19:17:41 +0000 (21:17 +0200)] 
Add “Compatibility with older versions” section to NEWS

4 years agoHash variables that may affect the compilation
Joel Rosdahl [Mon, 12 Oct 2020 17:11:10 +0000 (19:11 +0200)] 
Hash variables that may affect the compilation

As mentioned in #662.

4 years agoRefactor logical expression in find_compiler
Joel Rosdahl [Sun, 11 Oct 2020 12:39:34 +0000 (14:39 +0200)] 
Refactor logical expression in find_compiler

4 years agoFix expect_perm to work with SELinux (#681)
Olle Liljenzin [Mon, 12 Oct 2020 18:53:02 +0000 (20:53 +0200)] 
Fix expect_perm to work with SELinux (#681)

Test case CCACHE_UMASK fails when running it in an SELinux context because
/bin/ls adds a trailing dot to the output. Thus truncate the output to expected
length.

4 years agoUpdate NEWS
Joel Rosdahl [Sat, 10 Oct 2020 18:11:09 +0000 (20:11 +0200)] 
Update NEWS

4 years agoRemove -lgcov from profiling tests (#679)
Chris Burr [Sat, 10 Oct 2020 18:00:19 +0000 (20:00 +0200)] 
Remove -lgcov from profiling tests (#679)

This fixes an issue when running the test suite with a Clang installation
without a GCC installation since libgcov then isn't found.

(cherry picked from commit 9e128bfeb9a5050231a41e357729645c5a99fc2e)

4 years agotest: Verify masquerading when executed as an absolute path
Joel Rosdahl [Sat, 10 Oct 2020 17:35:30 +0000 (19:35 +0200)] 
test: Verify masquerading when executed as an absolute path

As discussed in #664.

4 years agotest: Remove now unnecessary setting of CCACHE_COMPILE
Joel Rosdahl [Sat, 10 Oct 2020 17:33:25 +0000 (19:33 +0200)] 
test: Remove now unnecessary setting of CCACHE_COMPILE

4 years agotest: Improve masquerading suite probe
Joel Rosdahl [Sat, 10 Oct 2020 17:33:07 +0000 (19:33 +0200)] 
test: Improve masquerading suite probe

4 years agotest: Publish and use COMPILER_BIN and COMPILER_ARGS
Joel Rosdahl [Sat, 10 Oct 2020 17:32:12 +0000 (19:32 +0200)] 
test: Publish and use COMPILER_BIN and COMPILER_ARGS

4 years agoUpgrade to string-view-lite 1.6.0
Joel Rosdahl [Fri, 9 Oct 2020 16:19:06 +0000 (18:19 +0200)] 
Upgrade to string-view-lite 1.6.0

4 years agoUpdate authors
Joel Rosdahl [Fri, 9 Oct 2020 07:24:21 +0000 (09:24 +0200)] 
Update authors

4 years agoAdd Erik Flodin (formerly Johansson) to .mailmap
Joel Rosdahl [Fri, 9 Oct 2020 07:23:31 +0000 (09:23 +0200)] 
Add Erik Flodin (formerly Johansson) to .mailmap

4 years agoKeep comments when using -M/-F/-o to set config values
Joel Rosdahl [Fri, 9 Oct 2020 06:56:44 +0000 (08:56 +0200)] 
Keep comments when using -M/-F/-o to set config values

4 years agoUse capitalized “Ccache” at start of sentences consistently
Joel Rosdahl [Thu, 8 Oct 2020 13:35:58 +0000 (15:35 +0200)] 
Use capitalized “Ccache” at start of sentences consistently

4 years agoMake CCACHE_COMPILER always the highest priority (#664)
Alexander Lanin [Sat, 10 Oct 2020 17:47:02 +0000 (19:47 +0200)] 
Make CCACHE_COMPILER always the highest priority (#664)

Closes #432.

4 years agoSupport GCC 9+ .gcno files in combination with -fprofile-dir
Joel Rosdahl [Wed, 7 Oct 2020 19:17:11 +0000 (21:17 +0200)] 
Support GCC 9+ .gcno files in combination with -fprofile-dir

See 7f55660f0c03b3edae809f2e6097f4be2a707329.

Closes #675.

4 years agoAdd comments for Result::FileType values
Joel Rosdahl [Wed, 7 Oct 2020 19:07:59 +0000 (21:07 +0200)] 
Add comments for Result::FileType values

4 years agoSimplify rewrite_dep_file_paths unit test
Joel Rosdahl [Wed, 7 Oct 2020 06:54:51 +0000 (08:54 +0200)] 
Simplify rewrite_dep_file_paths unit test

4 years agoUse capitalized “Ccache” at start of sentences consistently
Joel Rosdahl [Wed, 7 Oct 2020 06:35:03 +0000 (08:35 +0200)] 
Use capitalized “Ccache” at start of sentences consistently

4 years agoAdd option for enabling interprocedural (link time, LTO) optimization
Joel Rosdahl [Wed, 7 Oct 2020 06:15:20 +0000 (08:15 +0200)] 
Add option for enabling interprocedural (link time, LTO) optimization

4 years agoDon’t print failure to “git describe” to stderr
Joel Rosdahl [Tue, 6 Oct 2020 16:47:38 +0000 (18:47 +0200)] 
Don’t print failure to “git describe” to stderr

4 years agoFix broken dependency file when using base_dir
Joel Rosdahl [Tue, 6 Oct 2020 13:01:01 +0000 (15:01 +0200)] 
Fix broken dependency file when using base_dir

If a path in the dependency file matches base_dir, the dependency file
will be completely broken since newlines won’t be not retained by
use_relative_paths_in_depfile. Fix this by tokenizing lines instead of
the full file content once again.

Regression in aaadd43dbdf157ce20ab901fc9ce1c2e4924a73c (#555).

4 years agoAvoid unnecessary stat calls in Util::make_relative_path
Joel Rosdahl [Tue, 6 Oct 2020 12:47:57 +0000 (14:47 +0200)] 
Avoid unnecessary stat calls in Util::make_relative_path

4 years agoImprove consistency of terms in the manual
Joel Rosdahl [Mon, 5 Oct 2020 17:03:19 +0000 (19:03 +0200)] 
Improve consistency of terms in the manual

* configuration setting -> configuration option
* option -> command line option, configuration option, compiler option,
  value or sloppiness (unless it’s obvious from the context what
  “option” refers to)

4 years agoUpgrade to string-view-lite 1.5.1
Joel Rosdahl [Mon, 5 Oct 2020 13:34:16 +0000 (15:34 +0200)] 
Upgrade to string-view-lite 1.5.1

4 years agoAllow running the test suite with a “+dirty” version
Joel Rosdahl [Mon, 5 Oct 2020 13:17:42 +0000 (15:17 +0200)] 
Allow running the test suite with a “+dirty” version

4 years agoOnly move cache file to another level when we know the actual file count
Joel Rosdahl [Mon, 5 Oct 2020 13:14:05 +0000 (15:14 +0200)] 
Only move cache file to another level when we know the actual file count

4 years agoConst-ify parameter to to_cache
Joel Rosdahl [Mon, 5 Oct 2020 12:03:49 +0000 (14:03 +0200)] 
Const-ify parameter to to_cache

4 years agoFix bad sizeof() application
Joel Rosdahl [Mon, 5 Oct 2020 12:03:23 +0000 (14:03 +0200)] 
Fix bad sizeof() application

Found by Cppcheck.

4 years agoReduce variable scope in ResultRetriever::write_dependency_file
Joel Rosdahl [Mon, 5 Oct 2020 12:02:52 +0000 (14:02 +0200)] 
Reduce variable scope in ResultRetriever::write_dependency_file

4 years agoSuppress Cppcheck warnings for all third party source code
Joel Rosdahl [Mon, 5 Oct 2020 12:02:27 +0000 (14:02 +0200)] 
Suppress Cppcheck warnings for all third party source code

4 years agoRemove redundant check related to parsing “-x”
Joel Rosdahl [Mon, 5 Oct 2020 08:51:38 +0000 (10:51 +0200)] 
Remove redundant check related to parsing “-x”

4 years agoMerge pull request #678 from AlexanderLanin/x
Joel Rosdahl [Mon, 5 Oct 2020 08:45:33 +0000 (10:45 +0200)] 
Merge pull request #678 from AlexanderLanin/x

Add unit tests for parsing -x.

4 years agorefactor: Simplify logic of -x handling 678/head
Alexander Lanin [Fri, 2 Oct 2020 20:04:12 +0000 (22:04 +0200)] 
refactor: Simplify logic of -x handling

4 years agoAdd unit tests for parsing -x argument
Alexander Lanin [Fri, 2 Oct 2020 19:56:55 +0000 (21:56 +0200)] 
Add unit tests for parsing -x argument

4 years agoDisable some new Clang-Tidy features (#677)
Alexander Lanin [Mon, 5 Oct 2020 07:29:28 +0000 (09:29 +0200)] 
Disable some new Clang-Tidy features (#677)

4 years agoUpdate NEWS
Joel Rosdahl [Sun, 4 Oct 2020 18:50:58 +0000 (20:50 +0200)] 
Update NEWS

4 years agoAdd CI build with GCC 4.8.5
Joel Rosdahl [Sun, 4 Oct 2020 07:16:35 +0000 (09:16 +0200)] 
Add CI build with GCC 4.8.5

This tests GCC 4.8.5 which is the default compiler in RHEL/CentOS 7.

There is no intention to keep the GCC 4.8.5 build free from warnings
since doing so will make things worse for modern compilers and tools.

4 years agoUse STATUS instead of NOTICE for CMake messages
Joel Rosdahl [Sat, 3 Oct 2020 17:39:26 +0000 (19:39 +0200)] 
Use STATUS instead of NOTICE for CMake messages

NOTICE is apparently new for CMake 3.15.

4 years agoFix build error for TemporaryFile with GCC 4.8
Joel Rosdahl [Sat, 3 Oct 2020 17:37:56 +0000 (19:37 +0200)] 
Fix build error for TemporaryFile with GCC 4.8

4 years agoHandle interrupted waitpid call properly in hash_command_output
Joel Rosdahl [Sat, 3 Oct 2020 07:19:10 +0000 (09:19 +0200)] 
Handle interrupted waitpid call properly in hash_command_output

4 years agoDon’t add -I${CMAKE_SOURCE_DIR}/third_party when compiling
Joel Rosdahl [Fri, 2 Oct 2020 07:29:51 +0000 (09:29 +0200)] 
Don’t add -I${CMAKE_SOURCE_DIR}/third_party when compiling

Third party headers are supposed to be included by “#include
third_party/...”.

4 years agoAdd Paul Bunch to .mailmap
Joel Rosdahl [Fri, 2 Oct 2020 07:29:38 +0000 (09:29 +0200)] 
Add Paul Bunch to .mailmap

4 years agoMention how to configure location of the secondary config file
Joel Rosdahl [Fri, 2 Oct 2020 06:51:05 +0000 (08:51 +0200)] 
Mention how to configure location of the secondary config file

4 years agorefactor: Improve naming/interface of compopt functions (#663)
Alexander Lanin [Mon, 5 Oct 2020 06:31:41 +0000 (08:31 +0200)] 
refactor: Improve naming/interface of compopt functions (#663)

4 years agoUpgrade to BLAKE3 0.3.7
Joel Rosdahl [Thu, 1 Oct 2020 14:46:59 +0000 (16:46 +0200)] 
Upgrade to BLAKE3 0.3.7

4 years agoUpdate NEWS
Joel Rosdahl [Thu, 1 Oct 2020 12:03:26 +0000 (14:03 +0200)] 
Update NEWS

(cherry picked from commit 11a582f5b31b53e6c223f28c46bcf2d66504cbad)

4 years agoHandle missing .gcno file gracefully
Joel Rosdahl [Thu, 1 Oct 2020 11:00:30 +0000 (13:00 +0200)] 
Handle missing .gcno file gracefully

GCC ≥9 has changed behavior for -ftest-coverage and --coverage in
combination with -fprofile-dir=dir:

- Without -fprofile-dir=dir the file is placed next to the object file
  but with a “.gcno” extension.
- With -fprofile-dir=dir the file is also place next to the object file
  (i.e. not in the specified profile directory) but the same style of
  name as used for “.gcda” files (full pathname with slashes replaced
  with hash characters).

Fix this by:

- Checking if the expected (GCC <9) .gcno file is present. If not, fall
  back to running the compiler and increment the “unsupported option”
  counter.
- Making sure to perform the above check before copying the object file
  to the cache so that a later ccache invocation won’t believe that
  there is a result in the cache.
- Improving the copy_file routine to not create the destination file
  until it knows that there is a source file to copy from.

Fixes #674.

(cherry picked from commit 6abd78b5ec7cdfeedff36454b07a8dbff312b554)

4 years agoSimplify source package generation
Joel Rosdahl [Wed, 30 Sep 2020 20:18:09 +0000 (22:18 +0200)] 
Simplify source package generation

Since it now works to build from “git archive” archives, use such an
archive as the official source code release archive instead of using
CPack with a custom install script for modifying the source code. We can
revisit this in the future when and if we want a source code release
archive that is not simply an export of the version-controlled source
code.

4 years agoMake it possible to build from “git archive” source archives
Joel Rosdahl [Wed, 30 Sep 2020 15:13:48 +0000 (17:13 +0200)] 
Make it possible to build from “git archive” source archives

The ccache CMake scripts currently support building from an official
release archive or in a Git repository but not from a source archive
created by “git archive”.

Improve this by adding directives so that “git archive” substitutes
needed information when exporting the source tree.

Closes #667.

4 years agoFix bad variable name by inlining it
Joel Rosdahl [Wed, 30 Sep 2020 13:35:52 +0000 (15:35 +0200)] 
Fix bad variable name by inlining it

Introduced in 68905effcff923769800f837b1516fcb1583d71b.

4 years agoFix typo in manual section “Compiling in different directories”
Joel Rosdahl [Tue, 29 Sep 2020 18:11:14 +0000 (20:11 +0200)] 
Fix typo in manual section “Compiling in different directories”

4 years agoAdd error detection to zstd download (#673)
Alexander Lanin [Tue, 29 Sep 2020 17:59:43 +0000 (19:59 +0200)] 
Add error detection to zstd download (#673)

4 years agoAdd unittest for find_compiler (#670)
Alexander Lanin [Mon, 28 Sep 2020 13:39:55 +0000 (15:39 +0200)] 
Add unittest for find_compiler (#670)

Co-authored-by: Joel Rosdahl <joel@rosdahl.net>
4 years agoUse ubuntu-18.04 instead of ubuntu-20.04 for Clang-Tidy
Joel Rosdahl [Mon, 28 Sep 2020 12:56:43 +0000 (14:56 +0200)] 
Use ubuntu-18.04 instead of ubuntu-20.04 for Clang-Tidy

The ubuntu-20.04 VM has intermittent build errors that look like this:

  sudo apt-get install libzstd-dev clang-tidy
  [...]
  The following packages have unmet dependencies:
   clang-tidy : Depends: clang-tidy-10 (>= 10~) but it is not going to be installed
  E: Unable to correct problems, you have held broken packages.

Clang-Tidy 9 also found “function ... has a definition with different
parameter names” warnings that needed to be fixed as part of this.

As discussed in #670.

4 years agoDon’t update stats file if all counter updates are zero
Joel Rosdahl [Sun, 27 Sep 2020 17:50:29 +0000 (19:50 +0200)] 
Don’t update stats file if all counter updates are zero

4 years agoHandle short read when writing result files
Joel Rosdahl [Sun, 27 Sep 2020 14:53:09 +0000 (16:53 +0200)] 
Handle short read when writing result files

Result::Write::write_embedded_file_entry assumes that read(2) never
performs a “short read” (fewer bytes than the supplied count) for files.
A short read can however happen if the process is interrupted by a
signal, for instance on NFS with the “intr” mount option.

Fix this by properly reducing the remaining bytes counter by the amount
of actually read bytes.

4 years agoImprove base_dir documentation
Joel Rosdahl [Thu, 24 Sep 2020 19:21:05 +0000 (21:21 +0200)] 
Improve base_dir documentation

Closes #668.

4 years agoImprove CMake targets related to documentation
Joel Rosdahl [Thu, 24 Sep 2020 19:14:11 +0000 (21:14 +0200)] 
Improve CMake targets related to documentation

- Rename the documentation target to doc-html.
- Rename the manpage target to doc-man-page.
- Make the doc-html target not recreate documentation files each time it
  is run by using the OUTPUT form of add_custom_command.
- Similar for the doc-man-page target.
- Add doc target which builds both HTML documentation and man page.

4 years agoFix Clang-Tidy 9 warning about differing parameter name
Joel Rosdahl [Tue, 22 Sep 2020 19:50:02 +0000 (21:50 +0200)] 
Fix Clang-Tidy 9 warning about differing parameter name

4 years agoRemove unnecessary Result::Writer destructor
Joel Rosdahl [Tue, 22 Sep 2020 17:44:25 +0000 (19:44 +0200)] 
Remove unnecessary Result::Writer destructor

The destructor may throw exceptions and since it’s superfluous we can
just remove it.

4 years agoEncode hash digests as 4 base16 digits + 29 base32hex digits
Joel Rosdahl [Tue, 22 Sep 2020 06:34:26 +0000 (08:34 +0200)] 
Encode hash digests as 4 base16 digits + 29 base32hex digits

Reducing file lengths should be beneficial since it reduces the number
of needed system calls when scanning many files in the cache. The effect
is very small but there is no real downside. See also
b16001a67f4389956ef6e7ccf7d8023684b57119.

Base32 is chosen since the encoding algorithm is very simple compared to
e.g. base36. Base64 cannot be used since the encoded digest string is
used in filenames and the cache directory may be located on a case
insensitive filesystem. The base32hex variant is chosen instead of the
other base32 variants since it feels more natural and there are no
visual ambiguity issues.

The first two bytes are encoded as base16 to maintain compatibility with
the cleanup algorithm in older ccache versions and to allow for up to
four uniform cache levels.

4 years agoRename Util::format_hex to format_base16
Joel Rosdahl [Mon, 21 Sep 2020 19:57:05 +0000 (21:57 +0200)] 
Rename Util::format_hex to format_base16

4 years agoOptimize Util::format_hex
Joel Rosdahl [Mon, 21 Sep 2020 19:43:44 +0000 (21:43 +0200)] 
Optimize Util::format_hex

Not that it matters much, but not using fmt::format makes
Util::format_hex ≈20x faster.

4 years agoFix base32hex code
Joel Rosdahl [Tue, 22 Sep 2020 06:13:13 +0000 (08:13 +0200)] 
Fix base32hex code

- Const-ified input parameter.
- Use non-reserved macro for the include guard.
- Use unsigned int buffer to avoid “left shift of 1236923897 by 8 places
  cannot be represented in type int” reported by Clang’s
  UndefinedBehaviorSanitizer.

4 years agoAdd base32hex implementation by Peter Conrad
Joel Rosdahl [Mon, 21 Sep 2020 19:42:47 +0000 (21:42 +0200)] 
Add base32hex implementation by Peter Conrad

Implementation copied verbatim from (a patch in)
<https://github.com/pmconrad/tinydnssec>.

4 years agoUse no indentation for license entries in LICENSE.adoc consistently
Joel Rosdahl [Mon, 21 Sep 2020 19:40:41 +0000 (21:40 +0200)] 
Use no indentation for license entries in LICENSE.adoc consistently

4 years agoSort entries in LICENSE.adoc according to file names
Joel Rosdahl [Mon, 21 Sep 2020 19:34:25 +0000 (21:34 +0200)] 
Sort entries in LICENSE.adoc according to file names

4 years agoPass Args by const ref
Joel Rosdahl [Mon, 21 Sep 2020 06:25:38 +0000 (08:25 +0200)] 
Pass Args by const ref

It doesn’t matter in practice, but LGTM gets happier.

4 years agoUse short type suffix for cache files
Joel Rosdahl [Mon, 21 Sep 2020 05:59:50 +0000 (07:59 +0200)] 
Use short type suffix for cache files

x.result -> xR
x.manifest -> xM
x_n.raw -> xnW

Reducing file lengths should be beneficial since it reduces the number
of needed system calls when scanning many files in the cache. The effect
is very small but there is no real downside.

A one letter suffix is kept to allow for making decisions based on file
type without having to open the file. The suffix is uppercase so that is
doesn’t clash with pre-4.0 *.stderr files stored in the cache.

4 years agoReduce duplication in third party CMakeLists.txt
Joel Rosdahl [Sun, 20 Sep 2020 20:27:47 +0000 (22:27 +0200)] 
Reduce duplication in third party CMakeLists.txt

4 years agoStore cache statistics on level 2 and cache bookkeeping still on level 1
Joel Rosdahl [Sat, 19 Sep 2020 19:07:22 +0000 (21:07 +0200)] 
Store cache statistics on level 2 and cache bookkeeping still on level 1

In a “mostly cache hits” scenario, many parallel ccache invocations may
want to update statistics at the same time. Spreading out counter
updates over 256 instead of 16 stats files reduces lock contention
significantly.

Keeping cache bookkeeping (i.e. cache size and files counters) on level
1 preserves backward compatibility with the cleanup algorithm in older
ccache versions.

Some counters displayed by “ccache -s” won’t be accurate when an older
ccache version is run on a cache directory that is also used by ccache
4.x, but that shouldn’t be much of a problem in practice. Also, the
cache statistics isn’t backward compatible anyway since new counters may
be introduced and they will be invisible to older versions.

Closes #168 (only statistics are moved to the second level, though).

4 years agoSilence unwanted output in CCACHE_UMASK test
Joel Rosdahl [Sat, 19 Sep 2020 18:51:16 +0000 (20:51 +0200)] 
Silence unwanted output in CCACHE_UMASK test

4 years agoImplement support for automatic cache levels
Joel Rosdahl [Fri, 18 Sep 2020 07:28:48 +0000 (09:28 +0200)] 
Implement support for automatic cache levels

This makes ccache choose an appropriate cache level structure
automatically based on a maximum number of files per directory,
currently hardcoded to 2000.

4 years agoFix capitalization of CMake, Cppcheck, Clang-Format and Clang-Tidy
Joel Rosdahl [Fri, 18 Sep 2020 07:28:14 +0000 (09:28 +0200)] 
Fix capitalization of CMake, Cppcheck, Clang-Format and Clang-Tidy

4 years agoAvoid -Wshadow warnings with older compilers
Joel Rosdahl [Fri, 18 Sep 2020 06:48:10 +0000 (08:48 +0200)] 
Avoid -Wshadow warnings with older compilers

4 years agoAdd ASSERT and DEBUG_ASSERT macros
Joel Rosdahl [Fri, 18 Sep 2020 06:36:08 +0000 (08:36 +0200)] 
Add ASSERT and DEBUG_ASSERT macros

CMake always defines NDEBUG in release builds, so assertions are only
enabled in debug builds. Assertions were however always enabled before
switching to CMake. I prefer keeping assertions enabled in release
builds as well unless they are part of a tight loop.

Fix this by introducing two custom assertion macors:

- ASSERT(condition): Like assert(condition) but always enabled.
- DEBUG_ASSERT(condition): Like assert(condition), i.e. only enabled in
  debug builds.

All usage of assert(condition) is converted to ASSERT(condition) since
none of the assertions are made in performance-critical code.

4 years agoHandle waitpid interruption and add missing string header (#669)
Gregor Jasny [Mon, 21 Sep 2020 18:41:30 +0000 (20:41 +0200)] 
Handle waitpid interruption and add missing string header (#669)

4 years agoAdd support for hip language (#666)
Paul Fultz II [Mon, 21 Sep 2020 18:38:55 +0000 (13:38 -0500)] 
Add support for hip language (#666)