Joel Rosdahl [Sun, 11 Jul 2021 19:57:40 +0000 (21:57 +0200)]
Remove read-only tests of HTTP and Redis storage backends
The “read-only” tests in secondary_http and secondary_redis were
inspired by the “read-only” test in secondary_file. However, that test
actually verifies the secondary storage *framework*, not the storage
backend itself, so it’s enough to just do it in secondary_file.
Joel Rosdahl [Sun, 11 Jul 2021 19:51:49 +0000 (21:51 +0200)]
Make secondary_http and secondary_redis tests independent
Instead of starting an HTTP or Redis server that lives for the duration
of the test suite, start a new one for each test case. This makes tests
more independent and also opens up for future testing of e.g. different
ports and authentication modes by allowing different server
configurations for each test case.
Joel Rosdahl [Sat, 10 Jul 2021 19:24:35 +0000 (21:24 +0200)]
Touch up Redis storage code slightly
Note: Unlike atoi, std::stoi throws an exception on conversion error so
use Util::parse_unsigned instead which throws an exception that is
caught correctly.
Gregor Jasny [Mon, 5 Jul 2021 18:18:18 +0000 (20:18 +0200)]
Fix CMake feature detection (#883)
When enabling CMake policy
<https://cmake.org/cmake/help/latest/policy/CMP0067.html> by either enabling it
directly or via a `cmake_minimum_required` of `3.8` or later, the
`test.inode_cache` test starts to fail.
This happens because this policy slightly changes the `CheckCSourceCompiles`
logic by passing-in any configured C-standard. The detection of the following
features now report absence:
To remedy the situation CMake now checks for those features within a C++
language context. In C++ those features seem to be available without enabling
any extra extensions.
It also makes the check more precise because all of the consumers are C++ (and
not C) compilation units.
Joel Rosdahl [Thu, 1 Jul 2021 06:34:54 +0000 (08:34 +0200)]
Fix source file suffix selection for libblake3
In the add_source_if_enabled function in
src/third_party/blake3/CMakeLists.txt, the suffix variable is unset on a
CMake reconfigure in an already configured build tree. This makes CMake
guess the extension and always choose “.c” on a reconfigure.
Gregor Jasny [Tue, 29 Jun 2021 09:42:50 +0000 (11:42 +0200)]
Fix Apple Clang detection
Apple Clang, when called via `gcc` emits a `Configured with` line
on stderr which confuses the compiler detection. We just ignore
stderr for the `--version` query now.
Joel Rosdahl [Sun, 27 Jun 2021 18:34:06 +0000 (20:34 +0200)]
Include $PWD in hash for -fprofile-generate with relative directory
For a relative profile directory D, GCC stores $PWD/D as part of the
profile filename in an object file generated with -fprofile-generate, so
we need to include the same information in the hash.
Joel Rosdahl [Wed, 23 Jun 2021 14:27:51 +0000 (16:27 +0200)]
Implement configurations, API and framework for secondary storage
This introduces the possibility to add one or several secondary storage
backends to query after the primary cache storage. Note that cache
statistics counters will still be kept in the primary cache directory --
secondary storage backends only store cache results and manifests.
The API should now be ready enough to implement secondary storage
backends.
The framework is also ready enough for usage, but lacks two major things
that are still to be implemented:
1. Improved statistics handling. Up until now, ccache always increments
exactly one statistics counter for each invocation (e.g. “hit”,
“miss” or “some error”). Since I want to have separate statistics for
primary and secondary storage, this model no longer works since an
invocation can result in both a “primary miss” and a “secondary hit”.
2. Improved PrimaryStorage interface. The SecondaryStorage interface
works with memory data, but PrimaryStorage, Result and Manifest still
work with files at the API level. This means that if an invocation is
a primary storage miss but a secondary storage hit, the data from
secondary storage has to be written to a temporary file only to be
read back into memory again by the Result/Manifest deserialization
code.
Michael Kruse [Sun, 20 Jun 2021 19:20:40 +0000 (14:20 -0500)]
Use single command line arg for /FI (#869)
CMake seems to interpret /FI and its argument as two separate options.
For instance, CMake de-duplicates arguments, leading any to non-first
/FI flag to be removed. This might be the reason why the option is not
honored with Visual Studio 16.10.2 / CMake 3.20.3.
Fix by combining /FI and its argument into a single command line option.
Michael Kruse [Sun, 20 Jun 2021 19:19:52 +0000 (14:19 -0500)]
Add sloppy include_file_mtime to ivfsoverlay test (#868)
Add CCACHE_SLOPPINESS=include_file_mtime to ivfsoverlay test. This is
possibly due to me using my self-compiled clang since it does not fail
with the version of Clang that comes with Ubuntu 20.04.
Joel Rosdahl [Fri, 18 Jun 2021 18:47:17 +0000 (20:47 +0200)]
Require C++14-compatible compiler to build ccache
Ccache 4.0 introduced a requirement on a C++11-compatible compiler. The
language version was primarily chosen to support CentOS 7.
The time has now come to bump to C++14, to among other things get access
to generic lambda expressions and improved constexpr functions. Another
side effect is to get usable support for std::regex due to requiring a
newer GCC than 4.8 which lacks such support.
r-burns [Thu, 17 Jun 2021 18:16:52 +0000 (11:16 -0700)]
Explicitly select C++ when using -fcxx-modules (#861)
Typically, clang is able to auto-detect C++ files and switch to C++
mode, even when `argv[0]` is simply `clang` (without the `++`).
However, Nixpkgs provides `clang` as a wrapper script over the
underlying compiler binary, and only enables C++ standard library
include paths when it thinks it's being invoked as a C++ compiler:
So for the benefit of less clever compiler toolchains which
can't always see that these invocations are using C++ mode,
we explicitly specify `-x c++` so they do the right thing.
Joel Rosdahl [Tue, 15 Jun 2021 19:02:29 +0000 (21:02 +0200)]
Document the plan of changing naming conventions for namespaces
Namespaces are from now on planned to be in snake_case instead of
UpperCamelCase. This is of course entirely due to cosmetical reasons,
but I feel that it maps better to the upcoming changes in directory
structure where I don’t want camel-case directory names.
Joel Rosdahl [Sun, 30 May 2021 18:40:35 +0000 (20:40 +0200)]
Include config.h via command line instead of via system.h
This makes the definitions in config.h available to all source code,
including third_party_lib. It’s also a first step towards not having to
include system.hpp and its libc headers from all files.
Joel Rosdahl [Sun, 30 May 2021 18:20:07 +0000 (20:20 +0200)]
Improve defines for third_party_lib
- Don’t filter out useful warnings like warning about implicit function
declarations.
- Apply definitions in config.h to third party source code instead of
passing feature defines as a special case.