Joel Rosdahl [Sun, 14 Jun 2020 19:09:24 +0000 (21:09 +0200)]
Improve INSTALL.md after CMake-ification
I chose to mention “-DCMAKE_BUILD_TYPE=Release” explicitly since some
end users will clone the repository instead of downloading the release
archive and then the default “Debug” build won’t be a great idea.
Joel Rosdahl [Sun, 14 Jun 2020 18:59:13 +0000 (20:59 +0200)]
Don’t update author list when generating documentation
Motivation:
1. The copyright notice in each source file refers to doc/AUTHORS.adoc
for the list of contributors. If we only update AUTHORS.adoc when
generating documention then AUTHORS.adoc will become more and more
out of date until somebody remembers to commit the changes.
2. The list is based on commit authors, but authors may sometimes need
an entry in .mailmap so there’s manual work involved to sanity check
the list. It can also happen that some commits or authors may need to
be excluded.
Therefore I prefer to keep AUTHORS.adoc manually updated at release time
(or occasionally more often) with the help of a script just like before.
Joel Rosdahl [Sun, 14 Jun 2020 18:45:23 +0000 (20:45 +0200)]
Remove cmake-format check and support
Motivation:
1. It’s unsatisfying to have to remember to run “make format” after
editing CMake files. (Clang-Format has more editor integrations, and
most importantly there are integrations for my editor of choice.)
2. The output of cmake-format seems to be a bit unstable between
versions.
3. I don’t like some of cmake-format’s formatting choices. This could be
potentially be improved, though.
Let’s remove the support for now and maybe revisit later.
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.
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 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 [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.