Joel Rosdahl [Tue, 14 Jul 2020 13:08:22 +0000 (15:08 +0200)]
Probe assembler for supported -m* flags
Since CMake uses the assembler executable for compiling assembler source
code it’s not quite correct to probe the C++ compiler (nor the C
compiler) since it may not be the same as the assembler.
Joel Rosdahl [Mon, 13 Jul 2020 11:39:45 +0000 (13:39 +0200)]
Remove dependency on std::regex
std::regex is not available for GCC 4.8. It’s also a bit bloated. The
reason for not using POSIX regex functionality is that it’s not
available in MinGW.
Joel Rosdahl [Wed, 8 Jul 2020 07:54:50 +0000 (09:54 +0200)]
Remove short read optimization from #551
I don’t feel confident about assuming that a short read for a file means
EOF in all situations. For instance, it looks like short reads can
happen of an NFS file system mounted with the “intr” option, and it can
also happen if a file entry actually is a named pipe.
Joel Rosdahl [Sat, 4 Jul 2020 11:52:16 +0000 (13:52 +0200)]
Refactor result code into a Result::Reader/Writer classes
Introduced a Result::Reader class which remove knowledge about what to
do with the individual file parts of a result. That’s instead defined by
a Result::Reader::Consumer instance passed to Result::Reader::read. This
means a ResultFileMap is no longer used and that the consumer is free to
write data whereever it wants.
The new ResultRetriever class implements retrieval by writing to local
files like before, except that the stderr data is written directly to
STDERR_FILENO instead of landing in a temporary file.
The new ResultDumper class implements “ccache --dump-result”.
Also introduced a Result::Writer class, mostly for symmetry with the
Result::Reader class.
Joel Rosdahl [Sun, 5 Jul 2020 19:00:47 +0000 (21:00 +0200)]
Tweak ci/build script
- Removed redundant “exit 0” command again.
- Removed now obsolete and misleading comments.
- If JOBS is set to the empty string then detect the number of CPUs instead
of running a limitless number of jobs.
Joel Rosdahl [Sun, 5 Jul 2020 18:35:05 +0000 (20:35 +0200)]
Use a known and set TERM variable to stabilize color_diagnostics tests
On some distributions TERM is unset when run via Docker which failed
color_diagnostics tests since ccache doesn’t enable color output if TERM
is unset. Fix this by using a known TERM value.
Joel Rosdahl [Sun, 5 Jul 2020 18:34:54 +0000 (20:34 +0200)]
Skip “Directory is not hashed if using -gz[=zlib]” tests for GCC 6
The GCC 6 (tested with GCC 6.3) preprocessor includes the current
working directory in the preprocessed output if run with -gz, which
means that there won’t be cache hits between directories, thus failing
the “Directory is not hashed if using -gz[=zlib]” tests. Fix this by
skipping the test if the preprocessor behaves that way.
Joel Rosdahl [Wed, 24 Jun 2020 07:26:23 +0000 (09:26 +0200)]
Fix color_diagnostics test failure if CCACHE_DIR is set in shell rc file
If the user sets CCACHE_DIR in a shell startup file then that value will
override the one from the test suite, thus making changes in cache
statistics invisible which triggers failures.
Joel Rosdahl [Tue, 23 Jun 2020 19:57:26 +0000 (21:57 +0200)]
Rename generated Version.cpp to version.cpp
The convention is to use capitalized filenames for source files that
implement classes and namespaces and lowercase filenames for source
files that do not.
Olle Liljenzin [Mon, 22 Jun 2020 19:57:59 +0000 (21:57 +0200)]
Reduce number of memory allocations in hashing (#608)
Add hash_buffer_once method for hashing a given text immediately using a
stack allocated hasher. Also skip copying the hasher in hash_result as
blake3 is not modifying the hasher.
Joel Rosdahl [Sun, 21 Jun 2020 19:29:04 +0000 (21:29 +0200)]
Remove win32 GetFileNameFromHandle compatibility function
The replacement function seems to be buggy, triggering failures in
x_realpath at least when the unit tests are run in Wine. The real
GetFinalPathNameByHandle function is allegedly supported in Windows
Vista and newer, so let’s just use it.
Joel Rosdahl [Thu, 18 Jun 2020 19:46:22 +0000 (21:46 +0200)]
Improve comment of inode cache version and revert to version 1 again
As noted by Olle Liljenzin, changing the hash algorithm does not require
incrementing the version field, so let’s revert the change I made as
part of 2a0dd8ef.
Joel Rosdahl [Thu, 18 Jun 2020 18:26:58 +0000 (20:26 +0200)]
Let “ccache --hash-file” perform raw hashing again
Unintended or not, #577 (213d9883) changed the behavior of “ccache
--hash-file” to use hash_binary_file, which essentially performs
hash(hash(path)) if the i-node cache is enabled, otherwise hash(path).
This means that “ccache --hash-file” behaves differently depending on if
i-node cache is enabled and also that it’s no longer usable for
benchmarking purposes.
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.