]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
4 years agoOnly accept -f(no-)color-diagnostics for Clang
Joel Rosdahl [Wed, 30 Dec 2020 20:22:26 +0000 (21:22 +0100)] 
Only accept -f(no-)color-diagnostics for Clang

If a non-Clang compiler gets -f(no-)color-diagnostics then bail out and
just execute the compiler. The reason is that we don't include
-f(no-)color-diagnostics in the hash so there can be a false cache hit
in the following scenario:

  1. ccache gcc -c example.c                      # adds a cache entry
  2. ccache gcc -c example.c -fcolor-diagnostics  # unexpectedly succeeds

Closes: #740.
4 years agoRemove obsolete (and now incorrect) fallback replacement of realpath(3)
Joel Rosdahl [Tue, 29 Dec 2020 18:33:54 +0000 (19:33 +0100)] 
Remove obsolete (and now incorrect) fallback replacement of realpath(3)

The fallback replacement of realpath(3) (from 8e918ccc) uses readlink(3)
under the assumption that we’re only interested about symlinks, but
that’s no longer the case: we’re using it for normalization purposes as
well. Let’s just remove it. If it turns out that there still are
non-Windows systems that don’t have realpath(3) and that we care about
we’ll figure out something else.

4 years agoFix Util::dir_name for Windows paths
Joel Rosdahl [Tue, 29 Dec 2020 18:06:17 +0000 (19:06 +0100)] 
Fix Util::dir_name for Windows paths

Util::dir_name does not understand “C:\”-style Windows path so add such
knowledge.

4 years agoAdd simple unit test of Util::make_relative_path
Joel Rosdahl [Mon, 28 Dec 2020 19:46:06 +0000 (20:46 +0100)] 
Add simple unit test of Util::make_relative_path

4 years agoFix running tests on macOS (#756)
Nicholas Hutchinson [Mon, 28 Dec 2020 14:25:12 +0000 (14:25 +0000)] 
Fix running tests on macOS (#756)

Bash tests were not actually being run on the macOS CI agents because
the version of sed installed there does not understand the `-r` flag:

    sed: illegal option -- r
    usage: sed script [-Ealn] [-i extension] [file ...]
           sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

- use `sed -E` instead of `sed -r` as the latter isn't supported by BSD sed.

- export `SDKROOT` in `test/run`. Otherwise it appears at least some
  some Apple toolchains (e.g. Xcode 10.3) will pick the _latest_ SDK
  installed on the host (e.g.
  `/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk`)
  instead of using the SDK bundled with the toolchain (e.g.
  `/Applications/Xcode_10.3.app/.../MacOSX10.14.sdk`).

  The 10.15 SDK is not compatible with Xcode 10.3:

    ld: unsupported tapi file type '!tapi-tbd' in YAML file
    '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd'
    for architecture x86_64
    clang: error: linker command failed with exit code 1

4 years agoImprove TemporaryFile implementation for Windows (#736)
Nicholas Hutchinson [Mon, 28 Dec 2020 14:22:40 +0000 (14:22 +0000)] 
Improve TemporaryFile implementation for Windows (#736)

On Windows, multiple ccache process could race each other to create,
rename and delete temporary files, because they would attempt to
generate the same sequence of temporary file names
(`tmp.cpp_stdout.iG2Kb7`, `tmp.cpp_stdout.P1kAlM`,
`tmp.cpp_stdout.FzP5tM`, ...).

This is because ccache used mingw-w64's [implementation of mkstemp][1],
which uses `rand()` to generate temporary file names, and ccache was
never seeding the thread-local PRNG used by `rand()`.

Replace ccache's use of `mkstemp()` on Windows with an implementation
based on OpenBSD. This allows us to sidestep mingw-w64's problematic
implementation, and allows us to build using MSVC again. (MSVC's C
standard library does not provide `mkstemp()`.)

Example errors:

- Some ccache process is in the process of deleting a temporary file:

      ccache: error: Failed to create temporary file for C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.FzP5tM: Access is denied.

- Some ccache process has destination file open, so it can't be overwritten:

      ccache: error: failed to rename C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.iG2Kb7 to C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.iG2Kb7.ii: Access is denied.

- Source file has been deleted by some other ccache process:

      ccache: error: failed to rename C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.P1kAlM to C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.P1kAlM.ii: The system cannot find the file specified.

[1]: https://github.com/mirror/mingw-w64/blob/v8.0.0/mingw-w64-crt/misc/mkstemp.c

4 years agoTweak markdown formatting
Joel Rosdahl [Sun, 27 Dec 2020 15:22:39 +0000 (16:22 +0100)] 
Tweak markdown formatting

4 years agoRephrase hint about C-style code left in the code base
Joel Rosdahl [Sun, 27 Dec 2020 15:22:22 +0000 (16:22 +0100)] 
Rephrase hint about C-style code left in the code base

4 years agoRemove “Support” issue template
Joel Rosdahl [Sun, 27 Dec 2020 15:21:37 +0000 (16:21 +0100)] 
Remove “Support” issue template

GitHub Discussions is preferred now.

4 years agoMention GitHub discussions
Joel Rosdahl [Sun, 27 Dec 2020 15:09:14 +0000 (16:09 +0100)] 
Mention GitHub discussions

4 years agoAdd preprocessed file extension to cpp stdout early
Joel Rosdahl [Mon, 21 Dec 2020 18:02:19 +0000 (19:02 +0100)] 
Add preprocessed file extension to cpp stdout early

Unless when compiling a preprocessed file directly, ccache creates a
temporary file to store the output of the preprocessor, registers the
file for removal at program exit, renames the file to one with a .i/.ii
extension and then registers that file for removal as well. This works
by chance in practice as long as mkstemp() returns something with low
probability of being reused, but as discussed in #736 it risks failing
when mkstemp() doesn’t behave that way.

Fix this by creating the new name (with the needed extension) using a
hard link so that the original file will outlive the new file, thus
blocking another ccache process from creating a file with the same name
again. To make the new temporary file outlive the old file, also delete
pending temporary files in LIFO order.

4 years agoAdd Util::hard_link utility function
Joel Rosdahl [Sun, 20 Dec 2020 18:57:42 +0000 (19:57 +0100)] 
Add Util::hard_link utility function

4 years agoGitHub: Ensure apt update is run for all Linux jobs
Nicholas Hutchinson [Sat, 19 Dec 2020 19:52:45 +0000 (19:52 +0000)] 
GitHub: Ensure apt update is run for all Linux jobs

4 years agoAdd missing pragma once (#744)
Erik Flodin [Fri, 11 Dec 2020 18:30:21 +0000 (19:30 +0100)] 
Add missing pragma once (#744)

4 years agoFix building 32bit tests on macOS (#743)
Alexander Lanin [Wed, 9 Dec 2020 20:38:19 +0000 (21:38 +0100)] 
Fix building 32bit tests on macOS (#743)

4 years agoDon’t build with Clang’s -Weverything option
Joel Rosdahl [Wed, 9 Dec 2020 20:01:56 +0000 (21:01 +0100)] 
Don’t build with Clang’s -Weverything option

As discussed in #739.

4 years agoImprove incorrect documentation on what cache_dir does
Joel Rosdahl [Tue, 8 Dec 2020 20:19:19 +0000 (21:19 +0100)] 
Improve incorrect documentation on what cache_dir does

The manual says that cache_dir only takes effect if set by $CCACHE_DIR
or by cache_dir in the secondary (system-wide) configuration file, which
is incorrect. It’s kind of correct for how the primary configuration
file is found, though.

4 years agoImprove SIMD detection (#735)
Erik Flodin [Mon, 7 Dec 2020 18:20:31 +0000 (19:20 +0100)] 
Improve SIMD detection (#735)

* Try to compile code to detect SSE/AVX support. Just checking if the compiler
  supports the flag isn't enough as e.g. Clang on Apple's new ARM silicon seems
  to accept the flag but then fails when building.
* Try to detect and enable BLAKE3's Neon support.
* Improve detection of AVX2 target attribute support and remove the explicit
  compiler version check that hopefully shouldn't be needed.

Fixes #734.

4 years agoFix missing isascii() declaration on FreeBSD (#730)
khng300 [Mon, 7 Dec 2020 07:10:46 +0000 (15:10 +0800)] 
Fix missing isascii() declaration on FreeBSD (#730)

4 years agoImprove mutex handling code structure in InodeCache
Joel Rosdahl [Mon, 7 Dec 2020 06:19:52 +0000 (07:19 +0100)] 
Improve mutex handling code structure in InodeCache

InodeCache’s acquire_bucket and release_bucket functions need to be used
together. There is no problem with this currently, but it’s possible
that one may forget to call release_bucket in some code path in the
future.

Improve this by introducing a single InodeCache::with_bucket function
that makes it impossible to misuse the API. This should also make
thread-safety analysis algorithms, e.g. Clang’s
-Wthread-safety-analysis, happy.

Related to #730.

4 years agoReintroduce dev mode and disable problematic build flags in user mode
Joel Rosdahl [Sat, 5 Dec 2020 18:17:32 +0000 (19:17 +0100)] 
Reintroduce dev mode and disable problematic build flags in user mode

In version 3.x, ccache was in “user mode” when building from release
archive sources and “dev mode” otherwise. In “dev mode”, additional
compiler flags like “-Wextra -Wpedantic -Werror” were added, but they
were not present in “user mode” in order not to break end users’ builds.
This behavior was partially lost in the conversion to CMake.

This commit tries to imitate the previous behavior by introducing a
CCACHE_DEV_MODE CMake variable and only enable potentially problematic
compiler flags when it’s set to ON.

Related to #730.

4 years agoImprove references in the manual
Joel Rosdahl [Sat, 5 Dec 2020 18:04:25 +0000 (19:04 +0100)] 
Improve references in the manual

4 years agoRemove legacy “cheap and nasty” mkstemp replacement
Joel Rosdahl [Thu, 3 Dec 2020 20:46:31 +0000 (21:46 +0100)] 
Remove legacy “cheap and nasty” mkstemp replacement

Hopefully mkstemp is available on all systems we want to support these
days.

As mentioned in #703.

4 years agoImprove documentation of compression levels and -X/--recompress
Joel Rosdahl [Wed, 2 Dec 2020 20:56:05 +0000 (21:56 +0100)] 
Improve documentation of compression levels and -X/--recompress

Related to issue #728.

4 years agoImprove consistency of terms in the manual
Joel Rosdahl [Thu, 26 Nov 2020 21:04:46 +0000 (22:04 +0100)] 
Improve consistency of terms in the manual

4 years agoImprove documentation wording on compiler_check string values
Joel Rosdahl [Thu, 26 Nov 2020 19:52:22 +0000 (20:52 +0100)] 
Improve documentation wording on compiler_check string values

4 years agoEnable Clang 5.0 tests again
Joel Rosdahl [Sun, 22 Nov 2020 20:05:01 +0000 (21:05 +0100)] 
Enable Clang 5.0 tests again

4 years agoMinGW: Default to static linking (#732)
Orgad Shaneh [Sun, 29 Nov 2020 13:15:30 +0000 (15:15 +0200)] 
MinGW: Default to static linking (#732)

The release contains only the executable without the dll dependencies.

It is easier to deploy a single self-contained executable anyway.

Fixes #729.

4 years agoGitHub: Call apt-get update before install (#733)
Orgad Shaneh [Sun, 29 Nov 2020 13:14:18 +0000 (15:14 +0200)] 
GitHub: Call apt-get update before install (#733)

Without update, apt tries to download outdated packages, which possibly
don't exist.

4 years agoAdd missing copyright information to LICENSE.adoc
Joel Rosdahl [Tue, 24 Nov 2020 20:51:27 +0000 (21:51 +0100)] 
Add missing copyright information to LICENSE.adoc

4 years agoUse simple globs in LICENSE.adoc
Joel Rosdahl [Tue, 24 Nov 2020 20:51:03 +0000 (21:51 +0100)] 
Use simple globs in LICENSE.adoc

4 years agoBuild and install HTML documentation by default if possible
Joel Rosdahl [Mon, 23 Nov 2020 19:24:03 +0000 (20:24 +0100)] 
Build and install HTML documentation by default if possible

4 years agoUpdate news v4.1
Joel Rosdahl [Sun, 22 Nov 2020 20:00:22 +0000 (21:00 +0100)] 
Update news

4 years agoUpdate authors
Joel Rosdahl [Sun, 22 Nov 2020 19:11:47 +0000 (20:11 +0100)] 
Update authors

4 years agoFix bug in depfile when output filename includes special characters
Joel Rosdahl [Thu, 19 Nov 2020 20:31:41 +0000 (21:31 +0100)] 
Fix bug in depfile when output filename includes special characters

The rewriting of the dependency file content introduced in 2ab31632 just
replaces the object file part of the dependency file with the raw
filename. This is incorrect if the filename includes special characters
such as space or dollar.

Fix this by escaping the filename properly. Note that newlines are not
treated specially since Make cannot handle them anyway.

See also the similar bug fix for the depend mode (but for parsing
instead of escaping in that case) in 1d2b5bf4.

4 years agoAlign spelling of “nonexistent”
Joel Rosdahl [Thu, 19 Nov 2020 19:47:42 +0000 (20:47 +0100)] 
Align spelling of “nonexistent”

4 years agoExtract code for parsing dependency files into a separate file
Joel Rosdahl [Thu, 19 Nov 2020 19:44:44 +0000 (20:44 +0100)] 
Extract code for parsing dependency files into a separate file

4 years agoFix result_name_from_depfile by parsing depfile in Makefile syntax (#722)
Yoshimasa Niwa [Wed, 18 Nov 2020 20:18:18 +0000 (12:18 -0800)] 
Fix result_name_from_depfile by parsing depfile in Makefile syntax (#722)

4 years agoAdd --config-path option
Joel Rosdahl [Tue, 17 Nov 2020 18:58:37 +0000 (19:58 +0100)] 
Add --config-path option

The option makes subsequent command line options operate on the given
configuration file instead of the default.

Closes #719.

4 years agoMake color_diagnostics and direct test suites work with C++ compilers
Joel Rosdahl [Tue, 17 Nov 2020 18:28:51 +0000 (19:28 +0100)] 
Make color_diagnostics and direct test suites work with C++ compilers

As mentioned in #716.

4 years agoCreate unittest directories in testdir
Joel Rosdahl [Tue, 17 Nov 2020 17:44:58 +0000 (18:44 +0100)] 
Create unittest directories in testdir

See also d575526c91a8e0167a249760d63510e7de67ed23.

4 years agoCache -fsyntax-only result (#685)
Alexander Lanin [Mon, 16 Nov 2020 17:45:44 +0000 (18:45 +0100)] 
Cache -fsyntax-only result (#685)

4 years agoLink with libatomic when needed (#723)
Joel Rosdahl [Thu, 12 Nov 2020 19:40:08 +0000 (20:40 +0100)] 
Link with libatomic when needed (#723)

Linking with libatomic is apparently needed when using <atomic>
functionality with GCC on ARM and PowerPC.

4 years agoBump to Xcode 11.7
Joel Rosdahl [Tue, 10 Nov 2020 18:54:55 +0000 (19:54 +0100)] 
Bump to Xcode 11.7

Xcode 11.0.0 has apparently disappeared from the GitHub build
environment.

4 years agoAdd tip about installing docbook-xml and docbook-xsl on Debian
Joel Rosdahl [Tue, 10 Nov 2020 06:40:07 +0000 (07:40 +0100)] 
Add tip about installing docbook-xml and docbook-xsl on Debian

4 years agoFix conditional compilation of robust mutex code in inode cache
Joel Rosdahl [Mon, 9 Nov 2020 18:35:02 +0000 (19:35 +0100)] 
Fix conditional compilation of robust mutex code in inode cache

213d9883 added code for using a “robust mutex” to be able to recover a
mutex left in an inconsistent state. The code is enabled if the
PTHREAD_MUTEX_ROBUST macro is defined. On all Linux systems I have
tested, PTHREAD_MUTEX_ROBUST is not a macro but an enum value, so the
code is dead.

Fix this by adding a configure-time check whether it’s possible to use
pthread_mutexattr_setrobust(..., PTHREAD_MUTEX_ROBUST).

4 years agoImprove config.h comments
Joel Rosdahl [Mon, 9 Nov 2020 18:33:38 +0000 (19:33 +0100)] 
Improve config.h comments

4 years agoSay “define” instead of “define to 1” in config.h
Joel Rosdahl [Mon, 9 Nov 2020 18:30:23 +0000 (19:30 +0100)] 
Say “define” instead of “define to 1” in config.h

Since any defined value is OK for the macros in config.h, let’s not say
that the value needs to be 1.

4 years agoImprove safety of fallback after failed -fdiagnostics-color probe
Joel Rosdahl [Mon, 9 Nov 2020 07:02:40 +0000 (08:02 +0100)] 
Improve safety of fallback after failed -fdiagnostics-color probe

4 years agoAdd possibility of overriding compiler type guess
Joel Rosdahl [Sat, 7 Nov 2020 19:25:10 +0000 (20:25 +0100)] 
Add possibility of overriding compiler type guess

This commit adds a new compiler_type (CCACHE_COMPILERTYPE) configuration
option which makes it possible to force a compiler type, for instance
from a compiler wrapper script not named like a known compiler.

As mentioned in #718.

4 years agoRename GuessedCompiler to CompilerType
Joel Rosdahl [Sat, 7 Nov 2020 18:20:48 +0000 (19:20 +0100)] 
Rename GuessedCompiler to CompilerType

4 years agoFollow symlinks when guessing compiler
Joel Rosdahl [Thu, 5 Nov 2020 20:02:50 +0000 (21:02 +0100)] 
Follow symlinks when guessing compiler

This makes ccache able to guess compiler type “GCC” for a common symlink
chain like this:

    /usr/bin/cc -> /etc/alternatives/cc -> /usr/bin/gcc
    -> gcc-9 -> x86_64-linux-gnu-gcc-9

Closes #718.

4 years agotest: Don’t wait forever for output from script(1)
Joel Rosdahl [Sat, 7 Nov 2020 18:53:23 +0000 (19:53 +0100)] 
test: Don’t wait forever for output from script(1)

5 years agoDon’t add a duplicate manifest entry when recaching
Joel Rosdahl [Sat, 7 Nov 2020 18:07:26 +0000 (19:07 +0100)] 
Don’t add a duplicate manifest entry when recaching

5 years agoRemove superfluous Config::set_limit_multiple method
Joel Rosdahl [Thu, 5 Nov 2020 20:26:50 +0000 (21:26 +0100)] 
Remove superfluous Config::set_limit_multiple method

5 years agoAdd comment about -fcolor-diagnostics and assembler language
Joel Rosdahl [Thu, 5 Nov 2020 12:39:16 +0000 (13:39 +0100)] 
Add comment about -fcolor-diagnostics and assembler language

5 years agoUpgrade to doctest 2.4.1
Joel Rosdahl [Wed, 4 Nov 2020 20:40:37 +0000 (21:40 +0100)] 
Upgrade to doctest 2.4.1

Version 2.4.1 includes the changes in #708 for making doctest buildable
with Clang 3.4.

5 years agoAdd Ubuntu 18.04 Dockerfile
Joel Rosdahl [Wed, 4 Nov 2020 20:40:18 +0000 (21:40 +0100)] 
Add Ubuntu 18.04 Dockerfile

5 years agoAdd docbook-{xml,xsl} packages to Ubuntu environments
Joel Rosdahl [Wed, 4 Nov 2020 20:21:41 +0000 (21:21 +0100)] 
Add docbook-{xml,xsl} packages to Ubuntu environments

Without docbook-xml and docbook-xsl, xsltproc (run by a2x to create the
ccache.1 man page) fetches stuff from the Internet, making man page
generation very slow.

5 years agoRemove now unused Args::contains method
Joel Rosdahl [Wed, 4 Nov 2020 06:28:43 +0000 (07:28 +0100)] 
Remove now unused Args::contains method

It was removed when refactoring 50e8d229.

5 years agoDisable some tests on ancient Clang versions (#693)
Alexander Lanin [Wed, 4 Nov 2020 06:33:08 +0000 (07:33 +0100)] 
Disable some tests on ancient Clang versions (#693)

Co-authored-by: Joel Rosdahl <joel@rosdahl.net>
5 years agoDocument the relation between CCACHE_DIR and -d/--directory
Joel Rosdahl [Tue, 3 Nov 2020 20:25:06 +0000 (21:25 +0100)] 
Document the relation between CCACHE_DIR and -d/--directory

Closes #717.

5 years agodoc: Fix incorrect reference and bad markup
Joel Rosdahl [Tue, 3 Nov 2020 20:16:32 +0000 (21:16 +0100)] 
doc: Fix incorrect reference and bad markup

5 years agoFall back to version "unknown" when Git is not installed (#706)
Alexander Lanin [Tue, 3 Nov 2020 20:13:56 +0000 (21:13 +0100)] 
Fall back to version "unknown" when Git is not installed (#706)

Co-authored-by: Joel Rosdahl <joel@rosdahl.net>
5 years agoRetain given color diagnostics options when forcing colored output
Joel Rosdahl [Mon, 2 Nov 2020 21:09:56 +0000 (22:09 +0100)] 
Retain given color diagnostics options when forcing colored output

ccache currently filters out both -fdiagnostics-color and
-fcolor-diagnostics options when adding -fdiagnostics-color (GCC) or
-fcolor-diagnostics (Clang) to force colored output. The idea in #224
was that only -fdiagnostics-color options should be filtered out when
the compiler is GCC, but -fcolor-diagnostics is also removed, something
which was missed in the code review. This has the unintended side effect
that “ccache gcc -fcolor-diagnostics -c example.c” works since ccache in
effect removes -fcolor-diagnostics in the actual call to the compiler.

The bug can fixed by removing only the compiler-specific options when
forcing colored output, but a more robust method would be to retain all
color diagnostics options as is but exclude them from the input hash.
This commit makes that change and also simplifies the logic for color
diagnostics option handling.

Fixes #711.

5 years agoAdd Args::contains method
Joel Rosdahl [Mon, 2 Nov 2020 21:07:45 +0000 (22:07 +0100)] 
Add Args::contains method

5 years agoAdd Args::erase_last method
Joel Rosdahl [Mon, 2 Nov 2020 06:50:13 +0000 (07:50 +0100)] 
Add Args::erase_last method

5 years agoTweak color_diagnostics.bash code style
Joel Rosdahl [Fri, 30 Oct 2020 13:59:08 +0000 (14:59 +0100)] 
Tweak color_diagnostics.bash code style

5 years agoMinGW: Fix static linkage with libgcc and libstdc++ and make it optional (#712)
Orgad Shaneh [Fri, 30 Oct 2020 09:57:35 +0000 (11:57 +0200)] 
MinGW: Fix static linkage with libgcc and libstdc++ and make it optional (#712)

There is no reason to enable it by default. Looks like it was done for
enabling it to run with wine.

5 years agoDisable some AVX features on old Apple clang versions (#704)
Erik Flodin [Fri, 30 Oct 2020 09:41:58 +0000 (10:41 +0100)] 
Disable some AVX features on old Apple clang versions (#704)

Disable avx2 and avx512 support on some apple clang versions as the compile
fails even though the compiler seems to accept the -m flags that are used to
enable the feature.

See issue #689.

5 years agoClean up CMakeLists.txt
Joel Rosdahl [Fri, 30 Oct 2020 09:28:11 +0000 (10:28 +0100)] 
Clean up CMakeLists.txt

5 years agoBuild and install man page by default (#705)
Erik Flodin [Fri, 30 Oct 2020 09:23:08 +0000 (10:23 +0100)] 
Build and install man page by default (#705)

Fixes #684.

5 years agoRestore original umask after finalize_at_exit
Joel Rosdahl [Wed, 28 Oct 2020 20:26:42 +0000 (21:26 +0100)] 
Restore original umask after finalize_at_exit

If umask (CCACHE_UMASK) has been configured, ccache restores the
original umask before executing external programs so that the configured
umask is only used for files created by ccache itself. After a
refactoring of how flushing of statistics is done
(dd8f65aa5589709ca55bbb782050424a0010e8b8), the original umask is
restored before calling finalize_at_exit. If ccache hasn’t created a
result file (i.e., the result is not a cache miss, for example when
called for linking), finalize_stats_and_trigger_cleanup (called by
finalize_at_exit) chooses a random stats file and implicitly also
creates any missing cache directories. Such cache directories will
therefore be created without applying the configured umask.

Fix this by restoring the original mask after calling finalize_at_exit.

Fixes #710.

5 years agoCI: List all configurations explicitly (#690)
Alexander Lanin [Mon, 26 Oct 2020 21:06:10 +0000 (22:06 +0100)] 
CI: List all configurations explicitly (#690)

5 years agoTweak formulations and fix spelling in CMakeLists.txt
Joel Rosdahl [Fri, 23 Oct 2020 13:40:07 +0000 (15:40 +0200)] 
Tweak formulations and fix spelling in CMakeLists.txt

5 years agoTweak code style
Joel Rosdahl [Fri, 23 Oct 2020 13:13:55 +0000 (15:13 +0200)] 
Tweak code style

5 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.

5 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.

5 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.

5 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)

5 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)

5 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.

5 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.

5 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

5 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)

5 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)

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

5 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.

5 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

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

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

5 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

5 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/>.

5 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

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

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

5 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

5 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.

5 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

5 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.