]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
6 years agoPrepare for v3.4.3 3.4-maint v3.4.3
Joel Rosdahl [Sun, 2 Sep 2018 08:27:04 +0000 (10:27 +0200)] 
Prepare for v3.4.3

6 years agoUpdate NEWS
Joel Rosdahl [Sun, 2 Sep 2018 08:05:59 +0000 (10:05 +0200)] 
Update NEWS

6 years agoUpgrade zlib to 1.2.11
Anders F Björklund [Sun, 26 Aug 2018 18:15:45 +0000 (20:15 +0200)] 
Upgrade zlib to 1.2.11

6 years agoUpdate NEWS
Joel Rosdahl [Thu, 23 Aug 2018 20:20:30 +0000 (22:20 +0200)] 
Update NEWS

6 years agoBail out on compiler option -save-temps=obj
Anders F Björklund [Tue, 21 Aug 2018 20:22:38 +0000 (22:22 +0200)] 
Bail out on compiler option -save-temps=obj

Also add a test, and handle default (=cwd)

Closes #299

6 years agoUpdate NEWS
Joel Rosdahl [Tue, 14 Aug 2018 19:49:04 +0000 (21:49 +0200)] 
Update NEWS

6 years agoAdd handling of separate -target parameter
Anders F Björklund [Tue, 3 Jul 2018 16:54:34 +0000 (18:54 +0200)] 
Add handling of separate -target parameter

Otherwise you will get an error in the log:

"x86_64-pc-linux-gnu is not a regular file,
 not considering as input file"

The argument seems to be specific to clang.

6 years agoBail out on too hard clang option “-MJ”
Joel Rosdahl [Tue, 14 Aug 2018 19:14:36 +0000 (21:14 +0200)] 
Bail out on too hard clang option “-MJ”

See discussion in pull request #277.

7 years agoRemove debug log
Joel Rosdahl [Thu, 7 Jun 2018 19:52:09 +0000 (21:52 +0200)] 
Remove debug log

7 years agoImprove logging related to hashing of the CWD
Joel Rosdahl [Thu, 7 Jun 2018 19:48:42 +0000 (21:48 +0200)] 
Improve logging related to hashing of the CWD

7 years agoUpdate NEWS
Joel Rosdahl [Mon, 7 May 2018 19:45:12 +0000 (21:45 +0200)] 
Update NEWS

7 years agoAvoid TOCTOU issue when deciding if config is valid
Tomasz Miąsko [Wed, 2 May 2018 00:00:00 +0000 (00:00 +0000)] 
Avoid TOCTOU issue when deciding if config is valid

Previously, a separate call to access had been used to distinguish
between I/O errors and invalid configuration file. This could lead to
spurious errors if configuration file have been created in-between call
to conf_read and access. Use errno to tell those two cases apart.

Closes #260.

7 years agoUse double when calculating cache thresholds
Joel Rosdahl [Mon, 23 Apr 2018 19:56:32 +0000 (21:56 +0200)] 
Use double when calculating cache thresholds

We could at least in theory have large enough caches that float’s
precision won’t be enough.

Also removed include of <float.h> which I think is superfluous.

7 years agoAdd a 32-bit build target, using multilib (-m32)
Anders F Björklund [Sun, 8 Apr 2018 11:51:06 +0000 (13:51 +0200)] 
Add a 32-bit build target, using multilib (-m32)

Use gcc-multilib rather than doing a full cross-compile.
But set the --host, just in case something is listening.

7 years agoConvert float config to double, add rounding
Anders F Björklund [Sun, 8 Apr 2018 13:28:58 +0000 (15:28 +0200)] 
Convert float config to double, add rounding

We were getting different results when converting "float" to
integers, on 32-bit versus 64-bit platforms. So use "roundf".

Also exposed a typo in another testsuite, where we only cleaned
files as a result of roundoff... Make cleaning explicit again.

7 years agoUpgrade clang to 5.0, for the Travis docker
Anders F Björklund [Sat, 7 Apr 2018 12:29:52 +0000 (14:29 +0200)] 
Upgrade clang to 5.0, for the Travis docker

7 years agoMake sure to export ASAN_OPTIONS properly
Anders F Björklund [Sat, 7 Apr 2018 12:50:33 +0000 (14:50 +0200)] 
Make sure to export ASAN_OPTIONS properly

7 years agoAdd small helper to run all Travis tests
Anders F Björklund [Sun, 1 Apr 2018 12:40:05 +0000 (14:40 +0200)] 
Add small helper to run all Travis tests

The idea behind this script is to run the same checks as .travis.yml
but locally instead. It is not identical, but should be close enough.

Note: this does not include any tests for the osx or cuda platforms,
only the linux targets - although that does include the mingw build.

7 years agoMake sure to call configure with right path
Anders F Björklund [Sun, 1 Apr 2018 12:39:44 +0000 (14:39 +0200)] 
Make sure to call configure with right path

7 years agoAdd a travis-build container, for running locally
Anders F Björklund [Sun, 1 Apr 2018 11:53:02 +0000 (13:53 +0200)] 
Add a travis-build container, for running locally

This is not the actual Travis docker container, but it
should be similar enough for doing local verification:

make travis
make travis CC=clang
make travis CC=clang CFLAGS="-fsanitize=address -g" ASAN_OPTIONS="detect_leaks=0"
make travis CC=i686-w64-mingw32-gcc HOST="--host=i686-w64-mingw32" TEST="unittest/run.exe"

7 years agoLook for -fdebug-prefix-map feature explicitly
Anders F Björklund [Sun, 1 Apr 2018 11:13:33 +0000 (13:13 +0200)] 
Look for -fdebug-prefix-map feature explicitly

Seems like old clang-3.4 didn't have this feature, while the
newer MinGW might. So remove the hardcoding, and do the check.

7 years agoImprove the Travis build matrix
Anders F Björklund [Sun, 1 Apr 2018 07:39:15 +0000 (09:39 +0200)] 
Improve the Travis build matrix

Run in containers where possible, save the installations for the
targets that actually need to do them (currently: mingw and cuda)

7 years agoFix log printing of before/after cleanup
Anders F Björklund [Fri, 30 Mar 2018 19:23:04 +0000 (21:23 +0200)] 
Fix log printing of before/after cleanup

Seems like MinGW doesn't have the %z (size_t) printf format
So add some %f casting variant, so that it works everywhere.

7 years agoRemove irrelevant variable assignment in wipe_dir
Joel Rosdahl [Mon, 23 Apr 2018 19:44:56 +0000 (21:44 +0200)] 
Remove irrelevant variable assignment in wipe_dir

7 years agowin32: Fix CCACHE_COMPILERCHECK=mtime test case
peterbudai@hotmail.com [Wed, 28 Mar 2018 20:20:12 +0000 (22:20 +0200)] 
win32: Fix CCACHE_COMPILERCHECK=mtime test case

Previously if compiler command was an .sh script, win32 version
automatically added an .EXE extension to the command line and
then test case failed. With this change .sh files won't get
appended by an EXE extension and test case successfully runs

7 years agoPrepare for v3.4.2 v3.4.2
Joel Rosdahl [Sun, 25 Mar 2018 20:22:56 +0000 (22:22 +0200)] 
Prepare for v3.4.2

7 years agodirect .i mode: Don't create tmp.cpp_stderr file at all
peterbudai@hotmail.com [Fri, 16 Mar 2018 22:54:16 +0000 (23:54 +0100)] 
direct .i mode: Don't create tmp.cpp_stderr file at all

Create tmp file only when it's actually needed.

7 years agoClean up
Joel Rosdahl [Tue, 13 Mar 2018 13:38:09 +0000 (14:38 +0100)] 
Clean up

7 years agowin32: Silence compiler warnings
peterbudai@hotmail.com [Mon, 12 Mar 2018 20:38:39 +0000 (21:38 +0100)] 
win32: Silence compiler warnings

7 years agocleanup: Improve robustness when multiple cleanups run concurrently
Joel Rosdahl [Mon, 12 Mar 2018 21:25:28 +0000 (22:25 +0100)] 
cleanup: Improve robustness when multiple cleanups run concurrently

The file count/size counters are now intentionally subtracted even if
there file to delete has disappeared since the final cache size
calculation will be incorrect if they aren’t. This can happen when there
are several parallel ongoing cleanups of the same subdirectory.

Also removed the “delete sibling files” logic; it’s unnecessary for all
siblings except .stderr since that’s the only file in a result that is
optional. Any other missing file will be detected by
get_file_from_cache.

7 years agocleanup: Log size before cleaning
Joel Rosdahl [Mon, 12 Mar 2018 21:05:17 +0000 (22:05 +0100)] 
cleanup: Log size before cleaning

7 years agoAdd x_try_unlink utility function
Joel Rosdahl [Mon, 12 Mar 2018 20:48:59 +0000 (21:48 +0100)] 
Add x_try_unlink utility function

It behaves like x_unlink but doesn’t log a failure if the file is
missing.

7 years agotest: Use helper functions instead of custom code
Joel Rosdahl [Mon, 12 Mar 2018 20:30:28 +0000 (21:30 +0100)] 
test: Use helper functions instead of custom code

7 years agotest: Improve error messages from expect_{equal,different}_files
Joel Rosdahl [Mon, 12 Mar 2018 20:20:17 +0000 (21:20 +0100)] 
test: Improve error messages from expect_{equal,different}_files

7 years agoUpdate NEWS
Joel Rosdahl [Sun, 11 Mar 2018 15:08:21 +0000 (16:08 +0100)] 
Update NEWS

7 years agoClean up
Joel Rosdahl [Sun, 11 Mar 2018 14:49:06 +0000 (15:49 +0100)] 
Clean up

7 years agoSupport out-of-source builds
Anders F Björklund [Sat, 10 Mar 2018 19:14:08 +0000 (20:14 +0100)] 
Support out-of-source builds

Separate (read-only) $srcdir and (output) $builddir

Still support both developer mode and dist (+check).

7 years agoBe consistent with “Clang” and “NVCC” names in NEWS
Joel Rosdahl [Sun, 11 Mar 2018 08:21:27 +0000 (09:21 +0100)] 
Be consistent with “Clang” and “NVCC” names in NEWS

7 years agoDon’t apply Clang workaround for PCH dependencies for other compilers
Joel Rosdahl [Sun, 11 Mar 2018 08:19:52 +0000 (09:19 +0100)] 
Don’t apply Clang workaround for PCH dependencies for other compilers

Closes #235.

7 years agocleanup: Remove special-casing of files from ccache 2.x
Joel Rosdahl [Tue, 6 Mar 2018 20:11:23 +0000 (21:11 +0100)] 
cleanup: Remove special-casing of files from ccache 2.x

It feels like a safe assumption that nobody will run ccache 3.4.x and
2.x on the same cache directory.

7 years agoFix debug_prefix_map suite
Timofei Kushnir [Wed, 28 Feb 2018 07:48:10 +0000 (10:48 +0300)] 
Fix debug_prefix_map suite

7 years agoImprove AsciiDoc markup
Joel Rosdahl [Tue, 6 Mar 2018 19:44:40 +0000 (20:44 +0100)] 
Improve AsciiDoc markup

7 years agoImprove man page generation
Joel Rosdahl [Sun, 4 Mar 2018 09:45:50 +0000 (10:45 +0100)] 
Improve man page generation

* Use AsciiDoc’s a2x tool instead of running xsltproc explicitly.
* Stow away ccache.1 in doc.
* Make AsciiDoc literals stand out as bold in the man page. We can now
  use properly literals instead of emphasis in the manual.

7 years agoRemove redundant .gitignore entries
Joel Rosdahl [Sun, 4 Mar 2018 09:44:19 +0000 (10:44 +0100)] 
Remove redundant .gitignore entries

7 years agoChange extension of AsciiDoc files to .adoc
Joel Rosdahl [Thu, 1 Mar 2018 20:20:05 +0000 (21:20 +0100)] 
Change extension of AsciiDoc files to .adoc

This should make them nicely rendered in the GitHub file tree.

7 years agoThe Dockerfile was moved to a subdirectory
Anders F Björklund [Wed, 28 Feb 2018 16:30:38 +0000 (17:30 +0100)] 
The Dockerfile was moved to a subdirectory

7 years agoFix paths to bundled zlib
Joel Rosdahl [Sun, 25 Feb 2018 08:09:02 +0000 (09:09 +0100)] 
Fix paths to bundled zlib

Regression from the source code rearrangement in 4aa357782e48.

Also added a distcheck that verifies that “./configure
--with-bundled-zlib” works.

Closes #229.

7 years agoHash preprocessed headers located in “.gch directories” correctly
Joel Rosdahl [Wed, 21 Feb 2018 19:58:45 +0000 (20:58 +0100)] 
Hash preprocessed headers located in “.gch directories” correctly

Previously, ccache would not pick up changes to such precompiled
headers, risking false positive cache hits.

7 years agoPrepare for v3.4.1 v3.4.1
Joel Rosdahl [Sun, 11 Feb 2018 18:14:47 +0000 (19:14 +0100)] 
Prepare for v3.4.1

7 years agoFix printing of version number in “ccache --version”
Joel Rosdahl [Sun, 11 Feb 2018 18:07:51 +0000 (19:07 +0100)] 
Fix printing of version number in “ccache --version”

Closes #225.

7 years agoPrepare for v3.4 v3.4
Joel Rosdahl [Sun, 11 Feb 2018 14:24:11 +0000 (15:24 +0100)] 
Prepare for v3.4

7 years agoUpdate lookup tables with new location of .gperf files
Joel Rosdahl [Sun, 11 Feb 2018 14:18:15 +0000 (15:18 +0100)] 
Update lookup tables with new location of .gperf files

7 years agoAdd update-authors make recipe and use it
Joel Rosdahl [Sat, 10 Feb 2018 20:59:07 +0000 (21:59 +0100)] 
Add update-authors make recipe and use it

7 years agoImprove README.md
Joel Rosdahl [Wed, 7 Feb 2018 18:13:16 +0000 (19:13 +0100)] 
Improve README.md

7 years agoRearrange files into suitable subdirectories, e.g. src and doc
Joel Rosdahl [Wed, 7 Feb 2018 11:14:49 +0000 (12:14 +0100)] 
Rearrange files into suitable subdirectories, e.g. src and doc

The top directory has become too crowded.

7 years agoSimplify initialize() slightly
Joel Rosdahl [Tue, 6 Feb 2018 20:58:19 +0000 (21:58 +0100)] 
Simplify initialize() slightly

7 years agoTreat unreadable conf file like missing instead of a fatal error
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.)

7 years agoDocument caveats related to colored warnings from compilers
Joel Rosdahl [Mon, 5 Feb 2018 20:58:55 +0000 (21:58 +0100)] 
Document caveats related to colored warnings from compilers

7 years agoDocument more pitfalls with hard links
Joel Rosdahl [Mon, 5 Feb 2018 18:11:02 +0000 (19:11 +0100)] 
Document more pitfalls with hard links

7 years agoUse strftime instead of obsolete asctime function
Joel Rosdahl [Sun, 4 Feb 2018 09:47:06 +0000 (10:47 +0100)] 
Use strftime instead of obsolete asctime function

7 years agoFix most warnings from cppcheck 1.72
Joel Rosdahl [Sun, 4 Feb 2018 09:40:04 +0000 (10:40 +0100)] 
Fix most warnings from cppcheck 1.72

7 years agoChange “improvements” to “enhancements” in NEWS.txt
Joel Rosdahl [Sun, 4 Feb 2018 09:33:54 +0000 (10:33 +0100)] 
Change “improvements” to “enhancements” in NEWS.txt

Every change is hopefully an improvement.

7 years agoFix use-after-free error in 316b966b
Joel Rosdahl [Sat, 3 Feb 2018 21:56:11 +0000 (22:56 +0100)] 
Fix use-after-free error in 316b966b

7 years agoHash host compilers invoked by nvcc
Joel Rosdahl [Sat, 3 Feb 2018 20:16:26 +0000 (21:16 +0100)] 
Hash host compilers invoked by nvcc

See #145.

7 years agoIntroduce and use ARRAY_SIZE macro
Joel Rosdahl [Sat, 3 Feb 2018 09:42:22 +0000 (10:42 +0100)] 
Introduce and use ARRAY_SIZE macro

7 years agoHash '-ccbin' argument
Sam Gross [Tue, 1 Nov 2016 17:45:26 +0000 (10:45 -0700)] 
Hash '-ccbin' argument

7 years agounittest: Pass errmsg to CHECKM when available
Joel Rosdahl [Wed, 31 Jan 2018 21:15:45 +0000 (22:15 +0100)] 
unittest: Pass errmsg to CHECKM when available

From PR #169.

7 years agoUpdate config.guess and config.sub to modern versions
Joel Rosdahl [Wed, 31 Jan 2018 21:00:46 +0000 (22:00 +0100)] 
Update config.guess and config.sub to modern versions

As suggested in PR #169.

7 years agoOnly pass implicit -MQ to preprocessor if needed
Joel Rosdahl [Tue, 30 Jan 2018 21:38:29 +0000 (22:38 +0100)] 
Only pass implicit -MQ to preprocessor if needed

Fixes #209.

7 years agoUpdate NEWS
Joel Rosdahl [Tue, 30 Jan 2018 21:13:32 +0000 (22:13 +0100)] 
Update NEWS

7 years agotest: Add and fix cpp1 suite
Joel Rosdahl [Tue, 30 Jan 2018 21:07:52 +0000 (22:07 +0100)] 
test: Add and fix cpp1 suite

I messed up when adapting Anders's work in f58741b5 to the new test
layout.

7 years agoUpdate NEWS
Joel Rosdahl [Tue, 30 Jan 2018 20:55:17 +0000 (21:55 +0100)] 
Update NEWS

7 years agoImprove docs and clean up
Joel Rosdahl [Tue, 30 Jan 2018 20:51:17 +0000 (21:51 +0100)] 
Improve docs and clean up

7 years agoPass the cpp1 flags more selectively
Anders F Björklund [Mon, 26 Jun 2017 20:51:17 +0000 (22:51 +0200)] 
Pass the cpp1 flags more selectively

The -fdirectives-only flag is needed for *both* cpp and cc/c++,
but the -frewrite-includes is only needed for cpp (not cc/c++).

Also make it easier to follow along in the gcc manual by passing
-fpreprocess explicitly, just like we pass the language to clang.

7 years agoAdd test case for directives-only/rewrite-includes
Anders F Björklund [Sun, 25 Jun 2017 19:49:15 +0000 (21:49 +0200)] 
Add test case for directives-only/rewrite-includes

Use run_second_cpp = false (also known sometimes as "cpp1"),
but instruct the preprocessor to only handle include directives.

Make sure that any headers are still processed, and that both
the #define and -D work as usual (with regular preprocessing).

7 years agoHandle semi-preprocessed source code with cpp1
Anders F Björklund [Sun, 25 Jun 2017 18:41:24 +0000 (20:41 +0200)] 
Handle semi-preprocessed source code with cpp1

When using gcc -fdirectives-only or clang -frewrite-includes,
we still need to pass preprocessor arguments to the compiler.

Also make sure to set the language for clang (but not for gcc),
since the file no longer contains regular preprocessed source.

7 years agoClean up
Joel Rosdahl [Tue, 30 Jan 2018 20:36:19 +0000 (21:36 +0100)] 
Clean up

7 years agoFail if boolean env vars are set with common negative strings
Mostyn Bramley-Moore [Fri, 23 Jun 2017 18:20:54 +0000 (20:20 +0200)] 
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".

Resolves https://github.com/ccache/ccache/issues/182

7 years agotest: Rearrange files into test and unittest directories
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.

7 years agoPrefer bash, when running test.sh script
Anders F Björklund [Fri, 26 Jan 2018 18:12:57 +0000 (19:12 +0100)] 
Prefer bash, when running test.sh script

Look for bash, to make it possible to run "make test"
on platforms where it is not the /bin/sh implementation.

It is possible to build ccache without it, when only
running the limited unit tests (with "make quicktest").

7 years agoMerge branch '3.3-maint'
Joel Rosdahl [Sun, 28 Jan 2018 15:24:14 +0000 (16:24 +0100)] 
Merge branch '3.3-maint'

* 3.3-maint:
  Prepare for v3.3.6

7 years agoPrepare for v3.3.6 3.3-maint v3.3.6
Joel Rosdahl [Sun, 28 Jan 2018 15:22:29 +0000 (16:22 +0100)] 
Prepare for v3.3.6

7 years agoTweak code style and comments
Joel Rosdahl [Sun, 28 Jan 2018 15:20:30 +0000 (16:20 +0100)] 
Tweak code style and comments

7 years agoMerge branch '3.3-maint'
Joel Rosdahl [Sun, 28 Jan 2018 15:12:47 +0000 (16:12 +0100)] 
Merge branch '3.3-maint'

* 3.3-maint:
  Update NEWS
  test: Verify that UNCACHED_ERR_FD works
  Only write hash debug output if there is any data
  Fix broken UNCACHED_ERR_FD

7 years agoUpdate NEWS
Joel Rosdahl [Sun, 28 Jan 2018 15:08:31 +0000 (16:08 +0100)] 
Update NEWS

7 years agotest: Verify that UNCACHED_ERR_FD works
Joel Rosdahl [Sun, 28 Jan 2018 15:06:36 +0000 (16:06 +0100)] 
test: Verify that UNCACHED_ERR_FD works

7 years agoOnly write hash debug output if there is any data
Joel Rosdahl [Sun, 28 Jan 2018 15:05:07 +0000 (16:05 +0100)] 
Only write hash debug output if there is any data

7 years agoFix broken UNCACHED_ERR_FD
Luboš Luňák [Fri, 26 Jan 2018 07:47:30 +0000 (08:47 +0100)] 
Fix broken UNCACHED_ERR_FD

It shouldn't be closed on exec since that's exactly the point, to leak
it to whatever ccache calls.

7 years agotest: Fix nvcc tests when using compiler with options
Joel Rosdahl [Sat, 27 Jan 2018 22:01:07 +0000 (23:01 +0100)] 
test: Fix nvcc tests when using compiler with options

7 years agotest: Remove superfluous blank lines
Joel Rosdahl [Sat, 27 Jan 2018 22:00:01 +0000 (23:00 +0100)] 
test: Remove superfluous blank lines

7 years agotest: Split into one file per suite
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.

7 years agoUpdate NEWS
Joel Rosdahl [Sat, 27 Jan 2018 21:02:25 +0000 (22:02 +0100)] 
Update NEWS

7 years agoClean up code related to CUDA/nvcc
Joel Rosdahl [Sat, 27 Jan 2018 20:57:22 +0000 (21:57 +0100)] 
Clean up code related to CUDA/nvcc

Remove tabs from test.sh, use lowercase names for local variables and
other minor fixes.

7 years agotest: Fix nvcc_ldir tests when gcc is a masquerading ccache
Joel Rosdahl [Sat, 27 Jan 2018 20:25:19 +0000 (21:25 +0100)] 
test: Fix nvcc_ldir tests when gcc is a masquerading ccache

7 years agoBug fixes and tests for nvcc
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.

7 years agotest: Fix failure in gcc pch suite when using compiler with options
Joel Rosdahl [Sat, 27 Jan 2018 14:26:15 +0000 (15:26 +0100)] 
test: Fix failure in gcc pch suite when using compiler with options

Need to remember any extra compiler options in REAL_COMPILER as well.

7 years agotest: Find and use real compiler
Joel Rosdahl [Mon, 22 Jan 2018 20:59:31 +0000 (21:59 +0100)] 
test: Find and use real compiler

The real compiler is now found in the same way as ccache itself does it,
so we no longer have to rely on the uncached_compile hack.

7 years agotest: Check that dependency file contains the correct object name
Joel Rosdahl [Mon, 22 Jan 2018 09:56:06 +0000 (10:56 +0100)] 
test: Check that dependency file contains the correct object name

7 years agoRefactor and clean up code for copying results to/from the cache
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.

7 years agoImprove file size/number counters for overwritten files
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.