aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Improve order of Travis CI jobsHEADmasterJoel Rosdahl2020-04-091-27/+27
|
* Improve Travis CI job descriptionsJoel Rosdahl2020-04-091-29/+29
|
* Fix typos in 64-bit MinGW Travis CI jobJoel Rosdahl2020-04-091-1/+1
|
* Add test case for Args::from_gcc_atfileJoel Rosdahl2020-04-072-1/+61
|
* Add an Args class with backward compatibility for the old args API (#575)Joel Rosdahl2020-04-0719-1030/+1226
| | | | | | | | | | | | | | | | | | | | | | | The idea of this is to make a proper C++ API while at the same time implementing most of the old legacy args API. This makes it possible to refactor call sites gradually instead of in a series of large refactoring steps. Given that “struct args* args” is replaced with “Args args”, the following types of legacy API usage can be kept without source changes: 1. The args_* functions can be used as is. 2. args->argv[i] still works for read access. Things that aren’t emulated: 1. args->argc (use args.size() instead). 2. args->argv to access the underlying char* array (use args.to_argv().data() instead). 3. Mutating the args->argv[i] string in place (don’t do that). In other words, code that uses args_foo(args, ...) and args->argv[i] can easily be converted to args.bar(...) and args[i] (with std::string arguments instead of char*) at will and in arbitrarily small steps.
* Make ccache build on Solaris 11.4 (#572)Philipp Storz2020-04-062-0/+6
| | | These changes enable building on Oracle Solaris 11.4 for both i386 and sparc.
* Enable check_format and clang-tidy checks in CI (#562)Alexander Lanin2020-04-068-12/+182
|
* Improve const-ness of parameters related to argvJoel Rosdahl2020-04-057-32/+41
|
* Add .git-blame-ignore-revsJoel Rosdahl2020-03-291-0/+2
|
* Prepare for v3.7.9Joel Rosdahl2020-03-292-0/+23
| | | | (cherry picked from commit f7f2333b46bcb2a0cbb323c144d59cc5abb267f6)
* Remove obsolete src/lockfile.cppJoel Rosdahl2020-03-251-261/+0
| | | | | | It should have been removed in c181fdd9. Fixes #569.
* Let run-clang-format always exit with success in non-check modeJoel Rosdahl2020-03-251-1/+1
| | | | I don’t consider explicit reformatting to be an error.
* Make check_format exit with the appropriate status (#565)Thomas Otto2020-03-241-2/+2
| | | Also print only diff to stdout and fix tabs.
* Improve name of tmp file in x_unlinkJoel Rosdahl2020-03-221-1/+1
| | | | | | | | | There is no need to generate a unique temporary name in x_unlink since we don’t care whether the temporary file is clobbered on NFS. The previous usage of tmp_string() was not quite correct since the returned string is supposed to be passed to mkstemp, not used as is. (cherry picked from commit e7776305184c9338ee97334078153f298f6cfea7)
* Disable hard link mode when the output object file is /dev/nullJoel Rosdahl2020-03-222-3/+11
| | | | | | | | | | | | | | | | | | When hard link mode is enabled, ccache ≥3.6 unlinks the output file before writing to it as a workaround for a bug in Clang (#331). This unfortunately means that /dev/null will be removed when building as root (don’t do that, BTW) with hard link mode enabled and /dev/null as the the output file. A similar problem exists if the dependency file is /dev/null, regardless of hard link mode. Fix this by not unlinking the output file if it’s /dev/null and by not copying files to /dev/null at all. (There is no need to handle other non-regular output files since /dev/null is the only allowed non-regular output file.) Fixes #564. (cherry picked from commit 9a794689a8ba47e79c96d6c370976448b756973c)
* Remove superfluous unlink before renameJoel Rosdahl2020-03-221-2/+0
|
* configure: Error out if failing to download libzstd or libb2Joel Rosdahl2020-03-181-0/+6
|
* Align entries in dev.mk.inJoel Rosdahl2020-03-181-1/+2
|
* Prepare for v3.7.8Joel Rosdahl2020-03-182-1/+44
| | | | (cherry picked from commit ec65f9f88cf75cbd9f04d88c4a3345fb60911975)
* win32: Log epoch timestamp if localtime_r failsJoel Rosdahl2020-03-181-5/+5
| | | | (cherry picked from commit 21fc81c11966d674c3b3cfe30ccf3cdff7f6dfee)
* doc: Clarify include_file_ctime sloppiness in the Performance sectionJoel Rosdahl2020-03-181-6/+6
| | | | (cherry picked from commit fc8182ae95af0f46fc8f71ab29e91534636325b7)
* CacheEntryReader: Fix return type (#554)Thomas Otto2020-03-101-2/+2
|
* Use tmp_unlink to remove temporary file in use_relative_paths_in_depfileJoel Rosdahl2020-03-101-1/+1
| | | | | | No need to remove via another temporary file. (cherry picked from commit c74b625aaa46db85797a691c81f129834c7fd82e)
* C++-ify lockfile routinesJoel Rosdahl2020-03-106-26/+324
|
* Simplify lock breakingJoel Rosdahl2020-03-102-11/+10
| | | | | | Acquiring a .lock.lock file does not make lock breaking significantly safer; there is still a race condition. Simplify it by simply deleting the lockfile when breaking and try to acquire it again.
* Rewrite the Windows version of the lockfile routinesJoel Rosdahl2020-03-101-65/+103
| | | | | | | | | | Instead of emulating the POSIX version, use the native Windows file API to create a lockfile. This should mitigate several problems with the old implementation. Hopefully fixes #537. (cherry picked from commit 53b9fdd6272896bb4a2dc42c9680d4030f86b33c)
* Cap time to sleep to 10 ms when failing to acquire a lockJoel Rosdahl2020-03-031-3/+4
| | | | (cherry picked from commit 41ffc7ec009237da51040c6059b1bcd7903af30d)
* Rewrite absolute input path to relativeJoel Rosdahl2020-03-011-10/+2
| | | | | This can now be done due to no longer using realpath in make_relative_path (e8444a38).
* Let development version be BRANCH.SHORTHASHJoel Rosdahl2020-03-011-2/+4
| | | | | Previously the version of a master-based development build was something like 3.7.1+NNN_gSHORTHASH which is a bit misleading.
* Convert counters to a class (#548)Thomas Otto2020-03-0115-292/+145
| | | | Also remove file writing logic from `stats_update_size()` and delete unused declaration of `stats_timestamp()`.
* Convert the single ofstream use to fwrite (#552)Thomas Otto2020-03-011-6/+7
|
* Read/write optimizations (#551)Erik Johansson2020-03-015-23/+51
| | | | | | | | | | | | | | * Avoid one extra read call after the final bytes are read If read returns less then the requested number of bytes, the file is at EOF. This can be used in all places where a read is done, but it makes extra impact in read_file where if the buffer is made one byte bigger than needed, EOF can be detected before a unnecessary memory reallocation is done. * Use write instead of fwrite to write the result file This avoids the caching in stdio where a write is split into two (at least on my system): first a small 4k one and then one with the remaining 60k.
* Avoid duplicate stat calls (#550)Erik Johansson2020-03-013-4/+8
| | | | | hash_source_code_string will, in read_file, stat the file to get the file size. But when called from verify_result, the file size is already known so by using this size the number of stat calls in a normal run can be cut in half.
* Fix empty <obj>.ccache-log in debug mode without log_file setJoel Rosdahl2020-02-253-17/+26
| | | | Regression in dcf6ab3f349a33974b31ce2e7c06a2085149ab4a.
* Add notes about intentional use of CCACHE_DEBUG in test casesJoel Rosdahl2020-02-251-0/+2
|
* Restore test suite debug output where needed (#546)Thomas Otto2020-02-251-2/+2
| | | Two fileclone tests rely on the output.
* Low hanging fruits of some auto fixable improvements via clang-tidy (#545)Alexander Lanin2020-02-2527-305/+321
|
* Merge pull request #544 from erijo/out-of-tree-commandsJoel Rosdahl2020-02-248-21/+11
|\
| * Fix four minor cppcheck warningsErik Johansson2020-02-234-5/+4
| | | | | | | | | | | | | | | | | | - uninitvar:src/ccache.cpp:3422: Uninitialized variable: ctx - redundantInitialization:src/legacy_util.cpp:1067: Redundant initialization for 'q'. The initialized value is overwritten before it is read. - constVariable:src/stats.cpp:429: Variable 'ctx' can be declared with const - variableScope:src/Util.cpp:404: The scope of the variable 'right' can be reduced.
| * Pass std::string instead of .c_str()Erik Johansson2020-02-233-3/+3
| | | | | | | | to function taking std::string.
| * Remove unused function stats_get_pendingErik Johansson2020-02-232-9/+0
| |
| * Make cppcheck, format and check_format work in out-of-tree buildErik Johansson2020-02-231-4/+4
|/
* Remove leftover debug settings in test suitesJoel Rosdahl2020-02-232-9/+8
|
* Don’t use realpath(3) for normalization when computing relative pathsJoel Rosdahl2020-02-233-28/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current working directory (CWD) can come from two sources: Either the return value of getcwd(3) (“actual CWD” below) or the environment variable $PWD (“apparent CWD” below). The former is returned by e.g. $(CURDIR) in Makefiles and by “pwd -P” and is always in normalized form (no “.” or “..” parts or extra slashes). The latter is returned by “echo $PWD” or “pwd” and can potentially be in unnormalized form on some systems. The actual CWD and apparent CWD may also differ if there are symlinks in the path. Absolute paths to files given to ccache can therefore be based on either of these CWD forms. When computing relative paths under the base directory the CWD needs be in normalized form for the algorithm to be reasonably simple. 2df269a3 solved a bug with an unnormalized apparent CWD by using realpath(3) for normalization. Using realpath also makes the algorithm correct in the presence of symlinks. It however also means that all symlinks (both in CWD and in command line arguments) are dereferenced. The downside of this is that if either of the symlink targets contain specific names (such as build ID, date, username or similar) then the relative paths will also contain those specific path names, leading to cache misses. Solve this by: - Performing normalization without using realpath, i.e. without expanding symlinks. - Computing a relative path based on normalized CWD and normalized path. - Checking whether the relative path resolves to the same i-node as the original path. If it does, use it, otherwise just use the original path (and take a potential cache miss). - Doing the above calculation both for the actual and the apparent CWD and choose the best one. This solves the problem that PR #491 intended to address in a better way.
* Improve basedir calculation on WindowsJoel Rosdahl2020-02-233-1/+12
| | | | Now basedir with backslashes or forward slashes should work.
* Let Util::get_apparent_cwd return a normalized CWDJoel Rosdahl2020-02-231-8/+8
|
* Add Stat::same_inode_as methodJoel Rosdahl2020-02-232-0/+32
|
* Add default Stat constructorJoel Rosdahl2020-02-232-2/+27
|
* C++-ify make_relative_pathJoel Rosdahl2020-02-231-49/+27
|
* C++-ify get_relative_pathJoel Rosdahl2020-02-237-88/+81
|