]>
git.ipfire.org Git - thirdparty/ccache.git/log
Alexander Lanin [Sun, 14 Jun 2020 07:59:00 +0000 (09:59 +0200)]
Switch to CMake (#573)
Co-authored-by: Cristian Adam <cristian.adam@gmail.com>
Co-authored-by: Joel Rosdahl <joel@rosdahl.net>
Joel Rosdahl [Mon, 8 Jun 2020 20:07:54 +0000 (22:07 +0200)]
Require working script command for the color_diagnostics test suite
Joel Rosdahl [Mon, 8 Jun 2020 19:51:32 +0000 (21:51 +0200)]
portability: Don’t pass “-r” to sed
Joel Rosdahl [Sun, 7 Jun 2020 18:47:33 +0000 (20:47 +0200)]
Make hard-linked files read-only for safety
Joel Rosdahl [Sun, 7 Jun 2020 18:46:04 +0000 (20:46 +0200)]
Mention in manual that only object files are hard-linked
As implemented in
82ecace9 .
Joel Rosdahl [Sun, 7 Jun 2020 18:04:05 +0000 (20:04 +0200)]
Add more tests for dependency file content
Joel Rosdahl [Sun, 7 Jun 2020 13:57:39 +0000 (15:57 +0200)]
Remove redundant #includes
Matt Whitlock [Sun, 7 Jun 2020 13:43:33 +0000 (09:43 -0400)]
Always cache colored diagnostics and strip color codes as appropriate (#596)
Joel Rosdahl [Sat, 6 Jun 2020 18:57:37 +0000 (20:57 +0200)]
Upgrade Travis-CI environment to Ubuntu 18.04
Joel Rosdahl [Mon, 1 Jun 2020 14:56:53 +0000 (16:56 +0200)]
Fix variable name
Joel Rosdahl [Mon, 1 Jun 2020 14:56:37 +0000 (16:56 +0200)]
Add missing TestContext instantiation
Joel Rosdahl [Mon, 1 Jun 2020 07:53:24 +0000 (09:53 +0200)]
Mention inode cache in NEWS
Joel Rosdahl [Sun, 31 May 2020 10:53:02 +0000 (12:53 +0200)]
Improve inode_cache test suite to not truncate CCACHE_LOGFILE
Joel Rosdahl [Sun, 31 May 2020 10:52:44 +0000 (12:52 +0200)]
Fix some trivial code style issues
Olle Liljenzin [Sun, 31 May 2020 10:02:12 +0000 (12:02 +0200)]
Add inode cache for file hashes (#577)
The inode cache is a process shared cache that maps from device, inode,
size, mtime and ctime to saved hash results. The cache is stored
persistently in a single file that is mapped into shared memory by
running processes, allowing computed hash values to be reused both
within and between builds.
The chosen technical solution works for Linux and might work on other POSIX
platforms, but is not meant to be supported on non-POSIX platforms
such as Windows.
Use 'ccache -o inode_cache=true/false' to activate/deactivate the cache.
Joel Rosdahl [Fri, 29 May 2020 18:43:19 +0000 (20:43 +0200)]
Only try to hard link object files to/from the cache
The compiler unlinks the destination object file before writing, but it
apparently doesn’t do that for dependency files. This means that
compilation can corrupt a .d file that shares i-node with a cached .d
file when using the hard link mode. Here is a scenario where this can
happen:
1. There is a test.c which includes test.h.
2. When test.c is compiled, the compiler writes test.d which mentions
test.h and ccache hard links test.d into cache entry 1. test.d and
cache entry 1's .d file now share i-nodes.
3. The include of test.h is removed from test.c.
4. When test.c is compiled again the compiler overwrites test.d with new
content without test.h and ccache hard links test.d into cache entry
2. test.d, cache entry 1 and cache entry 2 now share i-nodes, all of
which contain the new content without test.h.
Since we can’t be sure how the compiler behaves for other types of files
(.dwo, .cov, etc.), only try to to hard link object files.
Fixes #599.
(cherry picked from commit
443afc179e1de3f050850103a5ba62e3cb5ab398 )
Joel Rosdahl [Fri, 29 May 2020 18:53:22 +0000 (20:53 +0200)]
Add missing O_TRUNC in copy_file and clone_file
Joel Rosdahl [Tue, 26 May 2020 19:57:42 +0000 (21:57 +0200)]
Move ThreadPool methods to .cpp file
Joel Rosdahl [Mon, 25 May 2020 19:25:41 +0000 (21:25 +0200)]
Clean up profiling_clang test suite probing
Joel Rosdahl [Sun, 24 May 2020 09:44:50 +0000 (11:44 +0200)]
Handle incapability of determining home directory more gracefully
Joel Rosdahl [Sun, 24 May 2020 09:25:06 +0000 (11:25 +0200)]
Convert last usage of putenv
Joel Rosdahl [Sun, 24 May 2020 08:47:59 +0000 (10:47 +0200)]
Remove comments with motivation for “clang-format off/on”
The motivation is available in the Git history.
Joel Rosdahl [Sun, 24 May 2020 08:47:46 +0000 (10:47 +0200)]
Fix capitalization of Clang
Joel Rosdahl [Sun, 24 May 2020 08:27:36 +0000 (10:27 +0200)]
Use STDERR_FILENO/STDOUT_FILENO constants
Joel Rosdahl [Sun, 24 May 2020 08:23:08 +0000 (10:23 +0200)]
Clean up
Joel Rosdahl [Wed, 20 May 2020 19:26:35 +0000 (21:26 +0200)]
Handle all Intel “-xCODE” compiler options correctly
“CODE” in the Intel compiler’s “-xCODE” option for specifying processor
features seems to always start with an uppercase letter, and since GCC’s
language specifications always are lowercase we can just treat uppercase
codes as an ordinary compiler argument.
Joel Rosdahl [Tue, 19 May 2020 18:37:19 +0000 (20:37 +0200)]
Improve temp file handling
- Use Util::create_temp_fd instead of legacy create_tmp_fd.
- Use Context::register_pending_tmp_file instead of unlinking
explicitly.
- Simplified output of merged stderr from preprocessor and compiler.
Joel Rosdahl [Mon, 18 May 2020 18:17:09 +0000 (20:17 +0200)]
Add test case for merging stderr from preprocessor and compiler
Joel Rosdahl [Mon, 18 May 2020 18:03:24 +0000 (20:03 +0200)]
Use std::ios_base::openmode as the third Util::write_file parameter
Joel Rosdahl [Mon, 18 May 2020 06:26:14 +0000 (08:26 +0200)]
Refactor signal handling and process exit code
* Added a SignalHandler class which encapsulates parts related to signal
handling.
* Moved data referenced by the exit functions to Context (compiler PID,
pending temporary files and pending debug log files).
* Let the Context destructor do what the exitfn functionality used to
do.
* Removed the now superfluous exitfn functionality.
Joel Rosdahl [Sat, 16 May 2020 14:17:44 +0000 (16:17 +0200)]
C++-ify unlink wrapper functions
x_unlink(p) == 0 -> Util::unlink_safe(p)
x_try_unlink == 0 -> Util::unlink_safe(p, Util::UnlinkLog::ignore_failure)
tmp_unlink(p) == 0 -> Util::unlink_tmp(p)
Joel Rosdahl [Sat, 16 May 2020 14:06:28 +0000 (16:06 +0200)]
Revert "Merge catch2_tests into unittest’s main"
This reverts commit
4608eb6d6c41aefb7c5f534166901e051e126115 .
Since unittest/main.cpp includes src/Util.hpp it’s still too painful to
compile the Catch2 runner, so let’s keep it separate.
Joel Rosdahl [Fri, 15 May 2020 20:14:34 +0000 (22:14 +0200)]
Use raw string literals for version and usage texts
Joel Rosdahl [Fri, 15 May 2020 19:10:45 +0000 (21:10 +0200)]
Default to zstd compression level 1
After some experiments my evaluation is that the increased compression
ratio of level 1 is worth the very slight decrease in compression speed.
Joel Rosdahl [Fri, 15 May 2020 19:06:27 +0000 (21:06 +0200)]
Add and use win32_error_message function
Joel Rosdahl [Fri, 15 May 2020 18:14:36 +0000 (20:14 +0200)]
Remove overengineered win32 gethostname fallback code
Let’s assume that all systems we reasonably support have access to
gethostname. If not, revisit later.
Regarding the win32 case: Since the replacement code (triggered if
HAVE_GETHOSTNAME isn’t defined) itself uses gethostname, just use
gethostname.
Joel Rosdahl [Fri, 15 May 2020 17:30:26 +0000 (19:30 +0200)]
Add unit test for config key tables consistency
Joel Rosdahl [Thu, 14 May 2020 19:50:54 +0000 (21:50 +0200)]
Refactor away temp_dir()
Joel Rosdahl [Thu, 14 May 2020 19:12:20 +0000 (21:12 +0200)]
Extract internal tracing stuff to a separate file
Joel Rosdahl [Wed, 13 May 2020 19:17:05 +0000 (21:17 +0200)]
Remove unit test comments that are hard to keep up to date
Joel Rosdahl [Wed, 13 May 2020 16:50:51 +0000 (18:50 +0200)]
Remove now obsolete unittest utils
Joel Rosdahl [Wed, 13 May 2020 16:50:45 +0000 (18:50 +0200)]
Convert create_file usage to Util::write_file
Joel Rosdahl [Wed, 13 May 2020 16:43:47 +0000 (18:43 +0200)]
Merge catch2_tests into unittest’s main
The Catch2 runner was previously compiled separately since it’s slow to
compile, but after the removal of the old test framework there should be
little reason to modify unittest/main.cpp often.
Joel Rosdahl [Wed, 13 May 2020 16:19:19 +0000 (18:19 +0200)]
C++-ify argprocessing test suite
Joel Rosdahl [Sun, 10 May 2020 17:43:15 +0000 (19:43 +0200)]
Remove last traces of the old unittest framework
Joel Rosdahl [Sun, 10 May 2020 17:28:00 +0000 (19:28 +0200)]
Add TestContext to test cases that create local files
Joel Rosdahl [Sun, 10 May 2020 07:13:41 +0000 (09:13 +0200)]
Implement TestUtil::TestContext
Joel Rosdahl [Sun, 10 May 2020 07:13:31 +0000 (09:13 +0200)]
Implement Util::wipe_path
Joel Rosdahl [Sun, 10 May 2020 06:36:47 +0000 (08:36 +0200)]
Use Util::traverse in Util::clean_up_internal_tempdir
Joel Rosdahl [Sat, 9 May 2020 20:34:16 +0000 (22:34 +0200)]
Use Util::traverse in Util::get_level_1_files
Joel Rosdahl [Sat, 9 May 2020 18:56:44 +0000 (20:56 +0200)]
Implement Util::traverse
Joel Rosdahl [Sat, 9 May 2020 11:17:35 +0000 (13:17 +0200)]
Use using instead of typedef
Joel Rosdahl [Fri, 8 May 2020 19:43:27 +0000 (21:43 +0200)]
Convert legacy_util test suite to Catch2
Joel Rosdahl [Fri, 8 May 2020 19:39:12 +0000 (21:39 +0200)]
Convert hashutil test suite to Catch2
Joel Rosdahl [Fri, 8 May 2020 19:36:44 +0000 (21:36 +0200)]
Convert hash test suite to Catch2
Joel Rosdahl [Fri, 8 May 2020 19:32:19 +0000 (21:32 +0200)]
Convert compopt test suite to Catch2
Joel Rosdahl [Fri, 8 May 2020 19:31:03 +0000 (21:31 +0200)]
Convert argument_processing test suite to Catch2
Joel Rosdahl [Fri, 8 May 2020 19:26:33 +0000 (21:26 +0200)]
Remove obsolete ScopeGuard
Joel Rosdahl [Fri, 8 May 2020 18:17:15 +0000 (20:17 +0200)]
Upgrade string-view-lite to 1.4.0
Joel Rosdahl [Fri, 8 May 2020 18:11:53 +0000 (20:11 +0200)]
Guess compiler using substring search again
Regression in
30c10e8791bd02a8a3b13beeda875adbefa8c7ab .
Joel Rosdahl [Fri, 8 May 2020 18:03:25 +0000 (20:03 +0200)]
Remove now obsolete from_cstr function
Joel Rosdahl [Fri, 8 May 2020 18:02:31 +0000 (20:02 +0200)]
C++-ify get_result_name_from_cpp
Joel Rosdahl [Fri, 8 May 2020 05:26:14 +0000 (07:26 +0200)]
Speed up check-syntax rule
Joel Rosdahl [Fri, 8 May 2020 05:25:48 +0000 (07:25 +0200)]
Fix typo in manifest_get log message
Olle Liljenzin [Fri, 8 May 2020 17:12:05 +0000 (19:12 +0200)]
Support clang options for compiling with sampled profiles (#589)
Add support for -fprofile-sample-use and -fprofile-sample-accurate.
Joel Rosdahl [Thu, 7 May 2020 17:44:26 +0000 (19:44 +0200)]
Remove legacy args API
Joel Rosdahl [Thu, 7 May 2020 17:32:53 +0000 (19:32 +0200)]
Remove last usage of legacy args->argv wrapper
Joel Rosdahl [Thu, 7 May 2020 17:13:46 +0000 (19:13 +0200)]
Remove last usage of legacy args_strip function
Joel Rosdahl [Thu, 7 May 2020 17:12:31 +0000 (19:12 +0200)]
Remove last usage of legacy args_set function
Joel Rosdahl [Thu, 7 May 2020 17:11:44 +0000 (19:11 +0200)]
Remove last usage of legacy args_remove_first function
Joel Rosdahl [Thu, 7 May 2020 17:00:48 +0000 (19:00 +0200)]
Remove last usage of legacy args_pop function
Joel Rosdahl [Thu, 7 May 2020 16:58:45 +0000 (18:58 +0200)]
Remove last usage of legacy args_init_from_string function
Joel Rosdahl [Thu, 7 May 2020 16:57:57 +0000 (18:57 +0200)]
Remove last usage of legacy args_init_from_gcc_atfile function
Joel Rosdahl [Thu, 7 May 2020 16:57:15 +0000 (18:57 +0200)]
Remove last usage of legacy args_init function
Joel Rosdahl [Thu, 7 May 2020 16:56:07 +0000 (18:56 +0200)]
Remove last usage of legacy args_extend function
Joel Rosdahl [Thu, 7 May 2020 16:54:45 +0000 (18:54 +0200)]
Remove last usage of legacy args_add_prefix function
Joel Rosdahl [Thu, 7 May 2020 16:53:36 +0000 (18:53 +0200)]
Remove last usage of legacy args_add function
Joel Rosdahl [Thu, 7 May 2020 16:32:10 +0000 (18:32 +0200)]
C++-ify process_args
Joel Rosdahl [Thu, 7 May 2020 16:18:46 +0000 (18:18 +0200)]
Extract code for handling dependency environment variables to a function
Joel Rosdahl [Wed, 6 May 2020 19:47:32 +0000 (21:47 +0200)]
C++-ify final parts of process_arg
Joel Rosdahl [Wed, 6 May 2020 19:32:22 +0000 (21:32 +0200)]
C++-ify language functions
Joel Rosdahl [Wed, 6 May 2020 17:07:40 +0000 (19:07 +0200)]
C++-ify parts of process_arg
Joel Rosdahl [Wed, 6 May 2020 16:29:29 +0000 (18:29 +0200)]
C++-ify compopt functions somewhat
Joel Rosdahl [Wed, 6 May 2020 11:34:26 +0000 (13:34 +0200)]
Remove obsolete CHECK_DOUBLE_EQ macro
Joel Rosdahl [Wed, 6 May 2020 11:31:34 +0000 (13:31 +0200)]
Remove obsolete path_exists function
Joel Rosdahl [Tue, 5 May 2020 18:31:24 +0000 (20:31 +0200)]
Handle Intel compiler option “-xHost” correctly
Fixes #587.
Joel Rosdahl [Tue, 5 May 2020 13:02:13 +0000 (15:02 +0200)]
Use args[i] consistently to refer to the argument in process_arg
A shorter alias is nice but breaks symmetry when code needs to process
args[i + 1], etc.
Joel Rosdahl [Tue, 5 May 2020 12:59:06 +0000 (14:59 +0200)]
C++-ify -optf/--options-file processing in process_arg
This also makes the implementation acually work with multiple option
files delimited by commas.
Joel Rosdahl [Tue, 5 May 2020 12:58:07 +0000 (14:58 +0200)]
C++-ify parts of process_arg
Joel Rosdahl [Tue, 5 May 2020 12:55:39 +0000 (14:55 +0200)]
Improve Args::from_gcc_atfile
Scanning for the null character from the string is more efficient.
Joel Rosdahl [Sun, 3 May 2020 07:23:40 +0000 (09:23 +0200)]
Simplify detect_pch
Joel Rosdahl [Sat, 2 May 2020 11:18:04 +0000 (13:18 +0200)]
C++-ify detect_pch
Joel Rosdahl [Sat, 2 May 2020 11:07:55 +0000 (13:07 +0200)]
C++-ify ArgumentProcessingState members
Joel Rosdahl [Sat, 2 May 2020 11:05:18 +0000 (13:05 +0200)]
Improve ordering of ArgumentProcessingState members
Joel Rosdahl [Sat, 2 May 2020 10:55:57 +0000 (12:55 +0200)]
C++-ify ArgsInfo::debug_prefix_maps
Joel Rosdahl [Sat, 2 May 2020 10:46:39 +0000 (12:46 +0200)]
C++-ify ArgsInfo::arch_args
Joel Rosdahl [Sat, 2 May 2020 07:15:53 +0000 (09:15 +0200)]
C++-ify ArgsInfo::sanitize_blacklists
Joel Rosdahl [Fri, 1 May 2020 20:45:36 +0000 (22:45 +0200)]
Extract argument processing code to a separate file
Joel Rosdahl [Mon, 4 May 2020 20:30:03 +0000 (22:30 +0200)]
Fix build error with --enable-tracing
Joel Rosdahl [Fri, 1 May 2020 20:44:01 +0000 (22:44 +0200)]
Extract make_relative_path to Util