| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
If a non-temporal identifier, that ends with a temporal macro, happens
to be at the end of the buffer with the temporal suffix starting on the
avx boundary, then it would be incorrectly classified as a temporal
macro. This since the helper function lacks the context to see that the
data before the match is something that invalidates the match.
|
| | |
|
| |
|
|
|
| |
Using the FMT macro explicitly makes invalid format message
constructions compile-time errors instead of run-time errors.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As mentioned in discussion #1086: If the inode cache is enabled,
hash_source_code_file will on an inode cache hit fail to hash time
information if there are temporal macros in the code. This is because
hash_source_code_string (called from hash_source_code_file via
hash_source_code_file_nocache) on an inode cache miss adds time
information to the hash in case one of those macros were found. However,
on an inode cache hit the return value of hash_source_code_file will be
correctly fetched from the cache, but the hash sum will only be updated
with (the hash of) the include file and not the time information.
The fix is to let the inode cache only cache the effects of hashing the
file and checking for macros, not the hashing of time information since
that's volatile.
After the fix:
- The new do_hash_file function performs file hashing and macro
checking. The inode cache caches this step.
- hash_source_code_file returns a Digest instead of adding data to a
Hash.
- hash_source_code_file calls do_hash_file and then potentially hashes
time information. If there are no temporal macros the returned digest
will be identical to the file hash, otherwise the returned digest will
be of a hash of file content hash + time information.
This also improves hashes that are stored in the direct mode manifest:
Previously they were always the hash of the file content hash but now
they are just the file content hash in the common case when there is no
__DATE__ or __TIMESTAMP__ macro in the file.
|
| |
|
|
|
|
|
|
| |
Setting up ccache to masquerade as a compiler has always meant using
symbolic links, but there is no technical reason why that has to be the
case. This commit adds support for masquerading via a copy or hard link
of the ccache executable as well. This is mostly useful on platforms or
file systems where symbolic links are not supported.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This is the next step after a57f70eda32e99221de56f5499079b4f00dc2bc5.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR #755 (be1ed774) made it so that the value of SOURCE_DATE_EPOCH is
ignored if time_macros sloppiness is set. A downside of this is
naturally that the user has to set sloppiness if SOURCE_DATE_EPOCH is
set in the environment.
Insight: SOURCE_DATE_EPOCH actually only ever changes the result if the
source code contains __DATE__. __TIME__ is not an issue since ccache
disables the direct mode if __TIME__is present and the preprocessor mode
will then see the actual expansion regardless of any SOURCE_DATE_EPOCH
value. Finally, the __TIMESTAMP__ case is not applicable at all since
it’s not affected by SOURCE_DATE_EPOCH.
Therefore, make sure to only hash SOURCE_DATE_EPOCH if we find __DATE__.
The user then does not have to set sloppiness to get direct mode hits
for files that don’t contain __DATE__.
|
| | |
|
| |
|
|
| |
See also 4413d842e23c6fa52ec411951a4ab442f42227de.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fmtlib can detect format string errors at compile time if (1) applying
FMT_STRING to the format string literal and (2) compiling for C++14 or
higher.
Requirement 1 is implemented by introducing a LOG macro which applies
FMT_STRING to the first argument and calls Logging::log (if logging is
enabled). Also added are a companion LOG_RAW macro (since C++11 requires
at least one argument for the “...” part in variadic macros) and a
BULK_LOG macro which calls Logging::bulk_log (if logging is enabled).
Requirement 2 is implemented by setting CMAKE_CXX_STANDARD to 14 for one
CI build with a known C++14-capable compiler. We can’t set it to 14 by
default since we still want the code to be buildable with C++11
compilers.
This will catch errors such as the one fixed by PR #691.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Use BLAKE3 machinery for detecting AVX2 support
Instead of relying on the sometimes broken __builtin_cpu_support. See
discussion in #689.
* Require GCC >= 5.0 to enable AVX2 support
On e.g. GCC 4.8.5 the build fails with:
error: ‘__m256i’ does not name a type
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ubuntu-20.04 VM has intermittent build errors that look like this:
sudo apt-get install libzstd-dev clang-tidy
[...]
The following packages have unmet dependencies:
clang-tidy : Depends: clang-tidy-10 (>= 10~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Clang-Tidy 9 also found “function ... has a definition with different
parameter names” warnings that needed to be fixed as part of this.
As discussed in #670.
|
| | |
|
| |
|
|
|
| |
This makes the naming more consistent with the other exception classes
(Error and Failure).
|
| | |
|
| |
|
|
|
| |
I think that this improves code readability since it’s more clear what
the code flow is.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Simplified and C++-ified logging code.
- Added Logging::log and Logging::bulk_log functions corresponding to
the old cc_log and cc_bulklog functions. The new functions pass their
arguments to fmt::format.
- Replacements:
* init_log → Logging::init
* cc_log → Logging::log
* cc_bulklog → Logging::bulk_log
* cc_log_argv → Logging::log plus Util::format_argv_for_logging
* cc_dump_debug_log_buffer -> Logging::dump_log
- A legacy cc_log implementation is still available so that logging can
be converted gradually to the new functionality.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Introduced in #577 (213d9883).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|