]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
5 years agoTurn lock_staleness_limit into a constant 543/head
Thomas Otto [Sun, 26 Jan 2020 20:34:34 +0000 (21:34 +0100)] 
Turn lock_staleness_limit into a constant

Remove now-empty legacy_globals.cpp/hpp.

5 years agoContext: move counters
Thomas Otto [Mon, 27 Jan 2020 19:22:31 +0000 (20:22 +0100)] 
Context: move counters

5 years agoContext: move ignore_headers_len, remove cc_reset()
Thomas Otto [Mon, 27 Jan 2020 18:57:23 +0000 (19:57 +0100)] 
Context: move ignore_headers_len, remove cc_reset()

5 years agoContext: move included_pch_file and convert to std::string
Thomas Otto [Sun, 26 Jan 2020 20:16:58 +0000 (21:16 +0100)] 
Context: move included_pch_file and convert to std::string

5 years agoContext: move guessed_compiler
Thomas Otto [Sun, 26 Jan 2020 20:14:34 +0000 (21:14 +0100)] 
Context: move guessed_compiler

5 years agoConvert guessed_compiler into an enum class
Thomas Otto [Sun, 26 Jan 2020 20:09:14 +0000 (21:09 +0100)] 
Convert guessed_compiler into an enum class

5 years agoContext: move manifest_stats_file and convert to std::string
Thomas Otto [Sun, 26 Jan 2020 20:03:55 +0000 (21:03 +0100)] 
Context: move manifest_stats_file and convert to std::string

5 years agoContext: move cpp_stderr and convert to std::string
Thomas Otto [Sat, 25 Jan 2020 10:02:07 +0000 (11:02 +0100)] 
Context: move cpp_stderr and convert to std::string

5 years agoContext: move i_tmpfile and converted to std::string
Thomas Otto [Sat, 25 Jan 2020 10:00:35 +0000 (11:00 +0100)] 
Context: move i_tmpfile and converted to std::string

5 years agoContext: move has_absolute_include_headers
Thomas Otto [Sat, 25 Jan 2020 09:55:49 +0000 (10:55 +0100)] 
Context: move has_absolute_include_headers

5 years agoContext: move g_included_files
Thomas Otto [Sat, 25 Jan 2020 09:54:50 +0000 (10:54 +0100)] 
Context: move g_included_files

5 years agoContext: move time_of_compilation, adapt manifest
Thomas Otto [Sat, 25 Jan 2020 09:49:49 +0000 (10:49 +0100)] 
Context: move time_of_compilation, adapt manifest

5 years agoContext: move manifest_path and converted to std::string
Thomas Otto [Sat, 25 Jan 2020 09:46:54 +0000 (10:46 +0100)] 
Context: move manifest_path and converted to std::string

5 years agoContext: move (cached_)result_name/result_path
Thomas Otto [Sat, 25 Jan 2020 09:44:12 +0000 (10:44 +0100)] 
Context: move (cached_)result_name/result_path

Also convert result_path to std::string.

5 years agoContext: move arch_args
Thomas Otto [Sat, 25 Jan 2020 09:40:47 +0000 (10:40 +0100)] 
Context: move arch_args

5 years agoContext: move output_is_precompiled_header
Thomas Otto [Fri, 24 Jan 2020 19:16:47 +0000 (20:16 +0100)] 
Context: move output_is_precompiled_header

5 years agoPartially revert const-ification of context parameters
Thomas Otto [Mon, 17 Feb 2020 20:08:26 +0000 (21:08 +0100)] 
Partially revert const-ification of context parameters

5 years agoImprove functions related to CWD
Joel Rosdahl [Sun, 16 Feb 2020 12:06:24 +0000 (13:06 +0100)] 
Improve functions related to CWD

The different functions related to current working directory (CWD) have
become messy during the years:

- gnu_getcwd is a simple wrapper around getcwd(3), thus returning the
  actual canonical path.
- get_cwd returns $PWD, falling back to getcwd(3) if $PWD is not sane.
- get_current_working_dir (local function in ccache.cpp) memoizes
  x_realpath(get_cwd()) (i.e., getcwd(3) in essence...) in the global
  current_working_dir variable. Unit tests may manipulate
  current_working_dir.

Improve this by:

- Replacing gnu_getcwd with Util::get_actual_cwd.
- Replacing get_cwd with Util::get_apparent_cwd.
- Removing get_current_working_dir and placing both actual and apparent
  CWD in the context object.

5 years agoSimplify (non-)freeing of orig_args on failure
Joel Rosdahl [Sun, 16 Feb 2020 20:11:18 +0000 (21:11 +0100)] 
Simplify (non-)freeing of orig_args on failure

5 years agoSimplify string creation from string_view
Joel Rosdahl [Sun, 16 Feb 2020 19:44:42 +0000 (20:44 +0100)] 
Simplify string creation from string_view

5 years agoRemove now redundant resetting of config
Joel Rosdahl [Sun, 16 Feb 2020 18:40:58 +0000 (19:40 +0100)] 
Remove now redundant resetting of config

Since the configuation no longer is global there is no need to reset the
unmodified Config object passed by cct_test_begin to cc_reset.

5 years agoConst-ify context parameters where appropriate
Joel Rosdahl [Sun, 16 Feb 2020 18:14:53 +0000 (19:14 +0100)] 
Const-ify context parameters where appropriate

5 years agoMerge pull request #542 from totph/ctx4
Joel Rosdahl [Sun, 16 Feb 2020 20:12:51 +0000 (21:12 +0100)] 
Merge pull request #542 from totph/ctx4

Context: g_config, stats_file and orig_args moved

5 years agoContext: move orig_args 542/head
Thomas Otto [Sat, 25 Jan 2020 09:38:06 +0000 (10:38 +0100)] 
Context: move orig_args

5 years agoContext: convert stats_file to an std::string
Thomas Otto [Sat, 25 Jan 2020 09:24:35 +0000 (10:24 +0100)] 
Context: convert stats_file to an std::string

Also adapted downstream stats functions.

5 years agoContext: move stats_file
Thomas Otto [Sat, 25 Jan 2020 09:24:35 +0000 (10:24 +0100)] 
Context: move stats_file

5 years agoContext: move g_config
Thomas Otto [Sun, 26 Jan 2020 20:34:40 +0000 (21:34 +0100)] 
Context: move g_config

5 years agoImplement Util::read_link, replacing legacy x_readlink
Joel Rosdahl [Tue, 11 Feb 2020 20:56:02 +0000 (21:56 +0100)] 
Implement Util::read_link, replacing legacy x_readlink

5 years agoImplement Util::real_path, replacing legacy x_realpath
Joel Rosdahl [Tue, 11 Feb 2020 20:34:43 +0000 (21:34 +0100)] 
Implement Util::real_path, replacing legacy x_realpath

5 years agoMerge pull request #541 from totph/ctx3
Joel Rosdahl [Sat, 15 Feb 2020 15:14:35 +0000 (16:14 +0100)] 
Merge pull request #541 from totph/ctx3

Context: move 9 more globals

5 years agoContext: move using_precompiled_header 541/head
Thomas Otto [Fri, 24 Jan 2020 19:23:14 +0000 (20:23 +0100)] 
Context: move using_precompiled_header

5 years agoContext: move profile_use/profile_generate
Thomas Otto [Fri, 24 Jan 2020 19:20:45 +0000 (20:20 +0100)] 
Context: move profile_use/profile_generate

5 years agoContext: move direct_i_file
Thomas Otto [Fri, 24 Jan 2020 19:13:41 +0000 (20:13 +0100)] 
Context: move direct_i_file

5 years agoContext: move profile_dir
Thomas Otto [Fri, 24 Jan 2020 19:11:24 +0000 (20:11 +0100)] 
Context: move profile_dir

5 years agoContext: move profile_arcs
Thomas Otto [Fri, 24 Jan 2020 19:01:03 +0000 (20:01 +0100)] 
Context: move profile_arcs

5 years agoContext: move seen_split_dwarf
Thomas Otto [Fri, 24 Jan 2020 18:59:21 +0000 (19:59 +0100)] 
Context: move seen_split_dwarf

5 years agoContext: move generating_diagnostics
Thomas Otto [Fri, 24 Jan 2020 18:54:21 +0000 (19:54 +0100)] 
Context: move generating_diagnostics

5 years agoContext: move generating_stackusage
Thomas Otto [Fri, 24 Jan 2020 18:49:32 +0000 (19:49 +0100)] 
Context: move generating_stackusage

5 years agoContext: move generating_coverage
Thomas Otto [Fri, 24 Jan 2020 18:45:36 +0000 (19:45 +0100)] 
Context: move generating_coverage

5 years agoRename clang-format.sh to run-clang-format
Joel Rosdahl [Thu, 13 Feb 2020 20:56:54 +0000 (21:56 +0100)] 
Rename clang-format.sh to run-clang-format

This avoids exposing implementation details.

5 years agoBuild static Windows executables
Joel Rosdahl [Thu, 13 Feb 2020 20:45:33 +0000 (21:45 +0100)] 
Build static Windows executables

This makes it possible to run e.g. the unittest binary in Wine.

5 years agoSimplify result_name_from_depfile signature
Joel Rosdahl [Thu, 13 Feb 2020 20:32:07 +0000 (21:32 +0100)] 
Simplify result_name_from_depfile signature

5 years agoSimplify Util::{base,dir}_name
Joel Rosdahl [Wed, 12 Feb 2020 21:06:08 +0000 (22:06 +0100)] 
Simplify Util::{base,dir}_name

This also fixes a bug in the Windows versions.

5 years agoAdded 'make check_format' to makefile rules (#525)
Thomas Otto [Thu, 13 Feb 2020 20:54:19 +0000 (21:54 +0100)] 
Added 'make check_format' to makefile rules (#525)

'make format' formats all source files with clang-format, and
'make check_format' only checks and on failure prints a diff,
then exits with the appropriate status.

Because quick interactive formatting is one use case, xargs is
used for parallelism. Proper make-parallelism would require
-k and -j arguments to work.

5 years agoMerge pull request #538 from totph/ctx2
Joel Rosdahl [Thu, 13 Feb 2020 20:26:14 +0000 (21:26 +0100)] 
Merge pull request #538 from totph/ctx2

Context: move 7 more globals

5 years agoContext: move generating_dependencies 538/head
Thomas Otto [Fri, 24 Jan 2020 18:40:14 +0000 (19:40 +0100)] 
Context: move generating_dependencies

5 years agoContext: move actual_language
Thomas Otto [Fri, 24 Jan 2020 18:33:43 +0000 (19:33 +0100)] 
Context: move actual_language

5 years agoContext: move output_dwo
Thomas Otto [Fri, 24 Jan 2020 18:26:32 +0000 (19:26 +0100)] 
Context: move output_dwo

5 years agoContext: move output_dia
Thomas Otto [Fri, 24 Jan 2020 18:23:17 +0000 (19:23 +0100)] 
Context: move output_dia

5 years agoContext: move output_cu
Thomas Otto [Fri, 24 Jan 2020 18:19:25 +0000 (19:19 +0100)] 
Context: move output_cu

5 years agoContext: move output_cov
Thomas Otto [Fri, 24 Jan 2020 18:17:54 +0000 (19:17 +0100)] 
Context: move output_cov

5 years agoContext: move output_dep
Thomas Otto [Fri, 24 Jan 2020 18:14:00 +0000 (19:14 +0100)] 
Context: move output_dep

5 years agoTest out-of-tree build in Travis-CI
Joel Rosdahl [Thu, 13 Feb 2020 17:58:18 +0000 (18:58 +0100)] 
Test out-of-tree build in Travis-CI

5 years agoFix out of tree build (#540)
Loïc Yhuel [Thu, 13 Feb 2020 17:53:32 +0000 (18:53 +0100)] 
Fix out of tree build (#540)

The CPPFLAGS contain "-I.", but not "-I$(srcdir)", which means "src/ScopeGuard.hpp" was only
found when building from the source root.

5 years agoSimplify code
Joel Rosdahl [Mon, 10 Feb 2020 20:25:38 +0000 (21:25 +0100)] 
Simplify code

5 years agoMake clang-format comments stable across clang-format versions
Joel Rosdahl [Mon, 10 Feb 2020 20:16:31 +0000 (21:16 +0100)] 
Make clang-format comments stable across clang-format versions

Now at least clang-format 6, 7, 8 and 9 format all code the same.

5 years agoFix formatting
Joel Rosdahl [Mon, 10 Feb 2020 20:14:53 +0000 (21:14 +0100)] 
Fix formatting

5 years agoContext: move output_obj, adapt dump_debug_log_buffer_exitfn
Thomas Otto [Fri, 24 Jan 2020 17:54:04 +0000 (18:54 +0100)] 
Context: move output_obj, adapt dump_debug_log_buffer_exitfn

5 years agoContext: add ArgsInfo and move input_file
Thomas Otto [Fri, 24 Jan 2020 17:40:21 +0000 (18:40 +0100)] 
Context: add ArgsInfo and move input_file

5 years agoContext struct added, returned by initialize()
Thomas Otto [Sun, 19 Jan 2020 17:53:41 +0000 (18:53 +0100)] 
Context struct added, returned by initialize()

The goal is to eventually move almost all global state into Context.

5 years agoUse Config for init_log()
Thomas Otto [Wed, 5 Feb 2020 21:03:24 +0000 (22:03 +0100)] 
Use Config for init_log()

5 years agoRemove superfluous “>” in README
Joel Rosdahl [Sun, 9 Feb 2020 20:48:06 +0000 (21:48 +0100)] 
Remove superfluous “>” in README

5 years agoMention “Supported platforms, compilers and languages” page in README
Joel Rosdahl [Sun, 9 Feb 2020 20:47:07 +0000 (21:47 +0100)] 
Mention “Supported platforms, compilers and languages” page in README

5 years agoImprove the failed() and fatal() mechanisms
Joel Rosdahl [Sat, 8 Feb 2020 22:19:18 +0000 (23:19 +0100)] 
Improve the failed() and fatal() mechanisms

The failure() and fatal() functions now exit by throwing exceptions that
are caught by the top level functions. This makes it possible to “throw
Failure” in functions that don’t have access to orig_args (or the future
context object).

While at it, renamed top-level functions to better reflect their
purpose.

5 years agoRemove declaration of unimplemented warn function
Joel Rosdahl [Sat, 8 Feb 2020 18:51:47 +0000 (19:51 +0100)] 
Remove declaration of unimplemented warn function

5 years agoRestore sortedness of Util functions
Joel Rosdahl [Sat, 8 Feb 2020 17:35:37 +0000 (18:35 +0100)] 
Restore sortedness of Util functions

5 years agoUse correct spelling of the verb “set up”
Joel Rosdahl [Sat, 8 Feb 2020 16:14:55 +0000 (17:14 +0100)] 
Use correct spelling of the verb “set up”

5 years agoExtract setup_config() from initialize() (#534)
Thomas Otto [Sat, 8 Feb 2020 16:12:51 +0000 (17:12 +0100)] 
Extract setup_config() from initialize() (#534)

Repeated initialize-calls in ccache_main_options() added duplicate exit
functions. These calls had the side effect of passing a config relevant
changes from one command line switch to the next. Instead setup_config()
is now called afterwards.

5 years agoMove logging into separate file (#532)
Thomas Otto [Sat, 8 Feb 2020 16:04:28 +0000 (17:04 +0100)] 
Move logging into separate file (#532)

5 years agoUse apparent CWD when checking for CWD in preprocessed output
Joel Rosdahl [Fri, 7 Feb 2020 22:15:42 +0000 (23:15 +0100)] 
Use apparent CWD when checking for CWD in preprocessed output

Also when checking debug prefix maps.

This fixes a problem when $PWD includes a symlink part and the user has
set “hash_dir = false”.

Closes #531.

(cherry picked from commit 92145eb0762109b5f0114a6f4de2fea7d4ac016f)

5 years agoRemove “Description” header from PR and feature issue templates
Joel Rosdahl [Fri, 7 Feb 2020 20:58:48 +0000 (21:58 +0100)] 
Remove “Description” header from PR and feature issue templates

The header seems to be more in the way than being helpful.

5 years agoWin32: Close reading file for recompression (#535)
Cristian Adam [Fri, 7 Feb 2020 20:38:24 +0000 (21:38 +0100)] 
Win32: Close reading file for recompression (#535)

Fixes: https://github.com/ccache/ccache/issues/530
5 years agoRemove one more “=” from the help text
Joel Rosdahl [Wed, 5 Feb 2020 20:57:57 +0000 (21:57 +0100)] 
Remove one more “=” from the help text

Missed in a44ef1844b59bf902ad6015645fb0028a54f67cb.

5 years agoImprove help text and documentation of command line options
Joel Rosdahl [Wed, 5 Feb 2020 20:46:29 +0000 (21:46 +0100)] 
Improve help text and documentation of command line options

Removed the “=” in “-a, --a-long-option=VALUE” to make it easier to
understand that “-a=VALUE” isn’t supported. Also improved some of the
placeholder names.

Closes #529.

5 years agoImprove error message for “ccache -o=K=V”
Joel Rosdahl [Wed, 5 Feb 2020 20:31:55 +0000 (21:31 +0100)] 
Improve error message for “ccache -o=K=V”

Previously:

    ccache: error: unknown configuration option ""

Now:

    ccache: error: unknown configuration option "=K"

Related to #529.

5 years agoLog when starting/stopping recompression
Joel Rosdahl [Wed, 5 Feb 2020 20:17:50 +0000 (21:17 +0100)] 
Log when starting/stopping recompression

5 years agodoc: Remove information that is better to have on the web site
Joel Rosdahl [Wed, 5 Feb 2020 19:22:25 +0000 (20:22 +0100)] 
doc: Remove information that is better to have on the web site

5 years agodoc: Move description of preprocessor mode before direct mode
Joel Rosdahl [Wed, 5 Feb 2020 19:01:22 +0000 (20:01 +0100)] 
doc: Move description of preprocessor mode before direct mode

This way the depend mode is documented directly after the direct mode
which makes more sense since they are related.

5 years agoAdd improvement issue template
Joel Rosdahl [Tue, 4 Feb 2020 19:26:29 +0000 (20:26 +0100)] 
Add improvement issue template

5 years agoImprove issue templates
Joel Rosdahl [Tue, 4 Feb 2020 19:26:25 +0000 (20:26 +0100)] 
Improve issue templates

5 years agoCompensate for bug in clang-format version 8 and 9
Joel Rosdahl [Tue, 28 Jan 2020 21:07:54 +0000 (22:07 +0100)] 
Compensate for bug in clang-format version 8 and 9

5 years agoAdd short description of ArgsInfo
Joel Rosdahl [Tue, 28 Jan 2020 19:35:33 +0000 (20:35 +0100)] 
Add short description of ArgsInfo

As suggested by Alexander Lanin.

5 years agoSimplify code a bit
Joel Rosdahl [Tue, 28 Jan 2020 18:47:36 +0000 (19:47 +0100)] 
Simplify code a bit

5 years agoFix memory leak
Joel Rosdahl [Mon, 27 Jan 2020 21:05:48 +0000 (22:05 +0100)] 
Fix memory leak

5 years agoRefactor away the last instance of from_owned_cstr
Joel Rosdahl [Mon, 27 Jan 2020 20:57:17 +0000 (21:57 +0100)] 
Refactor away the last instance of from_owned_cstr

5 years agoMerge pull request #515 from totph/cc_proc
Joel Rosdahl [Tue, 28 Jan 2020 19:47:19 +0000 (20:47 +0100)] 
Merge pull request #515 from totph/cc_proc

Make cc_process_args() only use local variables

5 years agoSimplify make_relative_path() argument and result ownership 515/head
Thomas Otto [Sun, 19 Jan 2020 17:21:54 +0000 (18:21 +0100)] 
Simplify make_relative_path() argument and result ownership

5 years agoMake cc_process_args() only use local variables
Thomas Otto [Sun, 19 Jan 2020 16:49:19 +0000 (17:49 +0100)] 
Make cc_process_args() only use local variables

cc_process_args writes into a new ArgsInfo struct and only accesses
local variables (minus guessed_compiler). For now these are mostly
copied into the global variables again after the function call.

Most ccache.cpp global variables moved to legacy_globals.cpp.

5 years agoAdd a ScopeGuard struct
Thomas Otto [Wed, 22 Jan 2020 18:02:04 +0000 (19:02 +0100)] 
Add a ScopeGuard struct

Enables automatic cleanup of raw pointers and other resources.
For now used simplify resource management in cc_process_args.

5 years agoAdd from_owned_cstr/from_cstr functions
Thomas Otto [Sun, 19 Jan 2020 16:49:19 +0000 (17:49 +0100)] 
Add from_owned_cstr/from_cstr functions

5 years agoFormat code with clang-format
Joel Rosdahl [Sat, 25 Jan 2020 12:52:29 +0000 (13:52 +0100)] 
Format code with clang-format

5 years agoMake Config noncopyable and add clear_and_reset() method (#522)
Thomas Otto [Sat, 25 Jan 2020 12:45:42 +0000 (13:45 +0100)] 
Make Config noncopyable and add clear_and_reset() method (#522)

Prevents changes from getting lost by writing them to a
temporary copy of the main Config object.

Also restore deleted comments from the move of
primary/secondary_config_path.

5 years agoDerive header list from source list if possible (#521)
Thomas Otto [Sat, 25 Jan 2020 12:40:46 +0000 (13:40 +0100)] 
Derive header list from source list if possible (#521)

5 years agoSkip read-only tests on file systems that lack such support
Joel Rosdahl [Sat, 25 Jan 2020 10:25:52 +0000 (11:25 +0100)] 
Skip read-only tests on file systems that lack such support

Fixes #510.

5 years agoMake failure to write a stats file a soft error (#516)
Joel Rosdahl [Sat, 25 Jan 2020 10:19:52 +0000 (11:19 +0100)] 
Make failure to write a stats file a soft error (#516)

If a stats file update for some reason fails, the exception will bubble
up to ccache_main which just prints the error and exits with an error.
Let’s consider such failures non-fatal and just log them.

5 years agoSplit ccache.hpp into per-.cpp file headers
Joel Rosdahl [Wed, 22 Jan 2020 21:03:09 +0000 (22:03 +0100)] 
Split ccache.hpp into per-.cpp file headers

This reduces code dependencies that hamper refactoring.

5 years agoRemove obsolete COMPAR_FN_T check and typedef
Joel Rosdahl [Wed, 22 Jan 2020 20:16:39 +0000 (21:16 +0100)] 
Remove obsolete COMPAR_FN_T check and typedef

5 years agoMove global primary/secondary_config_path into Config (#514)
Thomas Otto [Tue, 21 Jan 2020 18:31:18 +0000 (19:31 +0100)] 
Move global primary/secondary_config_path into Config (#514)

5 years agoIgnore files from VS (Code) (#508)
Alexander Lanin [Mon, 20 Jan 2020 21:54:48 +0000 (22:54 +0100)] 
Ignore files from VS (Code) (#508)

5 years agoMake failed tests create a testdir.failed symlink (#511)
Thomas Otto [Sun, 19 Jan 2020 19:47:27 +0000 (20:47 +0100)] 
Make failed tests create a testdir.failed symlink (#511)

When the test suite fails 'testdir.failed' now points to the random
'testdir.9876/' directory. This make iterative debugging of failing
tests easier by always using the symlink name or re-issuing 'cd $PWD'
when 'cd'-ed into the 'testdir.failed' directory.

All artifacts can still be removed via 'rm -r testdir.*'.