Joel Rosdahl [Tue, 6 Feb 2018 20:49:55 +0000 (21:49 +0100)]
Treat unreadable conf file like missing instead of a fatal error
This reverts 0b18af47 and implements a better solution.
The major reason is to keep ccache transparent, i.e. to still have the
following behavior:
* If ccache returns exit code == 0, then any produced stderr comes from
the compiler and only from the compiler.
* If ccache returns exit code != 0, then ccache may print error messages
of its own.
The reason is that autoconf configure scripts have been known to fail
tests if the compiler emits anything to stderr even if the produced
result actually works. (And printing to stdout is also a no-no.)
Fail if boolean env vars are set with common negative strings
Boolean environment variables have strange semantics: if the variable
is set then the configuration setting is considered "true". This means
users can easily be mistaken that eg CCACHE_DISABLE=false means that
the "disable" setting is set to false.
To avoid too much backwards-incompatibility, we now exit with an error if
some common negative-sounding (case-insensitive) values:
"0", "false", "disable", "no".
All other values (including the empty string) are still considered to mean
"true".
Joel Rosdahl [Mon, 29 Jan 2018 19:57:18 +0000 (20:57 +0100)]
test: Rearrange files into test and unittest directories
* The unit tests formerly located in the test directory have been moved
to the unittest directory.
* The integration test suite test.sh has been made a bash script and
renamed to test/run. Its test suites are located in test/suites.
Joel Rosdahl [Sat, 27 Jan 2018 21:18:37 +0000 (22:18 +0100)]
test: Split into one file per suite
The test.sh file has simply grown unpleasantly large, so it's time to
split it up. Some suites still refer to stuff defined in earlier suites,
but we'll have to live with that for now.
Clemens Rabe [Wed, 23 Aug 2017 07:33:23 +0000 (09:33 +0200)]
Bug fixes and tests for nvcc
Feature: Added cuda compiler in separate travis job and implemented
tests for nvcc.
Feature: Added support for nvcc compiler options --compiler-bindir/-ccbin,
--output-directory/-odir and --libdevice-directory/-ldir.
Added tests for these options in test.sh.
Bug fix: Original patch had a statement to avoid using the preprocessed
input files for nvcc when run_second_cpp is false. Otherwise,
when a build is necessary and the preprocessed output was used,
nvcc results with a compiler error. The patch simply ensures
run_second_cpp is always set to true for the cuda compiler.
Bug fix: The -optf and -odir options are only accepted for nvcc. For other
compilers, they behave like '-o ptf' resp. '-o dir'.
A test was added to check this behaviour.
Joel Rosdahl [Sun, 21 Jan 2018 21:17:24 +0000 (22:17 +0100)]
Refactor and clean up code for copying results to/from the cache
Lots of cruft and copy pasta has collected during the years.
* It's enough to let get_file_from_cache detect missing files in the
cache; no need to check before.
* Made the order of the handling of the different file types consistent
in various places.
* Removed the tmp_cov, tmp_su and tmp_dwo variables. I cannot
see why they just aren't redundant since the corresponding output_*
variables already exist with the same value. Except for the "GCC has
some funny rule" part, but that seems bogus anyway since tmp_* and
output_* must be equal for things to work. Let's just ignore it for
now.
* Removed the support for generating placeholders for .cov and .su files
if the compiler doesn't create them. Modern compilers always create
them, and I want to reduce code complexity.
Joel Rosdahl [Sun, 21 Jan 2018 08:34:51 +0000 (09:34 +0100)]
Improve file size/number counters for overwritten files
When ccache overwrites a cached file, the counters are still increased
as if a new file was stored in the cache, for instance when recaching.
This is now fixed by checking if a cached file exists before storing the
cached file and update file size/number counters with the correct
size/count delta.
Joel Rosdahl [Thu, 11 Jan 2018 20:08:01 +0000 (21:08 +0100)]
Merge branch '3.3-maint'
* 3.3-maint:
Update NEWS
Don't skip compiler argument following AFFECTS_CPP without TAKES_ARG
Clean up
Clean up redundant expression
-fdebug-prefix-map is supported in clang 3.8 and newer
Fix leaked file descriptor
Clang emits warnings for unused linker arguments, respect that!
doc: Improve markup
Add some fallthrough comments to work around GCC compiler warnings
Edward Z. Yang [Fri, 30 Jun 2017 14:35:29 +0000 (07:35 -0700)]
Clang emits warnings for unused linker arguments, respect that!
If ccache concludes the invocation with/without linker arguments
is the same as before, then it may show/fail to show a warning
when it should. I know we're not supposed to rely on the
is clang check, but this solves it in normal cases.
Joel Rosdahl [Wed, 10 Jan 2018 20:10:45 +0000 (21:10 +0100)]
Merge branch '3.3-maint'
* 3.3-maint:
Document how automatic cleanup works
Make ccache -c/--cleanup not take limit_multiple into account
test: Fix printing of failure reason with glob characters
Fix grammar in cleanup_* function names
test: Unset all CCACHE variables in environment
cleanup: Improve logging
test: Check more cases of path normalization
Don't overwrite cached .d file with a version with absolute paths
test: Fix verbose printing of test case name with space
Update NEWS
Don't use cache when building precompiled header with changed deps
Always use include DEFAULT_SLOPPINESS when overriding CCACHE_SLOPPINESS
Joel Rosdahl [Sat, 6 Jan 2018 14:41:13 +0000 (15:41 +0100)]
Make ccache -c/--cleanup not take limit_multiple into account
Now "ccache -c/--cleanup" will trim the cache to the configured max
limits instead of 80% (limit_multiple) of the max limits. This feels
like a more intuitive behavior, and it also makes it behave like
documented.
Tor Arne Vestbø [Thu, 15 Jun 2017 12:40:16 +0000 (14:40 +0200)]
Don't use cache when building precompiled header with changed deps
If one of the included files in a precompiled header is touched,
changing only its mtime, clang will produce a fatal error when the
precompiled header is then used:
file 'foo.h' has been modified since the precompiled header 'foo.pch' was built
We need to take this into account when producing precompiled headers,
so that we don't pick out stale objects from the cache. This works
fine for direct mode, but in preprocess mode we don't have enough
information to decide if the object is still valid, so we skip the
cache entirely in that mode.
Joel Rosdahl [Thu, 15 Jun 2017 18:32:18 +0000 (20:32 +0200)]
Merge branch '3.3-maint'
* 3.3-maint:
Update log message and docs when using SLOPPY_FILE_STAT_MATCHES
Tweak comment
Add comment about why SLOPPY_INCLUDE_FILE_[CM]TIME compares using >=t
Joel Rosdahl [Sat, 25 Mar 2017 20:24:57 +0000 (21:24 +0100)]
Merge branch '3.3-maint'
* 3.3-maint:
Update NEWS
Add test for directory in ignore_headers_in_manifest
Fix DIR_DELIM_CH for win32 and non-win32 platforms, values were mixed up
Update NEWS
Tweak source code format
Support using multiple -fdebug-prefix-map
Fixed the check for empty object file vs diagnostics
Removed time_of_compilation check wrt SLOPPY_FILE_STAT_MATCHES
Revert "Better parsing of g* Options, and only use last argument"
Test that the order of debug options is kept