]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
5 years agoReplace fatal function with throwing FatalError exception explicitly
Joel Rosdahl [Mon, 3 Aug 2020 18:03:13 +0000 (20:03 +0200)] 
Replace fatal function with throwing FatalError exception explicitly

I think that this improves code readability since it’s more clear what
the code flow is.

5 years agoUse fmt::print instead of (f)printf
Joel Rosdahl [Mon, 3 Aug 2020 14:58:47 +0000 (16:58 +0200)] 
Use fmt::print instead of (f)printf

5 years agoRemove superfluous .c_str() calls
Joel Rosdahl [Mon, 3 Aug 2020 15:00:42 +0000 (17:00 +0200)] 
Remove superfluous .c_str() calls

5 years agoC++-ify path_max
Joel Rosdahl [Mon, 3 Aug 2020 14:58:20 +0000 (16:58 +0200)] 
C++-ify path_max

5 years agoConvert cc_log calls to Logging::log
Joel Rosdahl [Mon, 3 Aug 2020 05:18:19 +0000 (07:18 +0200)] 
Convert cc_log calls to Logging::log

5 years agoC++-ify logging routines
Joel Rosdahl [Mon, 3 Aug 2020 05:04:31 +0000 (07:04 +0200)] 
C++-ify logging routines

- 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.

5 years agoAdd missing “Util::” test case prefix
Joel Rosdahl [Sat, 1 Aug 2020 07:34:10 +0000 (09:34 +0200)] 
Add missing “Util::” test case prefix

5 years agoMove logging.cpp’s print_command to Util
Joel Rosdahl [Sat, 1 Aug 2020 07:33:45 +0000 (09:33 +0200)] 
Move logging.cpp’s print_command to Util

5 years agoLet CCACHE_UMASK apply only to files/directories in the cache directory
Joel Rosdahl [Sat, 1 Aug 2020 14:39:11 +0000 (16:39 +0200)] 
Let CCACHE_UMASK apply only to files/directories in the cache directory

Ever since the CCACHE_UMASK setting was added in
75dd382407a36b3ebab36bb1027eb43a07498bec it has applied to all files
created by ccache, including files such as the object files and
executables created when ccache is called for linking. This was
presumably the easy thing to do, but it affects the observable output
from the compiler. There are also two related bugs:

1. CCACHE_UMASK is not used when creating the initial configuration file.
2. CCACHE_UMASK is used when creating the log file.

Fix this by:

- saving the original umask in Context,
- introducing a UmaskScope class,
- using UmaskScope objects to set the original umask when calling the
  compiler and when copying result files from the cache, and
- setting the umask after creating the log file but before creating the
  initial configuration file.

Closes #628.

5 years agoResultRetriever: Clear m_dest_data between entries
Joel Rosdahl [Sat, 1 Aug 2020 07:49:45 +0000 (09:49 +0200)] 
ResultRetriever: Clear m_dest_data between entries

m_dest_data accidentally keeps its data between result entries so if an
entry has both stderr and dependency file data the stderr data will end
up in the dependency file as well. Fix this by clearing m_dest_data
properly.

Regression in 1cbaa89d1175c906bea48e40eb8f5e8c56b5afe4.

Fixes #629.

5 years agoRemove now empty legacy_util.[hc]pp files
Joel Rosdahl [Fri, 31 Jul 2020 18:10:13 +0000 (20:10 +0200)] 
Remove now empty legacy_util.[hc]pp files

5 years agoMove time_seconds function to MiniTrace.cpp where it’s used
Joel Rosdahl [Fri, 31 Jul 2020 18:09:29 +0000 (20:09 +0200)] 
Move time_seconds function to MiniTrace.cpp where it’s used

5 years agoMove set_cloexec_flag to Util
Joel Rosdahl [Fri, 31 Jul 2020 18:07:06 +0000 (20:07 +0200)] 
Move set_cloexec_flag to Util

5 years agoC++-ify x_rename
Joel Rosdahl [Fri, 31 Jul 2020 17:59:49 +0000 (19:59 +0200)] 
C++-ify x_rename

5 years agoRemove unnecessary x_exit function
Joel Rosdahl [Fri, 31 Jul 2020 17:35:53 +0000 (19:35 +0200)] 
Remove unnecessary x_exit function

It’s no longer necessary to use it after
91aa70754c3816537b080fef1c6630313b400721.

5 years agoC++-ify update_mtime
Joel Rosdahl [Fri, 31 Jul 2020 17:33:23 +0000 (19:33 +0200)] 
C++-ify update_mtime

5 years agoC++-ify is_full_path
Joel Rosdahl [Fri, 31 Jul 2020 17:28:48 +0000 (19:28 +0200)] 
C++-ify is_full_path

5 years agoConvert FATAL macro to a function
Joel Rosdahl [Fri, 31 Jul 2020 17:25:07 +0000 (19:25 +0200)] 
Convert FATAL macro to a function

5 years agoC++-ify get_home_directory
Joel Rosdahl [Fri, 31 Jul 2020 17:12:14 +0000 (19:12 +0200)] 
C++-ify get_home_directory

5 years agoInline Util::{starts,ends}_with
Joel Rosdahl [Fri, 31 Jul 2020 07:43:53 +0000 (09:43 +0200)] 
Inline Util::{starts,ends}_with

5 years agoRemove now unused str_eq, str_startswith and str_endswith macros
Joel Rosdahl [Thu, 30 Jul 2020 18:57:35 +0000 (20:57 +0200)] 
Remove now unused str_eq, str_startswith and str_endswith macros

5 years agoRemove last usage of legacy str_startswith macro
Joel Rosdahl [Thu, 30 Jul 2020 18:57:21 +0000 (20:57 +0200)] 
Remove last usage of legacy str_startswith macro

5 years agoRemove superfluous includes of ccache.hpp
Joel Rosdahl [Thu, 30 Jul 2020 18:07:41 +0000 (20:07 +0200)] 
Remove superfluous includes of ccache.hpp

5 years agoFix fmt::format error
Joel Rosdahl [Thu, 30 Jul 2020 18:03:41 +0000 (20:03 +0200)] 
Fix fmt::format error

Introduced in ed21c1feb83f62b9a2d04e959e9a3abd4eac2879.

5 years agoAdd Util::localtime, abstracting localtime_r
Joel Rosdahl [Thu, 30 Jul 2020 11:03:24 +0000 (13:03 +0200)] 
Add Util::localtime, abstracting localtime_r

5 years agoFix cherry-pick mistake in 71edf04aa2c7
Joel Rosdahl [Thu, 30 Jul 2020 06:43:05 +0000 (08:43 +0200)] 
Fix cherry-pick mistake in 71edf04aa2c7

5 years agoRemove redundant check in parse_duration after f93c55832ee3
Joel Rosdahl [Thu, 30 Jul 2020 06:25:29 +0000 (08:25 +0200)] 
Remove redundant check in parse_duration after f93c55832ee3

5 years agoC++-ify x_unsetenv
Joel Rosdahl [Thu, 30 Jul 2020 05:24:28 +0000 (07:24 +0200)] 
C++-ify x_unsetenv

5 years agoC++-ify x_setenv
Joel Rosdahl [Thu, 30 Jul 2020 05:21:45 +0000 (07:21 +0200)] 
C++-ify x_setenv

5 years agoMove get_hostname to Util
Joel Rosdahl [Thu, 30 Jul 2020 05:16:00 +0000 (07:16 +0200)] 
Move get_hostname to Util

5 years agoC++-ify parts of ccache.cpp
Joel Rosdahl [Wed, 29 Jul 2020 19:34:32 +0000 (21:34 +0200)] 
C++-ify parts of ccache.cpp

5 years agoC++-ify hashutil functions
Joel Rosdahl [Wed, 29 Jul 2020 18:31:53 +0000 (20:31 +0200)] 
C++-ify hashutil functions

5 years agoUse std::string in InodeCache APIs
Joel Rosdahl [Wed, 29 Jul 2020 17:15:58 +0000 (19:15 +0200)] 
Use std::string in InodeCache APIs

5 years agoC++-ify is_precompiled_header and move to Util
Joel Rosdahl [Wed, 29 Jul 2020 17:10:23 +0000 (19:10 +0200)] 
C++-ify is_precompiled_header and move to Util

5 years agoRemove superfluous hash_from_int function
Joel Rosdahl [Wed, 29 Jul 2020 16:51:59 +0000 (18:51 +0200)] 
Remove superfluous hash_from_int function

5 years agoC++-ify, and clean up usage of, add_exe_ext_if_no_to_fullpath
Joel Rosdahl [Wed, 29 Jul 2020 14:39:42 +0000 (16:39 +0200)] 
C++-ify, and clean up usage of, add_exe_ext_if_no_to_fullpath

5 years agoC++-ify win32argvtos
Joel Rosdahl [Wed, 29 Jul 2020 12:29:14 +0000 (14:29 +0200)] 
C++-ify win32argvtos

5 years agoRename win32compat to Win32Util
Joel Rosdahl [Wed, 29 Jul 2020 06:43:21 +0000 (08:43 +0200)] 
Rename win32compat to Win32Util

5 years agoC++-ify execute functions
Joel Rosdahl [Tue, 28 Jul 2020 18:06:36 +0000 (20:06 +0200)] 
C++-ify execute functions

5 years agoTweak function comment
Joel Rosdahl [Tue, 28 Jul 2020 18:06:26 +0000 (20:06 +0200)] 
Tweak function comment

5 years agoRemove obsolete struct pending_tmp_file declaration
Joel Rosdahl [Tue, 28 Jul 2020 18:05:29 +0000 (20:05 +0200)] 
Remove obsolete struct pending_tmp_file declaration

5 years agoConvert fatal() function to macro that forwards to fmt::format
Joel Rosdahl [Tue, 28 Jul 2020 17:53:13 +0000 (19:53 +0200)] 
Convert fatal() function to macro that forwards to fmt::format

5 years agoC++-ify {copy,write}_fd
Joel Rosdahl [Tue, 28 Jul 2020 14:46:26 +0000 (16:46 +0200)] 
C++-ify {copy,write}_fd

5 years agoAdd .mailmap entry for Arne Hasselbring
Joel Rosdahl [Tue, 28 Jul 2020 14:28:20 +0000 (16:28 +0200)] 
Add .mailmap entry for Arne Hasselbring

5 years agoFix comments to match reality
Joel Rosdahl [Tue, 28 Jul 2020 12:01:53 +0000 (14:01 +0200)] 
Fix comments to match reality

5 years agoRemove now unused legacy format function
Joel Rosdahl [Tue, 28 Jul 2020 12:00:03 +0000 (14:00 +0200)] 
Remove now unused legacy format function

5 years agoRemove last usages of the legacy format function
Joel Rosdahl [Tue, 28 Jul 2020 11:58:31 +0000 (13:58 +0200)] 
Remove last usages of the legacy format function

5 years agoC++-ify same_executable_name
Joel Rosdahl [Tue, 28 Jul 2020 11:56:30 +0000 (13:56 +0200)] 
C++-ify same_executable_name

5 years agoUse more natural order of ColorDiagnostics enum values
Joel Rosdahl [Tue, 28 Jul 2020 07:33:16 +0000 (09:33 +0200)] 
Use more natural order of ColorDiagnostics enum values

5 years agoRemove now unused legacy x_strdup function
Joel Rosdahl [Tue, 28 Jul 2020 07:04:50 +0000 (09:04 +0200)] 
Remove now unused legacy x_strdup function

5 years agoC++-ify {clone,copy,move}_file
Joel Rosdahl [Tue, 28 Jul 2020 07:03:05 +0000 (09:03 +0200)] 
C++-ify {clone,copy,move}_file

5 years agoFix build with Clang 10
Joel Rosdahl [Mon, 27 Jul 2020 18:56:45 +0000 (20:56 +0200)] 
Fix build with Clang 10

Clang 10 says “error: explicitly defaulted move constructor is
implicitly deleted [...] note: move constructor of 'TemporaryFile' is
implicitly deleted because base class 'NonCopyable' has a deleted move
constructor”, so we’ll just have to do without NonCopyable. The effect
will be the same in pracice due to the “Fd fd” member not being
copyable.

5 years agoRemove now unused legacy x_strndup function
Joel Rosdahl [Mon, 27 Jul 2020 18:26:42 +0000 (20:26 +0200)] 
Remove now unused legacy x_strndup function

5 years agoC++-ify parsing of ccache options
Joel Rosdahl [Mon, 27 Jul 2020 18:26:07 +0000 (20:26 +0200)] 
C++-ify parsing of ccache options

5 years agoRemove now unused legacy reformat function
Joel Rosdahl [Mon, 27 Jul 2020 18:04:43 +0000 (20:04 +0200)] 
Remove now unused legacy reformat function

5 years agoC++-ify parse_size_with_suffix
Joel Rosdahl [Mon, 27 Jul 2020 18:03:06 +0000 (20:03 +0200)] 
C++-ify parse_size_with_suffix

5 years agoC++-ify subst_env_in_string
Joel Rosdahl [Mon, 27 Jul 2020 13:25:04 +0000 (15:25 +0200)] 
C++-ify subst_env_in_string

5 years agoAdd missing curly braces
Joel Rosdahl [Mon, 27 Jul 2020 07:40:05 +0000 (09:40 +0200)] 
Add missing curly braces

5 years agoSimplify and clean up parse_duration_with_suffix_to_seconds
Joel Rosdahl [Sun, 26 Jul 2020 19:07:09 +0000 (21:07 +0200)] 
Simplify and clean up parse_duration_with_suffix_to_seconds

5 years agoMove and convert parse_unsigned to Util::parse_uint32
Joel Rosdahl [Sun, 26 Jul 2020 19:05:30 +0000 (21:05 +0200)] 
Move and convert parse_unsigned to Util::parse_uint32

5 years agoKeep argument lists and function implementations sorted
Joel Rosdahl [Sun, 26 Jul 2020 18:20:37 +0000 (20:20 +0200)] 
Keep argument lists and function implementations sorted

5 years agoImprove documentation of --evict-older-than
Joel Rosdahl [Sun, 26 Jul 2020 18:19:45 +0000 (20:19 +0200)] 
Improve documentation of --evict-older-than

5 years agoC++-ify stats functions
Joel Rosdahl [Sun, 26 Jul 2020 14:38:57 +0000 (16:38 +0200)] 
C++-ify stats functions

5 years agoC++-ify format_{human_readable_size,parsable_size_with_suffix}
Joel Rosdahl [Sun, 26 Jul 2020 14:27:53 +0000 (16:27 +0200)] 
C++-ify format_{human_readable_size,parsable_size_with_suffix}

5 years agoAdd --evict-older-than (#605)
Sumit Jamgade [Sun, 26 Jul 2020 18:14:19 +0000 (20:14 +0200)] 
Add --evict-older-than (#605)

The argument adds another mechanism to control contents of cache directory. And
is based on the LRU tracking behaviour.

As of now there is no way for ccache to eliminate files which were
are no longer needed. As a result these files stay and are kept around until
either max_files/max_size is reached.

If a particular project is being built regularly but for some reason is allowed
to grow in size, then under such circumstances using the LRU mechanism to control
cache size, lends as perfect solution.

The argument takes a parameter N and performs a cleanup.
While performing cleanup the oldest file in ccache can
only be N seconds old. However this cleanup will not take max_files and
max_old into consideration

5 years agoLet ResultRetriever collect and operate on the full dependency data
Joel Rosdahl [Sat, 25 Jul 2020 18:29:44 +0000 (20:29 +0200)] 
Let ResultRetriever collect and operate on the full dependency data

When rewriting the dependency target (#592) the target can in theory
span chunk boundaries, so let ResultRetriever collect and operate on the
full data, just like the stderr output.

5 years agoSimplify and clean up tests
Joel Rosdahl [Sat, 25 Jul 2020 17:40:43 +0000 (19:40 +0200)] 
Simplify and clean up tests

5 years agoMove “rewrite dependency target” decision from ArgsInfo to ccache.cpp
Joel Rosdahl [Sat, 25 Jul 2020 17:06:47 +0000 (19:06 +0200)] 
Move “rewrite dependency target” decision from ArgsInfo to ccache.cpp

As noted in a comment to #592.

5 years agoHandle clang PCHs (#539) (#624)
ahasselbring [Sat, 25 Jul 2020 19:37:32 +0000 (21:37 +0200)] 
Handle clang PCHs (#539) (#624)

Co-authored-by: Cristian Adam <cristian.adam@gmail.com>
5 years agoShare cache for different object file names with -MD/-MMD (#592)
Deepak Yadav [Sat, 25 Jul 2020 14:49:33 +0000 (20:19 +0530)] 
Share cache for different object file names with -MD/-MMD (#592)

5 years agoRemove now unused legacy functions related to temporary files
Joel Rosdahl [Sat, 25 Jul 2020 14:01:06 +0000 (16:01 +0200)] 
Remove now unused legacy functions related to temporary files

5 years agoIntroduce and use TemporaryFile class
Joel Rosdahl [Sat, 25 Jul 2020 13:56:29 +0000 (15:56 +0200)] 
Introduce and use TemporaryFile class

In addition to improving code clarity, this fixes a bug where the
fallback code for “-fdiagnostics-color” tried to operate on a closed
file descriptor.

5 years agoAdd CI job that verifies -DENABLE_TRACING
Joel Rosdahl [Sat, 25 Jul 2020 13:49:11 +0000 (15:49 +0200)] 
Add CI job that verifies -DENABLE_TRACING

5 years agoMake -DENABLE_TRACING work again
Joel Rosdahl [Sat, 25 Jul 2020 13:46:40 +0000 (15:46 +0200)] 
Make -DENABLE_TRACING work again

5 years agoRemove now unused legacy create_tmp_file
Joel Rosdahl [Fri, 24 Jul 2020 18:49:38 +0000 (20:49 +0200)] 
Remove now unused legacy create_tmp_file

5 years agoLook for the correct phrase when detecting unsupported GCC color option
Joel Rosdahl [Fri, 24 Jul 2020 18:18:22 +0000 (20:18 +0200)] 
Look for the correct phrase when detecting unsupported GCC color option

The implementation from #596 uses the spelling “command-line” instead of
“command line” (which is what is actually emitted by GCC and specified
in #224).

5 years agoMake it possible to keep the test directory when running test suite
Joel Rosdahl [Fri, 24 Jul 2020 18:17:43 +0000 (20:17 +0200)] 
Make it possible to keep the test directory when running test suite

5 years agoRemove test directory for skipped test suite
Joel Rosdahl [Fri, 24 Jul 2020 13:57:08 +0000 (15:57 +0200)] 
Remove test directory for skipped test suite

5 years agoUpdate NEWS
Joel Rosdahl [Tue, 21 Jul 2020 18:21:01 +0000 (20:21 +0200)] 
Update NEWS

(cherry picked from commit 4293f48b6670a99eaa1d5701718d8ef3f2ddd70d)

5 years agoUse apostrophes and citation marks in NEWS.adoc consistently
Joel Rosdahl [Tue, 21 Jul 2020 18:14:38 +0000 (20:14 +0200)] 
Use apostrophes and citation marks in NEWS.adoc consistently

(cherry picked from commit d524e19712e832bc9cf3db841c8b5ccd37c0e9f9)

5 years agoAllow (require) argument to -Werror for NVCC
Joel Rosdahl [Tue, 21 Jul 2020 17:45:58 +0000 (19:45 +0200)] 
Allow (require) argument to -Werror for NVCC

Fixes #598.

(cherry picked from commit c5349149864104146dab2c9bcd67a1b2ff565f06)

5 years agoAdd knowledge about -fprofile-{correction,reorder-functions,values}
Joel Rosdahl [Tue, 21 Jul 2020 13:00:59 +0000 (15:00 +0200)] 
Add knowledge about -fprofile-{correction,reorder-functions,values}

Fixes #615.

(cherry picked from commit c1bf116630f22952732feeffaa71b827c1e813bd)

5 years agoHandle EINTR properly in Result::Writer::write_embedded_file_entry
Joel Rosdahl [Sun, 19 Jul 2020 18:47:55 +0000 (20:47 +0200)] 
Handle EINTR properly in Result::Writer::write_embedded_file_entry

5 years agoAvoid some format/free usage
Joel Rosdahl [Fri, 17 Jul 2020 17:46:40 +0000 (19:46 +0200)] 
Avoid some format/free usage

5 years agoRemove no longer needed cleanup of CACHEDIR.TAG in $CCACHE_DIR
Joel Rosdahl [Fri, 17 Jul 2020 16:28:36 +0000 (18:28 +0200)] 
Remove no longer needed cleanup of CACHEDIR.TAG in $CCACHE_DIR

The cleanup functionality was added in 3.2 and it should be safe to
assume that it has performed its task for almost everybody now.

5 years agoRemove now unused legacy util functions
Joel Rosdahl [Thu, 16 Jul 2020 15:09:13 +0000 (17:09 +0200)] 
Remove now unused legacy util functions

5 years agoRemove usage of x_strdup
Joel Rosdahl [Fri, 17 Jul 2020 11:33:08 +0000 (13:33 +0200)] 
Remove usage of x_strdup

5 years agoUse Util::dir_name instead of legacy dir_name function
Joel Rosdahl [Fri, 17 Jul 2020 11:28:45 +0000 (13:28 +0200)] 
Use Util::dir_name instead of legacy dir_name function

5 years agoUse Util::read_file instead of legacy read_file function
Joel Rosdahl [Fri, 17 Jul 2020 11:19:15 +0000 (13:19 +0200)] 
Use Util::read_file instead of legacy read_file function

5 years agoAdd size_hint parameter to Util::read_file
Joel Rosdahl [Fri, 17 Jul 2020 11:17:25 +0000 (13:17 +0200)] 
Add size_hint parameter to Util::read_file

Similar to the legacy read_file’s size_hint parameter.

5 years agoLet Util::write_file default to binary mode
Joel Rosdahl [Fri, 17 Jul 2020 17:37:48 +0000 (19:37 +0200)] 
Let Util::write_file default to binary mode

That makes more sense since that’s how it’s used in practice.

5 years agoUse Util::read_file instead of legacy read_text_file
Joel Rosdahl [Thu, 16 Jul 2020 15:08:28 +0000 (17:08 +0200)] 
Use Util::read_file instead of legacy read_text_file

5 years agoC++-ify format_command and print_command and move to where used
Joel Rosdahl [Thu, 16 Jul 2020 15:03:52 +0000 (17:03 +0200)] 
C++-ify format_command and print_command and move to where used

5 years agoC++-ify logging routines
Joel Rosdahl [Thu, 16 Jul 2020 14:52:47 +0000 (16:52 +0200)] 
C++-ify logging routines

5 years agoUse File wrapper for static log file object
Joel Rosdahl [Thu, 16 Jul 2020 14:36:46 +0000 (16:36 +0200)] 
Use File wrapper for static log file object

This flushes and closes the underlying FILE object properly on exit.

5 years agoCreate test directories in testdir and remove it on “make clean”
Joel Rosdahl [Tue, 14 Jul 2020 13:56:31 +0000 (15:56 +0200)] 
Create test directories in testdir and remove it on “make clean”

5 years agoProbe assembler for supported -m* flags
Joel Rosdahl [Tue, 14 Jul 2020 13:08:22 +0000 (15:08 +0200)] 
Probe assembler for supported -m* flags

Since CMake uses the assembler executable for compiling assembler source
code it’s not quite correct to probe the C++ compiler (nor the C
compiler) since it may not be the same as the assembler.

Fixes #625.

5 years agoImprove instructions on how to install libzstd
Joel Rosdahl [Mon, 13 Jul 2020 20:22:16 +0000 (22:22 +0200)] 
Improve instructions on how to install libzstd

5 years agoUpdate Travis-CI badge URL to travis-ci.com
Joel Rosdahl [Mon, 13 Jul 2020 20:01:13 +0000 (22:01 +0200)] 
Update Travis-CI badge URL to travis-ci.com

5 years agoRemove now unused get_extension function
Joel Rosdahl [Mon, 13 Jul 2020 18:01:46 +0000 (20:01 +0200)] 
Remove now unused get_extension function