]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
6 years agoRemove now unused x_fstat function
Joel Rosdahl [Mon, 10 Jun 2019 20:55:11 +0000 (22:55 +0200)] 
Remove now unused x_fstat function

6 years agoFix check of destination fd in copy_file
Joel Rosdahl [Mon, 10 Jun 2019 20:53:42 +0000 (22:53 +0200)] 
Fix check of destination fd in copy_file

6 years agoFix possible NULL pointer dereference (#433)
Igor Pylypiv [Mon, 10 Jun 2019 20:52:35 +0000 (13:52 -0700)] 
Fix possible NULL pointer dereference (#433)

cppcheck:
  [src/manifest.c:270] -> [src/manifest.c:269]: (warning)
  Either the condition '!errmsg' is redundant or there is possible null pointer
  dereference: errmsg.

6 years agoImprove naming of things
Joel Rosdahl [Sat, 8 Jun 2019 18:49:39 +0000 (20:49 +0200)] 
Improve naming of things

Some words are being used to mean several things in the code base:

* “object” can mean both “the object file (.o) produced by the compiler”
  and “the result stored in the cache, including e.g. the .o file and .d
  file”.
* “hash” can mean both “the state that the hash_* functions operate on”,
  “the output of a hash function” and “the key used to index results
  and manifests in the cache”.

This commits tries to make the naming more consistent:

* “object” means “the object file (.o) produced by the compiler”
* “result” means “the result stored in the cache, including e.g. the .o
  file and .d file”.
* “struct hash” means “the state that the hash_* functions operate on”.
* “digest” means “the output of a hash function”. However, “hash” is
  still used in documentation and command line output since I think that
  “hash” is easier to understand for most people, especially since
  that’s the term used by Git.
* “name” means “the key used to index results and manifests in the
  cache”.

6 years agoImprove how <MD4, number of hashed bytes> is represented
Joel Rosdahl [Sat, 8 Jun 2019 11:25:49 +0000 (13:25 +0200)] 
Improve how <MD4, number of hashed bytes> is represented

Internally, the tuple <MD4 hash, number of hashed bytes>,which is the
key used for cached results and manifests, was represented as 16 bytes +
1 uint32_t. Externally, i.e. in file names, it was represented as
<MD4>-<size>, with <MD4> being 32 hex digits and <size> being the number
of hashed bytes in human-readable form.

This commits changes the internal representation to 20 bytes, where the
last 4 bytes are the number of hashed bytes in big-endian order. The
external representation has been changed to match this, i.e. to be 40
hex digits. This makes the code slightly less complex and more
consistent. Also, the code that converts the key into string form has
been rewritten to not allocate on the heap but to just write the output
into a buffer owned by the caller.

struct file_hash (16 bytes + 1 uint32_t) has been renamed to struct
digest (20 bytes) in order to emphasize that it represents the output of
a hash algorithm that not necessarily gets file content as its input.

The documentation of the manifest format has been updated to reflect the
logical change of keys, even though the actual serialized content of
manifest files hasn’t changed. While at it, reading of the obsolete
“hash_size” and “reserved” fields has been removed. (Future changes in
the manifest format will be handled by just stepping the version.)

6 years agoAdd binary representation of hash-size (#399)
Anders Björklund [Sat, 8 Jun 2019 19:17:14 +0000 (21:17 +0200)] 
Add binary representation of hash-size (#399)

* Add binary representation of hash-size

Fixed size efficient binary representation data,
instead of the variable size hexadecimal string.

This is suitable for machine use, while the other
is more suitable for human readability as string.

* Promote hex format as a global function

* Add unittest for the format_hex function

Make sure that output is NUL-terminated

6 years agoRemove the hard link mode
Joel Rosdahl [Thu, 6 Jun 2019 18:10:10 +0000 (20:10 +0200)] 
Remove the hard link mode

Rationale:

* The hard link feature is prone to errors: a) changes to files outside
  the cache will corrupt the cache, and b) the mtime field in the file's
  i-node is used for different purposes by ccache and build tools like
  make.
* The upcoming enabling of LZ4 compression by default will make the hard
  link mode obsolete as a means of saving cache space.
* Not supporting hard links will make a future backend storage API
  simpler.

6 years agoMove mtime update into result_get/manifest_get
Joel Rosdahl [Thu, 6 Jun 2019 12:53:40 +0000 (14:53 +0200)] 
Move mtime update into result_get/manifest_get

Housekeeping of cached files belongs to the backend code, not the
frontend.

6 years agoRemove now superfluous test of empty result file
Joel Rosdahl [Thu, 6 Jun 2019 12:51:03 +0000 (14:51 +0200)] 
Remove now superfluous test of empty result file

Empty files are detected as corrupted by result_get.

6 years agoImprove error reporting from read_result
Joel Rosdahl [Thu, 6 Jun 2019 12:46:29 +0000 (14:46 +0200)] 
Improve error reporting from read_result

“ccache --dump-result” now prints the actual error.

6 years agoImprove names of result functions and variables
Joel Rosdahl [Thu, 6 Jun 2019 12:30:06 +0000 (14:30 +0200)] 
Improve names of result functions and variables

6 years agoImprove error handling of (de)compressors
Joel Rosdahl [Thu, 6 Jun 2019 11:44:16 +0000 (13:44 +0200)] 
Improve error handling of (de)compressors

Previously, some kinds of corruption were not detected by the zlib
decompressor since it didn’t check that it had reached the end of the
stream and therefore didn’t verify the Adler-32 checksum.

6 years agoRemove redundant cc_log
Joel Rosdahl [Wed, 5 Jun 2019 20:49:41 +0000 (22:49 +0200)] 
Remove redundant cc_log

6 years agoClean up internal trace code
Joel Rosdahl [Wed, 5 Jun 2019 20:43:50 +0000 (22:43 +0200)] 
Clean up internal trace code

6 years agoRemove obsolete decompression code
Joel Rosdahl [Wed, 5 Jun 2019 20:35:16 +0000 (22:35 +0200)] 
Remove obsolete decompression code

* Remove obsolete decompression functionality from copy_file.
* Removed obsolete move_uncompressed_file.
* Improved return values of copy_file/move_file.

6 years agoRemove obsolete file_is_compressed function
Joel Rosdahl [Wed, 5 Jun 2019 19:53:44 +0000 (21:53 +0200)] 
Remove obsolete file_is_compressed function

6 years agoUncrustify code
Joel Rosdahl [Tue, 4 Jun 2019 20:47:27 +0000 (22:47 +0200)] 
Uncrustify code

6 years agoUse the compression API for results
Joel Rosdahl [Tue, 4 Jun 2019 19:49:52 +0000 (21:49 +0200)] 
Use the compression API for results

It didn’t feel right to use zlib’s gzip format for the embedded content,
especially since other compression libraries don’t support a similar
interface. Therefore, use the standard low-level zlib API instead.

6 years agoAdd compression interface and none/zlib implementations
Joel Rosdahl [Sun, 2 Jun 2019 20:51:42 +0000 (22:51 +0200)] 
Add compression interface and none/zlib implementations

6 years agoRevise disk format for results
Joel Rosdahl [Thu, 30 May 2019 18:37:12 +0000 (20:37 +0200)] 
Revise disk format for results

* Removed unused hash_size and reserved fields. Since there are no
  hashes stored in in the result metadata, hash size is superfluous. The
  reserved bits field is also unnecessary; if we need to change the
  format, we can just step RESULT_VERSION and be done with it.
* Instead of storing file count in the header, store an EOF marker after
  the file entries. The main reason for this is that files then can be
  appended to the result file without having to precalculate how many
  files the result will contain.
* Don’t include trailing NUL in suffix strings since the length is known.
* Instead of potentially compressing the whole file, added an
  uncompressed header telling how/if the rest of the file is
  compressed (which algorithm and level). This makes it possible to more
  efficiently recompress files in a batch job since it’s possible to
  reasonably efficiently check if a cached file should be repacked. The
  reason for not having compression info in each subfile
  header (supporting different compression algorithms/levels per
  subfile) is to make the repacking scenario simpler.
* Prepared for adding support for “reference entries”, which refer to
  other results. There are two potential use cases for reference
  entries: a) deduplication and b) storing partial results with a
  different compression algorithm/level. It’s probably only the
  deduplication use case that is interesting, though. It can be done
  either at cache miss time or later as a batch job. If we really want
  to, we can in the future add similar “raw reference entries” that
  refer to files stored verbatim in the storage, thus re-enabling hard
  link functionality.
* Changed to cCrS as the magic bytes for result files. This is analogous
  to the magic bytes used for manifest files.
* Added documentation of the format.

6 years agoRemove --enabled-aggregated feature toggle
Joel Rosdahl [Thu, 30 May 2019 18:37:06 +0000 (20:37 +0200)] 
Remove --enabled-aggregated feature toggle

6 years agoFix temp file leak in --enabled-aggregated mode
Joel Rosdahl [Sat, 1 Jun 2019 14:46:06 +0000 (16:46 +0200)] 
Fix temp file leak in --enabled-aggregated mode

6 years agoCheck and act on return value from cache_get
Joel Rosdahl [Sat, 1 Jun 2019 14:28:10 +0000 (16:28 +0200)] 
Check and act on return value from cache_get

Otherwise corrupted result files won’t get detected.

6 years agoRemove superfluous dup() call when reading cached result
Joel Rosdahl [Sat, 1 Jun 2019 14:18:56 +0000 (16:18 +0200)] 
Remove superfluous dup() call when reading cached result

6 years agoAdd missing argument to stats_update_size
Joel Rosdahl [Thu, 30 May 2019 18:35:00 +0000 (20:35 +0200)] 
Add missing argument to stats_update_size

This makes --enabled-aggregated work after being rebased to 0b3276d5.

6 years agoAdd aggregated file storing all the results (#408)
Anders Björklund [Tue, 28 May 2019 20:08:32 +0000 (22:08 +0200)] 
Add aggregated file storing all the results (#408)

* Add aggregated file storing all the results

* Add dump result method, for viewing binary

Just show sizes, not contents

* Check the results rather than cache contents

This helps when changing the cache storage

* Rename cache struct to filelist instead

Now that it doesn't really store anything

* Add version and hash size to result header

* Copy files by buffer instead of by byte

* Make aggregated result files optional

This will guard the tests, until ready to integrate

* Fix clang warning about unused macros

* Stray comma in configure broke the Mac build

* Avoid freeing the provided structure

* Avoid getting result from cache twice

* Fix partial read/write after rewrite

* Add test cases for aggregated result

* Fix wrong suffix for the depend file

* Read the .stderr with the rest of result

* Fix test suite only being run for clang

* Respect the compression level for result

6 years agorefactor: Save tmp stderr until done storing (#428)
Anders Björklund [Thu, 30 May 2019 18:55:18 +0000 (20:55 +0200)] 
refactor: Save tmp stderr until done storing (#428)

We might need it for the alternate codepaths

If not using a standard file store, it might
not be possible to move stderr instead of copy.

For those cases, use the temporary file instead.

6 years agoImprove solution to #405
Joel Rosdahl [Sun, 26 May 2019 12:02:02 +0000 (14:02 +0200)] 
Improve solution to #405

Instead of changing the global stats_file value temporarily in
update_manifest, pass which file to update explicitly to
stats_update_size.

6 years agoRemove .xml files in the doc directory on “make distclean”
Joel Rosdahl [Thu, 23 May 2019 18:46:21 +0000 (20:46 +0200)] 
Remove .xml files in the doc directory on “make distclean”

6 years agoMention xsltproc in INSTALL.md
Joel Rosdahl [Tue, 21 May 2019 19:52:27 +0000 (21:52 +0200)] 
Mention xsltproc in INSTALL.md

Related to #425.

6 years agoTweak formatting of manual text and code comments
Joel Rosdahl [Mon, 20 May 2019 19:25:27 +0000 (21:25 +0200)] 
Tweak formatting of manual text and code comments

6 years agoFix PCH detection in depend mode (+test improvements) (#427)
Luboš Luňák [Mon, 20 May 2019 19:18:16 +0000 (21:18 +0200)] 
Fix PCH detection in depend mode (+test improvements) (#427)

* do not refer to Clang's PTH in tests

The PTH feature has been removed (https://reviews.llvm.org/D54547)
and according to the commit it has never really been used. Maybe this
made sense somewhen in the past, but now those .pth files must be PCHs
internally. This commit actually just changes the .pth extensions
to .pch to avoid confusion, technically nothing should change
except for filenames.

* try to share PCH tests between GCC and Clang

Clang is supposed to be a drop-in for GCC, so in general it should
be able to handle everything GCC can. That's not completely true
in practice, there are differences, but it doesn't make sense
to completely duplicate a testcase just because there are some
differences. So start creating a shared common base for the PCH
tests and do separately only tests that act differently.

* more sharing of PCH tests between GCC and Clang

There's e.g. no need to do all kinds of complex tests with both
.gch and .pch with Clang, except for checking that Clang finds
one of them if none is specified explicitly.

* log also when pch usage is detect from pragma pch_preprocess

* try harder to verify in tests that ccache detects PCH changes

Some of the tests did that, e.g. those 'file changed', but e.g. the cached
.gch creation did not. So try to intentionally change the .gch/.h and test
that it leads to a cache miss. Otherwise there might be a hit simply
because ccache failed to detect PCH usage and ignores the .gch completely.

* clean up #include vs -fpch-preprocess in pch tests

As the manpage says, -fpch-preprocess is needed only with the #include
form, otherwise it's pointless.

* do not mention sloppiness in pch tests, only no sloppiness

Since sloppiness is normally required, so no point in stating the obvious.

* test also -include-pch with clang

* hash also pch introduced only using -include

GCC does not output the pch in the .d dependencies file, so without
this there would be false cache hits.

* be consistent about sloppiness in pch tests

create pch -> pch_defines
use pch -> time_macros

* test CCACHE_PCH_EXTSUM more thoroughly and also with -include

* pch test for .gch file being in an extra directory

* doc corrections for how to use PCH with ccache

- ccache will fail to properly detect that -include a.h means using
  a.h.gch if it requires using path from -I (they are not searched)
- -fpch-preprocess does nothing with Clang, it doesn't output
  pragma GCC pch_preprocess and so #include form for PCHs doesn't work

* explain better problems of -MD/-MMD in depend mode

6 years agoHint about not running autogen.sh when building from release archive
Joel Rosdahl [Sat, 11 May 2019 15:24:11 +0000 (17:24 +0200)] 
Hint about not running autogen.sh when building from release archive

Related to #418.

6 years agoTweak issue templates
Joel Rosdahl [Sat, 11 May 2019 15:13:13 +0000 (17:13 +0200)] 
Tweak issue templates

6 years agoImprove CONTRIBUTING.md and pull request template
Joel Rosdahl [Sat, 11 May 2019 15:10:19 +0000 (17:10 +0200)] 
Improve CONTRIBUTING.md and pull request template

6 years agoClean up detection of CI environment
Joel Rosdahl [Sat, 11 May 2019 15:00:21 +0000 (17:00 +0200)] 
Clean up detection of CI environment

“RUN_FROM_BUILD_FARM” was set by the old Samba build farm, so switch to
checking “TRAVIS” instead. Also, keep running in dev mode in Travis.

6 years agoclang's -ftime-trace is too hard (#424)
Luboš Luňák [Sat, 11 May 2019 14:54:00 +0000 (16:54 +0200)] 
clang's -ftime-trace is too hard (#424)

It produces extra .json file with timing information about the compilation.

6 years agoFix make check with "funny" locales (#420)
Luboš Luňák [Sat, 11 May 2019 14:38:33 +0000 (16:38 +0200)] 
Fix make check with "funny" locales (#420)

'ch' in cs_CZ locale is technically just one character, so directory
name 'ccache' fails the test

6 years agoImprove manual text for logging to syslog
Joel Rosdahl [Fri, 10 May 2019 19:47:51 +0000 (21:47 +0200)] 
Improve manual text for logging to syslog

As discussed in #409.

6 years agoImplement optional logging to syslog (#409)
Anders Björklund [Fri, 10 May 2019 19:46:58 +0000 (21:46 +0200)] 
Implement optional logging to syslog (#409)

* Add syslog implementation, for the log_file

The file logger has some issues with large log lines and many jobs,
so provide the "syslog" alternative when doing the ccache logging.

* Add docs on how to filter with rsyslogd(8)

6 years agoImprove performance script
Joel Rosdahl [Fri, 10 May 2019 18:48:07 +0000 (20:48 +0200)] 
Improve performance script

* Measure per-call times instead of totals.
* Use median value instead of mean value.

6 years agoAdd pull request template
Joel Rosdahl [Tue, 7 May 2019 22:06:57 +0000 (00:06 +0200)] 
Add pull request template

6 years agoTweak feature request issue template
Joel Rosdahl [Tue, 7 May 2019 21:56:19 +0000 (23:56 +0200)] 
Tweak feature request issue template

6 years agoHandle unknown manifest version gracefully in --dump-manifest
Joel Rosdahl [Sun, 5 May 2019 19:54:27 +0000 (21:54 +0200)] 
Handle unknown manifest version gracefully in --dump-manifest

Previously “ccache --dump-manifest file” would crash with an assert when
the file did not have the expected version.

6 years agoChange order of file size and hashed size in manifest
Joel Rosdahl [Sun, 5 May 2019 19:14:20 +0000 (21:14 +0200)] 
Change order of file size and hashed size in manifest

I think that it makes sense to keep hash digest and hashed bytes next to
each other since they are related.

Also:

* Renamed hashed_content_size to hsize and size to fsize.
* Fixed long source lines.

6 years agoFix object size verification + bump to 64 bit file sizes in manifest (#407)
Pavol Sakac [Sun, 5 May 2019 19:04:30 +0000 (21:04 +0200)] 
Fix object size verification + bump to 64 bit file sizes in manifest (#407)

Changed manifest format to save the actual file size along with hashed content size.
File size field in manifest updated to 64bits.
Manifest version set to 2.

Fixes #382.

6 years agoRefine “about” for the support issue template
Joel Rosdahl [Fri, 3 May 2019 18:29:37 +0000 (20:29 +0200)] 
Refine “about” for the support issue template

6 years agoTweak issue templates
Joel Rosdahl [Fri, 3 May 2019 18:24:08 +0000 (20:24 +0200)] 
Tweak issue templates

6 years agoAdd support question template
Joel Rosdahl [Thu, 2 May 2019 20:15:28 +0000 (22:15 +0200)] 
Add support question template

6 years agoAdd feature request template
Joel Rosdahl [Thu, 2 May 2019 20:15:24 +0000 (22:15 +0200)] 
Add feature request template

6 years agoImprove bug report template
Joel Rosdahl [Thu, 2 May 2019 20:06:46 +0000 (22:06 +0200)] 
Improve bug report template

6 years agoAdd bug report template
Joel Rosdahl [Thu, 2 May 2019 19:49:48 +0000 (21:49 +0200)] 
Add bug report template

6 years agoTweak comment
Joel Rosdahl [Thu, 2 May 2019 19:29:06 +0000 (21:29 +0200)] 
Tweak comment

6 years agoUpdate the correct stats file for manifest (#405)
Anders Björklund [Thu, 2 May 2019 19:28:38 +0000 (21:28 +0200)] 
Update the correct stats file for manifest (#405)

There are global variables used for updating stats,
and those were wrong for the manifest file update.

So make sure to reset those variables, before adding
the manifest (this means flushing the pending updates)

6 years agoFix source comment and documentation typos (#403)
luzpaz [Wed, 1 May 2019 19:10:24 +0000 (15:10 -0400)] 
Fix source comment and documentation typos (#403)

Found via `codespell -q 3 -L uint,thru -S ./src/zlib`

6 years agoPrepare for v3.7.1 v3.7.1
Joel Rosdahl [Wed, 1 May 2019 14:27:59 +0000 (16:27 +0200)] 
Prepare for v3.7.1

6 years agoPrepare for v3.7.1
Joel Rosdahl [Wed, 1 May 2019 14:27:39 +0000 (16:27 +0200)] 
Prepare for v3.7.1

6 years agoAvoid -Wextra-semi-stmt warnings from Clang
Joel Rosdahl [Wed, 1 May 2019 14:20:16 +0000 (16:20 +0200)] 
Avoid -Wextra-semi-stmt warnings from Clang

6 years agoUpdate NEWS
Joel Rosdahl [Wed, 1 May 2019 14:10:31 +0000 (16:10 +0200)] 
Update NEWS

6 years agoFix usage of ferror after fclose
Joel Rosdahl [Wed, 1 May 2019 14:10:18 +0000 (16:10 +0200)] 
Fix usage of ferror after fclose

6 years agoImprove fix in #400 to handle more cases
Joel Rosdahl [Wed, 1 May 2019 12:51:45 +0000 (14:51 +0200)] 
Improve fix in #400 to handle more cases

The dependency file name can come from e.g. DEPENDENCIES_OUTPUT as well,
so hash information about a /dev/null .d file after the argument
processing loop instead.

6 years agoTweak code style
Joel Rosdahl [Wed, 1 May 2019 12:25:16 +0000 (14:25 +0200)] 
Tweak code style

6 years agoHash information to make results with -MF /dev/null unique (#400)
Anders F Björklund [Mon, 29 Apr 2019 18:01:38 +0000 (20:01 +0200)] 
Hash information to make results with -MF /dev/null unique (#400)

If we first run with -MF /dev/null, then we will get a
"cache file missing" error on the next run - avoid that.

Make sure to cache the special /dev/null value, so that
it differs from the normal (ignored) dep file name...

6 years agoRevert "Bail out on “-MF /dev/null”"
Joel Rosdahl [Wed, 1 May 2019 12:21:41 +0000 (14:21 +0200)] 
Revert "Bail out on “-MF /dev/null”"

This reverts commit 253301e7ac56a9d2bed1f03a91ba73be102a0d42.

6 years agoBail out on “-MF /dev/null”
Joel Rosdahl [Wed, 1 May 2019 11:58:18 +0000 (13:58 +0200)] 
Bail out on “-MF /dev/null”

This is an alternative fix for #397, based on the observation/assumption
that using “-MF /dev/null” is only ever used as part of a compiler probe
call in combination with “-c /dev/null -o /dev/null”, so there is little
reason to cache the result. The advantage of just bailing out is to
reduce the number of special cases we have to handle.

6 years agoFix “Help wanted”/”Good first issues” links
Joel Rosdahl [Mon, 29 Apr 2019 19:03:13 +0000 (21:03 +0200)] 
Fix “Help wanted”/”Good first issues” links

6 years agoSupport using -MF /dev/null argument (#398)
Anders Björklund [Sun, 28 Apr 2019 20:50:03 +0000 (22:50 +0200)] 
Support using -MF /dev/null argument (#398)

This is sometimes used when detecting capabilities.

6 years agoSort entries in LICENSE.adoc
Joel Rosdahl [Sun, 28 Apr 2019 20:09:20 +0000 (22:09 +0200)] 
Sort entries in LICENSE.adoc

6 years agoMake uncrustify ignore newlines for enums
Joel Rosdahl [Sun, 28 Apr 2019 11:57:54 +0000 (13:57 +0200)] 
Make uncrustify ignore newlines for enums

Uncrustify doesn’t properly understand enums as return values and
ignoring newlines is an easy workaround.

6 years agoTweak typedef of the stat format function
Joel Rosdahl [Sun, 28 Apr 2019 11:56:35 +0000 (13:56 +0200)] 
Tweak typedef of the stat format function

Typedef-ing the function as a pointer type works better with uncrustify.

6 years agoCalculate length correctly in win32argvtos
Joel Rosdahl [Thu, 25 Apr 2019 19:21:53 +0000 (21:21 +0200)] 
Calculate length correctly in win32argvtos

6 years agoFix NULL argument in profile directory trace (#395)
Loïc Yhuel [Thu, 25 Apr 2019 19:19:10 +0000 (21:19 +0200)] 
Fix NULL argument in profile directory trace (#395)

With -fprofile-*=path, we currently print :
"Setting profile directory to (null)".

This fixes the build with gcc 9, which failed with :
error: ‘%s’ directive argument is null [-Werror=format-overflow=]

6 years agoFix memory and temporary file leak
Joel Rosdahl [Thu, 25 Apr 2019 18:37:37 +0000 (20:37 +0200)] 
Fix memory and temporary file leak

6 years agoFix code style
Joel Rosdahl [Thu, 25 Apr 2019 18:25:57 +0000 (20:25 +0200)] 
Fix code style

6 years agoHandle @file syntax on Windows correctly (#392)
Mike Blumenkrantz [Thu, 25 Apr 2019 18:24:01 +0000 (14:24 -0400)] 
Handle @file syntax on Windows correctly (#392)

* add length return to win32argvtos()

this is useful for determining the length of the generated argument string

* correctly handle @file syntax on Windows

the @file syntax means that the process reads command arguments from the
specified file. this is commonly used in order to shorten commands which
would otherwise be longer than the maximum length limit: many build systems
do this in all cases to avoid hitting this limit.

when a command exceeds 8192 characters on on Windows, ccache now writes
the parsed/modified arguments to a tmpfile and then runs the command using
that tmpfile with @tmpfile in order to preserve this mechanism and avoid hitting
the length limit

fixes #95

6 years agoPrepare for v3.7 v3.7
Joel Rosdahl [Tue, 23 Apr 2019 18:40:15 +0000 (20:40 +0200)] 
Prepare for v3.7

6 years agoDon’t include email addresses in authors list
Joel Rosdahl [Mon, 22 Apr 2019 19:19:36 +0000 (21:19 +0200)] 
Don’t include email addresses in authors list

Not all users have real email addresses anyway, and I don’t see any real
use for maintaining a “correct” list of addresses.

6 years agoFix Clang analyzer warning about uninitialized value
Joel Rosdahl [Mon, 22 Apr 2019 18:56:41 +0000 (20:56 +0200)] 
Fix Clang analyzer warning about uninitialized value

6 years agoUpdate NEWS
Joel Rosdahl [Mon, 22 Apr 2019 18:25:33 +0000 (20:25 +0200)] 
Update NEWS

6 years agoThe clang --analyze option is too hard (for now) (#389)
Anders Björklund [Mon, 22 Apr 2019 17:57:04 +0000 (19:57 +0200)] 
The clang --analyze option is too hard (for now) (#389)

The scan-build wrapper seems to use -analyze.

6 years agoUpgrade minitrace to latest master (#387)
Anders Björklund [Mon, 22 Apr 2019 15:19:27 +0000 (17:19 +0200)] 
Upgrade minitrace to latest master (#387)

6 years agoRename perf/perf.py to misc/performance
Joel Rosdahl [Mon, 22 Apr 2019 14:16:01 +0000 (16:16 +0200)] 
Rename perf/perf.py to misc/performance

No need for it to occupy a directory of its own.

6 years agoConvert Python scripts to Python 3 and Blacken them
Joel Rosdahl [Mon, 22 Apr 2019 14:13:13 +0000 (16:13 +0200)] 
Convert Python scripts to Python 3 and Blacken them

Because 2019.

6 years agoImprove docs for (and name of) utility scripts for tracing
Joel Rosdahl [Mon, 22 Apr 2019 13:47:18 +0000 (15:47 +0200)] 
Improve docs for (and name of) utility scripts for tracing

6 years agoSimplify trace_stop signature
Joel Rosdahl [Mon, 22 Apr 2019 13:45:34 +0000 (15:45 +0200)] 
Simplify trace_stop signature

6 years agoFix minitrace.c compilation error with GCC 7.3
Joel Rosdahl [Mon, 22 Apr 2019 13:22:07 +0000 (15:22 +0200)] 
Fix minitrace.c compilation error with GCC 7.3

The error/warning looks like this:

src/minitrace.c: In function ‘mtr_flush’:
src/minitrace.c:256:54: error: ‘%.*s’ directive output may be truncated writing up to 700 bytes into a region of size 252 [-Werror=format-truncation=]
     snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":\"%.*s\"", raw->arg_name, 700, raw->a_str);
                                                      ^~~~
In file included from /usr/include/stdio.h:862:0,
                 from src/minitrace.c:9:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output 6 or more bytes (assuming 706) into a destination of size 256
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

6 years agoUpdate NEWS
Joel Rosdahl [Mon, 22 Apr 2019 13:17:22 +0000 (15:17 +0200)] 
Update NEWS

6 years agoRevert "Support for Fortran 77"
Joel Rosdahl [Mon, 22 Apr 2019 13:15:23 +0000 (15:15 +0200)] 
Revert "Support for Fortran 77"

This reverts commit c0875cf2dae56f66076ee01e0ca6e723ba999199.

Fixes #342.

6 years agoFix bugs in the newly introduced tracing mode (#386)
Anders Björklund [Mon, 22 Apr 2019 13:09:18 +0000 (15:09 +0200)] 
Fix bugs in the newly introduced tracing mode (#386)

* The tracefile variable is not used anymore

This caused trace files to be left in /tmp

* Fix crash in tracing mode, caused by logging

Unfortunately cc_log() requires conf to work

6 years agoUpdate NEWS
Joel Rosdahl [Sun, 21 Apr 2019 20:14:16 +0000 (22:14 +0200)] 
Update NEWS

6 years agoTweak manuals and code related to tracing
Joel Rosdahl [Sun, 21 Apr 2019 20:12:06 +0000 (22:12 +0200)] 
Tweak manuals and code related to tracing

6 years agoAdd optional support for microsecond tracing (#280)
Anders Björklund [Sun, 21 Apr 2019 19:59:03 +0000 (21:59 +0200)] 
Add optional support for microsecond tracing (#280)

* Add third-party minitrace library for tracing
* Add a time_seconds helper, for portability
* Add basic tracing support, using minitrace
* Add script to combine multiple trace.json

6 years agoUse localtime_r instead of localtime
Joel Rosdahl [Sun, 21 Apr 2019 15:44:23 +0000 (17:44 +0200)] 
Use localtime_r instead of localtime

This pleases linters that dislike localtime(3).

6 years agoRemove NEWS entry for #374
Joel Rosdahl [Tue, 16 Apr 2019 04:48:34 +0000 (06:48 +0200)] 
Remove NEWS entry for #374

The bug does not exist in any released version.

6 years agoUpdate NEWS
Joel Rosdahl [Mon, 15 Apr 2019 19:41:38 +0000 (21:41 +0200)] 
Update NEWS

6 years agoTweak source code comments
Joel Rosdahl [Mon, 15 Apr 2019 19:40:41 +0000 (21:40 +0200)] 
Tweak source code comments

6 years agoTouch up NEWS.adoc
Joel Rosdahl [Mon, 15 Apr 2019 19:35:38 +0000 (21:35 +0200)] 
Touch up NEWS.adoc

* Use “-” for bullets consistently.
* Use “curly quotation marks” instead of ``asciidoctor'' quotation style
  for readability, and similar for apostrophes.

6 years agoCopy rather than link depend from the cache (#379)
Anders Björklund [Mon, 15 Apr 2019 19:35:08 +0000 (21:35 +0200)] 
Copy rather than link depend from the cache (#379)

The depends are small enough to avoid the copy, since it leads
to issues with mv when using automake to generate the Makefile.

6 years agoImprove handling of debug levels
Joel Rosdahl [Sat, 13 Apr 2019 20:52:23 +0000 (22:52 +0200)] 
Improve handling of debug levels

Fixes #368.

* Remember if we have seen any option on level 3.
* Let “-g0”, “-ggdb0” and similar cancel out any previously seen “-g”
  options except “-gsplit-dwarf”. This is based on observations on how
  GCC 7.3 behaves.
* Delay acting on seen debug options until after we have processed all
  arguments. This way we can avoid e.g. hashing the current directory if
  we get “-g3 -g0”.

6 years agoReuse previous depend mode hash result to avoid some extra work
Joel Rosdahl [Thu, 11 Apr 2019 20:12:13 +0000 (22:12 +0200)] 
Reuse previous depend mode hash result to avoid some extra work