]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
5 years agoSimplify make_relative_path() argument and result ownership 515/head
Thomas Otto [Sun, 19 Jan 2020 17:21:54 +0000 (18:21 +0100)] 
Simplify make_relative_path() argument and result ownership

5 years agoMake cc_process_args() only use local variables
Thomas Otto [Sun, 19 Jan 2020 16:49:19 +0000 (17:49 +0100)] 
Make cc_process_args() only use local variables

cc_process_args writes into a new ArgsInfo struct and only accesses
local variables (minus guessed_compiler). For now these are mostly
copied into the global variables again after the function call.

Most ccache.cpp global variables moved to legacy_globals.cpp.

5 years agoAdd a ScopeGuard struct
Thomas Otto [Wed, 22 Jan 2020 18:02:04 +0000 (19:02 +0100)] 
Add a ScopeGuard struct

Enables automatic cleanup of raw pointers and other resources.
For now used simplify resource management in cc_process_args.

5 years agoAdd from_owned_cstr/from_cstr functions
Thomas Otto [Sun, 19 Jan 2020 16:49:19 +0000 (17:49 +0100)] 
Add from_owned_cstr/from_cstr functions

5 years agoFormat code with clang-format
Joel Rosdahl [Sat, 25 Jan 2020 12:52:29 +0000 (13:52 +0100)] 
Format code with clang-format

5 years agoMake Config noncopyable and add clear_and_reset() method (#522)
Thomas Otto [Sat, 25 Jan 2020 12:45:42 +0000 (13:45 +0100)] 
Make Config noncopyable and add clear_and_reset() method (#522)

Prevents changes from getting lost by writing them to a
temporary copy of the main Config object.

Also restore deleted comments from the move of
primary/secondary_config_path.

5 years agoDerive header list from source list if possible (#521)
Thomas Otto [Sat, 25 Jan 2020 12:40:46 +0000 (13:40 +0100)] 
Derive header list from source list if possible (#521)

5 years agoSkip read-only tests on file systems that lack such support
Joel Rosdahl [Sat, 25 Jan 2020 10:25:52 +0000 (11:25 +0100)] 
Skip read-only tests on file systems that lack such support

Fixes #510.

5 years agoMake failure to write a stats file a soft error (#516)
Joel Rosdahl [Sat, 25 Jan 2020 10:19:52 +0000 (11:19 +0100)] 
Make failure to write a stats file a soft error (#516)

If a stats file update for some reason fails, the exception will bubble
up to ccache_main which just prints the error and exits with an error.
Let’s consider such failures non-fatal and just log them.

5 years agoSplit ccache.hpp into per-.cpp file headers
Joel Rosdahl [Wed, 22 Jan 2020 21:03:09 +0000 (22:03 +0100)] 
Split ccache.hpp into per-.cpp file headers

This reduces code dependencies that hamper refactoring.

5 years agoRemove obsolete COMPAR_FN_T check and typedef
Joel Rosdahl [Wed, 22 Jan 2020 20:16:39 +0000 (21:16 +0100)] 
Remove obsolete COMPAR_FN_T check and typedef

5 years agoMove global primary/secondary_config_path into Config (#514)
Thomas Otto [Tue, 21 Jan 2020 18:31:18 +0000 (19:31 +0100)] 
Move global primary/secondary_config_path into Config (#514)

5 years agoIgnore files from VS (Code) (#508)
Alexander Lanin [Mon, 20 Jan 2020 21:54:48 +0000 (22:54 +0100)] 
Ignore files from VS (Code) (#508)

5 years agoMake failed tests create a testdir.failed symlink (#511)
Thomas Otto [Sun, 19 Jan 2020 19:47:27 +0000 (20:47 +0100)] 
Make failed tests create a testdir.failed symlink (#511)

When the test suite fails 'testdir.failed' now points to the random
'testdir.9876/' directory. This make iterative debugging of failing
tests easier by always using the symlink name or re-issuing 'cd $PWD'
when 'cd'-ed into the 'testdir.failed' directory.

All artifacts can still be removed via 'rm -r testdir.*'.

5 years agoSimplify parse_int slightly (#509)
Alexander Lanin [Sun, 19 Jan 2020 16:34:43 +0000 (17:34 +0100)] 
Simplify parse_int slightly (#509)

5 years agoAdd configuration for the No Response Probot
Joel Rosdahl [Sun, 19 Jan 2020 15:08:31 +0000 (16:08 +0100)] 
Add configuration for the No Response Probot

5 years agoUpgrade to fmt 6.1.2
Joel Rosdahl [Thu, 16 Jan 2020 20:19:38 +0000 (21:19 +0100)] 
Upgrade to fmt 6.1.2

5 years agoSend dependency arguments to compiler if run_second_cpp is true
Joel Rosdahl [Thu, 16 Jan 2020 20:04:09 +0000 (21:04 +0100)] 
Send dependency arguments to compiler if run_second_cpp is true

If we run the compiler on the real source code on a cache miss (i.e.,
run_second_cpp is true) we can send the dependency arguments (-MD, etc.)
to the compiler instead of the preprocessor. When doing this there is no
need to add an implicit -MQ option to get the correct object file
location in the dependency file. Do so and also avoid adding an implicit
-MF option since that isn’t needed either. This should re-add support
for EDG-based compilers (see 6d453769 and #460).

If we run the compiler on the preprocessed source code on a cache miss
(i.e., run_second_cpp is false) we still need to let the preprocessor
generate the dependency file (the compiler doesn’t generate a dependency
file when compiling preprocessed source code) and thus we need to add
implicit -MQ and -MF.

This change reverts a fix (97b27781) for the Intel C++ compiler, but if
the Intel compiler still has problems the user can simply avoid setting
run_second_cpp to false.

5 years agoTest extra_args_to_hash output of cc_process_args
Joel Rosdahl [Thu, 16 Jan 2020 20:03:08 +0000 (21:03 +0100)] 
Test extra_args_to_hash output of cc_process_args

5 years agoInclude “Co-authored-by” attributions when calculating authors
Joel Rosdahl [Wed, 15 Jan 2020 21:49:23 +0000 (22:49 +0100)] 
Include “Co-authored-by” attributions when calculating authors

(cherry picked from commit cb301769895adc941845b16d124e0bff292a74c3)

5 years agoImprove error message for bad boolean environment variable value
Joel Rosdahl [Wed, 15 Jan 2020 20:53:58 +0000 (21:53 +0100)] 
Improve error message for bad boolean environment variable value

Before:

    ccache: error: CCACHE_DIRECT: invalid boolean environment variable
    value "0" for CCACHE_NODIRECT (did you mean to set
    "CCACHE_DIRECT=true"?)

After:

    ccache: error: CCACHE_NODIRECT: invalid boolean environment variable
    value "0" (did you mean to set "CCACHE_DIRECT=true"?)

5 years agoMake it harder to misinterpret semantics of boolean environment settings
Joel Rosdahl [Tue, 14 Jan 2020 21:10:17 +0000 (22:10 +0100)] 
Make it harder to misinterpret semantics of boolean environment settings

Closes #502.

Co-authored-by: Steffen Dettmer <steffen.dettmer@rail.bombardier.com>
(cherry picked from commit f2481b1d5988cb4ccc3010c4ad6933e9c93e6d02)

5 years agoAvoid passing compilation-only options to the preprocessor redux
Joel Rosdahl [Tue, 14 Jan 2020 20:30:29 +0000 (21:30 +0100)] 
Avoid passing compilation-only options to the preprocessor redux

25e73c1f (“Include compiler-only arguments in the hash”) attempted to
fix a regression in 5d8585b5 (“Don’t pass -Werror and compilation-only
options to the preprocessor”). It succeeded fixing the regression all
right, but it also essentially reverted the essence of 5d8585b5 (#312)
since compiler-only arguments once again are passed to the preprocessor.
Sigh.

Fix this for real and also write a test that proves it.

(cherry picked from commit bc2005e994030f787c014ce2491cfc4c7057eac6)

5 years agomisc/performance: Fix --no-cpp2 and --no-stats options
Joel Rosdahl [Mon, 13 Jan 2020 20:35:11 +0000 (21:35 +0100)] 
misc/performance: Fix --no-cpp2 and --no-stats options

They broke in an unsuccessful cherry-pick (0827d070) as noted in #503.

(cherry picked from commit 0948fb13f07c756b8e056efdec46560e0faf37d1)

5 years agoPrepare for v3.7.7
Joel Rosdahl [Sun, 5 Jan 2020 20:09:28 +0000 (21:09 +0100)] 
Prepare for v3.7.7

(cherry picked from commit 26912b280b839e102482db8c9e63f00a95b58486)

5 years agoPrepare for v3.7.7
Joel Rosdahl [Sun, 5 Jan 2020 20:09:00 +0000 (21:09 +0100)] 
Prepare for v3.7.7

(cherry picked from commit 6cfc49fc46b16d0b3fe9c3cde8ddf3199a36ced6)

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 4 Jan 2020 18:24:39 +0000 (19:24 +0100)] 
Update NEWS

(cherry picked from commit 5c6954378780a7d07faa33d5bc31bdda1a4b8bb1)

5 years agoMake sure to always log a “Result:” line
Joel Rosdahl [Sat, 4 Jan 2020 18:19:01 +0000 (19:19 +0100)] 
Make sure to always log a “Result:” line

Fixes #500.

A side effect of this is that read-only cache misses now will update the
“cache miss” statistics counter, which is consistent with the cache hit
cases (which already now update the counters).

(cherry picked from commit 1d2b76a71b12c2ffdd107f89a3d9caa6cd223d44)

5 years agoAdd tests for verifying dependency file content
Joel Rosdahl [Wed, 1 Jan 2020 21:17:11 +0000 (22:17 +0100)] 
Add tests for verifying dependency file content

(cherry picked from commit c972eb6e824624956444e945bdfd9768c7e74123)

5 years agoRevert "Only pass implicit -MQ to preprocessor if needed"
Joel Rosdahl [Wed, 1 Jan 2020 20:59:29 +0000 (21:59 +0100)] 
Revert "Only pass implicit -MQ to preprocessor if needed"

This reverts commit 19c3729d30640fc2c78242cb46136e619fdbd802 and also
removes the incorrect and superfluous condition that the fix fixes.

The reason for reverting is that the change introduced a nasty bug: the
dependency file will get an incorrect object file location if 1) build
directory != source directory and 2) -MF is not specified explictly by
the user.

Details: The dependency file is created by the preprocessor pass which
does not have access to the final output file name, so the preprocessor
uses the default object location derived from the source file location
instead.

Note that this partly reverts a compatibility improvement for EDG-based
compilers (see issue #460).

It should be possible to pass the dependency arguments to the compiler
instead of the preprocessor to make -MD/-MMD without -MQ work, but
that’s too risky to be done as a bug fix.

Fixes #499.

(cherry picked from commit 6d4537695f8753556362c6c5521360ca9b596ab2)

5 years agoAdd “--nocpp2” option to misc/performance
Joel Rosdahl [Wed, 1 Jan 2020 20:49:11 +0000 (21:49 +0100)] 
Add “--nocpp2” option to misc/performance

(cherry picked from commit dbf7e85f67cf785636341ce07380e7151b582ee6)

5 years agoTest .incbin detection for assembler compilation
Joel Rosdahl [Sun, 29 Dec 2019 19:06:32 +0000 (20:06 +0100)] 
Test .incbin detection for assembler compilation

(cherry picked from commit c9530b9d423b3e1b52f2fb7b3cf3376eb3044384)

5 years agoRemove the unify mode
Joel Rosdahl [Sun, 29 Dec 2019 18:21:39 +0000 (19:21 +0100)] 
Remove the unify mode

The unify mode has not received enough attention and has at least these
bugs:

1. The direct mode doesn’t work if the unify mode is enabled. This is
   because the unify mode doesn’t call into process_preprocessed_file
   which stores the paths and hashes of included files needed by the
   direct mode.
2. The .incbin directive detection has no effect when using the unify
   mode. This is again because the unify mode doesn’t use
   process_preprocessed_file which is where the .incbin detection takes
   place.
3. The unifier’s tokenizer doesn’t understand C++11 raw string literals.
4. The unifier ignores comments, but comments may have semantic meaning
   to modern compilers, e.g. “fall through” comments.

Bugs 3 and 4 are fixable by improving the unifier’s tokenization
algorithm, but since it’s a bit tricky it likely won’t be worth the
effort, especially not as a bug fix.

Bugs 1 and 2 are also fixable by unifying the two code paths, but that’s
a non-trivial effort.

In addition to the bugs, I believe that the usefullness of the unify
mode is low:

* It’s only applicable when not using -g.
* It won't be enabled for C++ unless somebody fixes bug 3.
* It can make line numbers in warning messages and __LINE__ expansions
  incorrect.
* Since comments should not be ignored, the unify mode can only make a
  difference for some types of whitespace changes, like adding or
  removing blank lines or changing a+b to a + b. (a + b is already
  normalized to a + b by the preprocessor.)

Therefore I’ll just remove the unify mode to fix the bugs.

Fixes #497.

(cherry picked from commit 947a72ce3712a6901e7ddc43a50c5df40739113e)

5 years agoRemove superfluous clang-format comments
Joel Rosdahl [Tue, 10 Dec 2019 20:38:40 +0000 (21:38 +0100)] 
Remove superfluous clang-format comments

5 years agoUnittest fixes on Windows (#496)
Cristian Adam [Sun, 15 Dec 2019 19:48:19 +0000 (20:48 +0100)] 
Unittest fixes on Windows (#496)

5 years agoUpdate .mailmap
Joel Rosdahl [Mon, 2 Dec 2019 21:00:06 +0000 (22:00 +0100)] 
Update .mailmap

(cherry picked from commit 38419c8dc3712b46020fd02cef6f608bf66c13fe)

5 years agoImprove comments related to save_timestamp
Joel Rosdahl [Mon, 2 Dec 2019 20:58:56 +0000 (21:58 +0100)] 
Improve comments related to save_timestamp

(cherry picked from commit 0d0def13a52d7b68376636776e71a9af5bf01bb4)

5 years agoStore mtime/ctime as -1 if sloppy_file_stat is not set (#495)
MizuhaHimuraki [Mon, 2 Dec 2019 20:54:22 +0000 (04:54 +0800)] 
Store mtime/ctime as -1 if sloppy_file_stat is not set (#495)

As discussed in #493.

(cherry picked from commit 6341a2abd47eb43123ce9fc92716d9768300795e)

5 years agoAssert in get_path_in_cache instead of throwing on bad preconditions
Joel Rosdahl [Sun, 1 Dec 2019 20:48:37 +0000 (21:48 +0100)] 
Assert in get_path_in_cache instead of throwing on bad preconditions

A bad `levels` argument is an internal error and cannot be a result of
user input.

5 years agoRefactor and simplify get_path_in_cache and tests
Joel Rosdahl [Sun, 1 Dec 2019 20:38:00 +0000 (21:38 +0100)] 
Refactor and simplify get_path_in_cache and tests

This avoids depending on global state, making testing and reasoning
about code behavior easier.

5 years agoReflow comments to fit the available width
Joel Rosdahl [Sun, 1 Dec 2019 20:18:51 +0000 (21:18 +0100)] 
Reflow comments to fit the available width

5 years agoSimplify return of empty string_view
Joel Rosdahl [Sun, 1 Dec 2019 20:16:44 +0000 (21:16 +0100)] 
Simplify return of empty string_view

5 years agoRemove “nonstd::” qualification where no longer needed
Joel Rosdahl [Sun, 1 Dec 2019 20:15:50 +0000 (21:15 +0100)] 
Remove “nonstd::” qualification where no longer needed

5 years agoRemove duplicate backtick
Joel Rosdahl [Sun, 1 Dec 2019 20:13:09 +0000 (21:13 +0100)] 
Remove duplicate backtick

5 years agoMerge pull request #483 from totph/svmisc
Joel Rosdahl [Sun, 1 Dec 2019 20:11:29 +0000 (21:11 +0100)] 
Merge pull request #483 from totph/svmisc

Misc C++-ification

5 years agoC++-ify get_path_in_cache(), add ConfigTester 483/head
Thomas Otto [Mon, 25 Nov 2019 18:40:09 +0000 (19:40 +0100)] 
C++-ify get_path_in_cache(), add ConfigTester

Then use ConfigTester to test get_path_in_cache()

5 years agoUse change_extension() and remove_extension()
Thomas Otto [Wed, 30 Oct 2019 15:39:37 +0000 (16:39 +0100)] 
Use change_extension() and remove_extension()

Also remove obsolete legacy remove_extension() function.

5 years agoAdd and test change_extension()
Thomas Otto [Wed, 30 Oct 2019 15:38:28 +0000 (16:38 +0100)] 
Add and test change_extension()

New function, not ported from legacy_util. Added because remove_extension()
followed by format("%s.new_ext", name) is used quite frequently.

5 years agoAdd and test remove_extension()
Thomas Otto [Wed, 30 Oct 2019 10:26:23 +0000 (11:26 +0100)] 
Add and test remove_extension()

Works as a replacement for the legacy util function.

5 years agoAdd and test get_extension()
Thomas Otto [Wed, 30 Oct 2019 10:21:00 +0000 (11:21 +0100)] 
Add and test get_extension()

Works as a replacement for the legacy util function.

5 years agoRemove obsolete x_basename
Thomas Otto [Wed, 30 Oct 2019 09:34:08 +0000 (10:34 +0100)] 
Remove obsolete x_basename

5 years agoAdd and test and use get_truncated_base_name()
Thomas Otto [Tue, 19 Nov 2019 17:34:26 +0000 (18:34 +0100)] 
Add and test and use get_truncated_base_name()

5 years agoUse base_name() instead of x_basename()
Thomas Otto [Wed, 30 Oct 2019 09:13:43 +0000 (10:13 +0100)] 
Use base_name() instead of x_basename()

5 years agoAdd hash functions for string and string_view
Thomas Otto [Wed, 30 Oct 2019 09:09:14 +0000 (10:09 +0100)] 
Add hash functions for string and string_view

5 years agoWindows define and include restructuring (#492)
Thomas Otto [Sun, 24 Nov 2019 21:27:26 +0000 (22:27 +0100)] 
Windows define and include restructuring (#492)

Set the _WIN32_WINNT macro only once in the generated config.h.

Include <windows.h> only once in system.hpp, unless these includes
are in third party libs - however third party includes themselves
should always be behind internal includes. Therefore also make
system.hpp the first include everywhere.

5 years agoAdd handling of __TIMESTAMP__ macro (#488)
Erik Johansson [Sun, 17 Nov 2019 20:31:49 +0000 (21:31 +0100)] 
Add handling of __TIMESTAMP__ macro (#488)

__TIMESTAMP__ is expanded by the pre-processor to asctime() of the source
file's modification time. Handle __TIMESTAMP__ similar to __DATE__ and include
asctime(modification time) in the hash when __TIMESTAMP__ is detected in the
source code.

5 years agoPrepare for v3.7.6
Joel Rosdahl [Sun, 17 Nov 2019 19:09:58 +0000 (20:09 +0100)] 
Prepare for v3.7.6

(cherry picked from commit 1a4929bfd73e63ebd1b369ee116f9c57f1931824)

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 16 Nov 2019 22:39:58 +0000 (23:39 +0100)] 
Update NEWS

(cherry picked from commit 85f1e368b0e1a1633a2aeebd840601cd39b808c2)

5 years agoAlways include input file path in direct mode hash
Joel Rosdahl [Sat, 16 Nov 2019 21:59:33 +0000 (22:59 +0100)] 
Always include input file path in direct mode hash

The “file_macro sloppiness” mode is a way of opting out of inclusion of
the input file path in the direct mode hash. This can produce a false
cache hit in the following scenario:

- a/r.h exists.
- a/x.c has #include "r.h".
- b/x.c is identical to a/x.c.
- Compiling a/x.c records a/r.h in the manifest.
- Compiling b/x.c results in a false cache hit since a/x.c and b/x.c
  share manifests and a/r.h exists.

Therefore, ditch the file_macro sloppiness mode so that the input file
path is always included in the direct mode hash.

This bug has existed ever since the file_macro sloppiness was introduced
in eb5d9bd3beb5 (ccache 3.0). It has remained undetected since
compilations tend to use .d files and ccache before 3.7.5 added an
implicit “-MQ <output_file_path>” argument, thus in practice including
the output file path in the hash and therefore making manifests unique
when the object file path mirrors the source file path. However, ccache
3.7.5 no longer adds the implicit -MQ option, thus exposing the bug.

Fixes #489.

(cherry picked from commit 404eedde2b8c7a048ea1f68a8e70e49c5ea74df2)

5 years agoIgnore unknown sloppiness values in configuration files
Joel Rosdahl [Sat, 16 Nov 2019 21:51:54 +0000 (22:51 +0100)] 
Ignore unknown sloppiness values in configuration files

Similar to 22db9ed893e9: This way legacy ccache versions can still work
with modern ccache configuration keys in the configuration files.

(cherry picked from commit 75520370b8f0c5afb8141b9808de69302d085d21)

5 years agoHandle properly color diagnostics also in depend mode (#484)
Luboš Luňák [Thu, 14 Nov 2019 19:23:03 +0000 (20:23 +0100)] 
Handle properly color diagnostics also in depend mode (#484)

Compiler invocation in the depend mode uses the original arguments,
which means the added -fcolor-diagnostics (or -fdiagnostics-color)
was dropped.

5 years agoAllow -fmodules in direct depend mode (#482)
Luboš Luňák [Thu, 14 Nov 2019 19:17:22 +0000 (20:17 +0100)] 
Allow -fmodules in direct depend mode (#482)

Clang creates the internal on-disk representation of modules
in the background on demand as necessary. This means that ccache does
not need to cache that, all that it needs to cache is the actual
compilation result and the dependencies. Which in the case of modules
includes also the module.modulemap files, and Clang outputs such
dependencies correctly only in the depend mode, in the preprocessed
output there is no way to find out the module dependencies.

Therefore support -fmodules in direct depend mode by more or less
ignoring it. Tested with source build of LLVM/Clang configured
with -DLLVM_ENABLE_MODULES=On (and the build actually occassionally
fails because of module problems, but that happens regardless of ccache).

See also pull request #130 (and this reuses the tests from there).

5 years agoCorrect "-MJ" bail out, identify both "-MJ file" and "-MJfile" (#487)
Thomas Otto [Sun, 10 Nov 2019 20:36:29 +0000 (21:36 +0100)] 
Correct "-MJ" bail out, identify both "-MJ file" and "-MJfile" (#487)

Also added test to detect the invalid case TOO_HARD | TAKES_CONCAT_ARG.

5 years agoUpdate libzstd to 1.4.4
Joel Rosdahl [Tue, 5 Nov 2019 19:55:04 +0000 (20:55 +0100)] 
Update libzstd to 1.4.4

5 years agoMove tests of FormatNonstdStringView to a separate file
Joel Rosdahl [Fri, 1 Nov 2019 21:01:52 +0000 (22:01 +0100)] 
Move tests of FormatNonstdStringView to a separate file

The general idea is that unittest/test_X.cpp contains tests for
src/X.[hc]pp.

5 years agostats: Fix statistics update with full filesystem
Joel Rosdahl [Fri, 1 Nov 2019 20:30:20 +0000 (21:30 +0100)] 
stats: Fix statistics update with full filesystem

This is an improved version of the corresponding 3.x series fix in
1a432329.

5 years agoAtomicFile: Cope with write error (e.g. due to full disk) when closing
Joel Rosdahl [Fri, 1 Nov 2019 20:24:55 +0000 (21:24 +0100)] 
AtomicFile: Cope with write error (e.g. due to full disk) when closing

5 years agoFix and test interaction between fmt and nonstd::string_view (#481)
Thomas Otto [Fri, 1 Nov 2019 20:58:21 +0000 (21:58 +0100)] 
Fix and test interaction between fmt and nonstd::string_view (#481)

Empty string_views could not be handled and formatting
did not stop until the first \0 was encountered.

5 years agoTweak grammar
Joel Rosdahl [Wed, 23 Oct 2019 19:02:03 +0000 (21:02 +0200)] 
Tweak grammar

5 years agoMention the AVX2 algorithm in NEWS
Joel Rosdahl [Wed, 23 Oct 2019 18:58:09 +0000 (20:58 +0200)] 
Mention the AVX2 algorithm in NEWS

5 years agoAdd AVX2 variant of check_for_temporal_macros (#476)
Erik Johansson [Wed, 23 Oct 2019 18:52:49 +0000 (20:52 +0200)] 
Add AVX2 variant of check_for_temporal_macros (#476)

By using AVX (Advanced Vector Extensions) the search for __DATE__ and __TIME__
in the input source becomes much faster. On my machine, ccache spends ~4.9e6
cycles in check_for_temporal_macros when compiling src/ccache.cpp. With USE_AVX
set that figure goes down to ~6.7e5.

Compiling all of ccache with -mavx2 makes the unittest crash with "Illegal
instruction: 4" when run on travis (Mac OS X). My guess is that -mavx2 makes
clang generate code that uses instructions that doesn't work on the CPUs used
on the build server (see [0]).

Instead compile only check_for_temporal_macros_avx2 with -mavx2 as we can
control when that function is called (i.e. only do it when the cpu supports
it).

[0] - https://stackoverflow.com/questions/48333342/os-x-illegal-instruction-4-in-travis-ci

5 years agoFix FormatNonstdStringView.hpp name in non_third_party_headers
Joel Rosdahl [Wed, 23 Oct 2019 18:35:10 +0000 (20:35 +0200)] 
Fix FormatNonstdStringView.hpp name in non_third_party_headers

5 years agoPrepare for v3.7.5
Joel Rosdahl [Tue, 22 Oct 2019 18:48:58 +0000 (20:48 +0200)] 
Prepare for v3.7.5

(cherry picked from commit 5d9a289f594c22361c18baf41a8a9aa5bd6a1026)

5 years agoUpdate NEWS
Joel Rosdahl [Tue, 22 Oct 2019 18:16:29 +0000 (20:16 +0200)] 
Update NEWS

(cherry picked from commit e83a77c95f0853f53d4cffbd7df61dfdbd84b9d1)

5 years agoFix spelling
Joel Rosdahl [Tue, 22 Oct 2019 18:16:14 +0000 (20:16 +0200)] 
Fix spelling

(cherry picked from commit c38b0fd2441a809086fc3067968c2bcc7d2305d5)

5 years agoPlease Clang’s -Wmissing-variable-declarations
Joel Rosdahl [Tue, 22 Oct 2019 18:29:19 +0000 (20:29 +0200)] 
Please Clang’s -Wmissing-variable-declarations

(cherry picked from commit 736237aeb21eceaf7a80f13d59ad47c35d76b8bb)

5 years agoIncrease interval for cleaning up $CCACHE_DIR/tmp to 2 days
Joel Rosdahl [Tue, 22 Oct 2019 18:04:01 +0000 (20:04 +0200)] 
Increase interval for cleaning up $CCACHE_DIR/tmp to 2 days

This will reduce problems when adjusting system time; see #480.

(cherry picked from commit e1fc59223518c53ab227d224a36fe2eeead127eb)

5 years agoDon’t fail fatally if temporary cpp_stderr file is missing
Joel Rosdahl [Mon, 21 Oct 2019 18:06:22 +0000 (20:06 +0200)] 
Don’t fail fatally if temporary cpp_stderr file is missing

If the temporary cpp_stderr file is missing when the compilation command
has finished then either some user removed it or ccache removed it in
clean_up_internal_tempdir (since the compilation took more than hour or
the system clock was adjusted?). In either case, let’s just fall back to
running the real compiler instead of failing fatally.

Fixes #480 and #154.

(cherry picked from commit c74dbfe5d43fc23733bd44839b9bd119da94ba26)

5 years agoImprove functions related to (l)stat-ing
Joel Rosdahl [Sat, 19 Oct 2019 10:43:39 +0000 (12:43 +0200)] 
Improve functions related to (l)stat-ing

Introduced a Stat class that represents a “struct stat”. The class
replaces the utility functions x_lstat, x_stat, file_size_on_disk and
is_symlink, and it provides an easier to use interface than the macros
associated with stat structs.

5 years agoRemove obsolete traverse function
Joel Rosdahl [Sat, 19 Oct 2019 10:43:20 +0000 (12:43 +0200)] 
Remove obsolete traverse function

5 years agoRemove obsolete x_calloc function
Joel Rosdahl [Sat, 19 Oct 2019 10:39:35 +0000 (12:39 +0200)] 
Remove obsolete x_calloc function

5 years agoMake ccache buildable with Clang 9
Joel Rosdahl [Fri, 18 Oct 2019 17:28:33 +0000 (19:28 +0200)] 
Make ccache buildable with Clang 9

5 years agoMake remember_include_file free from gotos
Joel Rosdahl [Wed, 16 Oct 2019 18:51:50 +0000 (20:51 +0200)] 
Make remember_include_file free from gotos

5 years agoAdd Thomas Otto (totph) to .mailmap
Joel Rosdahl [Tue, 15 Oct 2019 19:20:14 +0000 (21:20 +0200)] 
Add Thomas Otto (totph) to .mailmap

5 years agoTweak contribution guidelines
Joel Rosdahl [Tue, 15 Oct 2019 18:13:19 +0000 (20:13 +0200)] 
Tweak contribution guidelines

5 years agoUse nonstd::string_view where appropriate
Joel Rosdahl [Sun, 13 Oct 2019 20:34:37 +0000 (22:34 +0200)] 
Use nonstd::string_view where appropriate

5 years agoUse #include "third_party/..." consistently to include third party code
Joel Rosdahl [Sun, 13 Oct 2019 14:44:30 +0000 (16:44 +0200)] 
Use #include "third_party/..." consistently to include third party code

5 years agoRemove now superfluous size check of uncompressed files
Joel Rosdahl [Sun, 13 Oct 2019 14:28:24 +0000 (16:28 +0200)] 
Remove now superfluous size check of uncompressed files

Uncompressed cache files have a trailing checksum as well; this wasn’t
the case earlier in the format design process.

5 years agoAdd nonstd::string_view 1.3.0
Joel Rosdahl [Sun, 13 Oct 2019 14:03:14 +0000 (16:03 +0200)] 
Add nonstd::string_view 1.3.0

5 years agoAdd nonstd::optional 3.2.0
Joel Rosdahl [Sun, 13 Oct 2019 14:01:56 +0000 (16:01 +0200)] 
Add nonstd::optional 3.2.0

5 years agoUpgrade to fmt 6.0.0
Joel Rosdahl [Sun, 13 Oct 2019 13:49:51 +0000 (15:49 +0200)] 
Upgrade to fmt 6.0.0

5 years agoPretty-print embedded_file_type in log messages
Joel Rosdahl [Sat, 19 Oct 2019 08:57:24 +0000 (10:57 +0200)] 
Pretty-print embedded_file_type in log messages

5 years agoReduce casting related to FileType
Joel Rosdahl [Sat, 19 Oct 2019 08:37:08 +0000 (10:37 +0200)] 
Reduce casting related to FileType

5 years agoConvert result type string to an enum (#478)
Thomas Otto [Sat, 19 Oct 2019 08:28:57 +0000 (10:28 +0200)] 
Convert result type string to an enum (#478)

5 years agoFix warning during configure in out of tree build (#479)
Erik Johansson [Fri, 18 Oct 2019 17:25:44 +0000 (19:25 +0200)] 
Fix warning during configure in out of tree build (#479)

../configure: line 2250: src/version.cpp: No such file or directory

5 years agotest output: only use ansi codes when run in a terminal
Thomas Otto [Thu, 17 Oct 2019 11:26:50 +0000 (13:26 +0200)] 
test output: only use ansi codes when run in a terminal

5 years agotest output: improve readability on light backgrounds
Thomas Otto [Thu, 17 Oct 2019 09:33:43 +0000 (11:33 +0200)] 
test output: improve readability on light backgrounds

`bold()` now only writes bold text, not bold and white text

5 years agoRemove left-over CacheEntryReader::CacheEntryReader doc string
Joel Rosdahl [Sun, 13 Oct 2019 14:04:30 +0000 (16:04 +0200)] 
Remove left-over CacheEntryReader::CacheEntryReader doc string

5 years agoFix comment after renaming util.cpp to legacy_util.cpp
Joel Rosdahl [Sun, 13 Oct 2019 14:28:03 +0000 (16:28 +0200)] 
Fix comment after renaming util.cpp to legacy_util.cpp

5 years agoAdd missing #pragma once to File.hpp
Joel Rosdahl [Mon, 14 Oct 2019 16:56:50 +0000 (18:56 +0200)] 
Add missing #pragma once to File.hpp