]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
5 years agoAdapt find_executable() to use split_into_strings()
Thomas Otto [Tue, 3 Mar 2020 22:21:18 +0000 (23:21 +0100)] 
Adapt find_executable() to use split_into_strings()

5 years agoMake win32getshell() return std::string
Joel Rosdahl [Thu, 16 Apr 2020 19:25:19 +0000 (21:25 +0200)] 
Make win32getshell() return std::string

5 years agoAdapt args_init_from_string() to use split_into_strings()
Thomas Otto [Tue, 3 Mar 2020 22:19:44 +0000 (23:19 +0100)] 
Adapt args_init_from_string() to use split_into_strings()

5 years agoAdapt add_prefix() to use split_into_strings()
Thomas Otto [Tue, 3 Mar 2020 22:16:44 +0000 (23:16 +0100)] 
Adapt add_prefix() to use split_into_strings()

5 years agoUtil: Add split_into_views/split_into_strings functions
Thomas Otto [Tue, 3 Mar 2020 22:14:05 +0000 (23:14 +0100)] 
Util: Add split_into_views/split_into_strings functions

5 years agoUtil: Don’t include path in error description from read_file/write_file
Thomas Otto [Thu, 19 Mar 2020 21:41:55 +0000 (22:41 +0100)] 
Util: Don’t include path in error description from read_file/write_file

By only returning the error description the caller is more flexible when
composing their own error message.

5 years agoUpgrade to fmt 6.2.0
Joel Rosdahl [Tue, 14 Apr 2020 19:05:39 +0000 (21:05 +0200)] 
Upgrade to fmt 6.2.0

5 years agoImprove order of Travis CI jobs
Joel Rosdahl [Thu, 9 Apr 2020 17:23:11 +0000 (19:23 +0200)] 
Improve order of Travis CI jobs

5 years agoImprove Travis CI job descriptions
Joel Rosdahl [Thu, 9 Apr 2020 17:20:53 +0000 (19:20 +0200)] 
Improve Travis CI job descriptions

5 years agoFix typos in 64-bit MinGW Travis CI job
Joel Rosdahl [Thu, 9 Apr 2020 13:46:52 +0000 (15:46 +0200)] 
Fix typos in 64-bit MinGW Travis CI job

5 years agoAdd test case for Args::from_gcc_atfile
Joel Rosdahl [Tue, 7 Apr 2020 20:16:53 +0000 (22:16 +0200)] 
Add test case for Args::from_gcc_atfile

5 years agoAdd an Args class with backward compatibility for the old args API (#575)
Joel Rosdahl [Tue, 7 Apr 2020 19:54:30 +0000 (21:54 +0200)] 
Add an Args class with backward compatibility for the old args API (#575)

The idea of this is to make a proper C++ API while at the same time
implementing most of the old legacy args API. This makes it possible to
refactor call sites gradually instead of in a series of large
refactoring steps.

Given that “struct args* args” is replaced with “Args args”, the
following types of legacy API usage can be kept without source changes:

1. The args_* functions can be used as is.
2. args->argv[i] still works for read access.

Things that aren’t emulated:

1. args->argc (use args.size() instead).
2. args->argv to access the underlying char* array (use
   args.to_argv().data() instead).
3. Mutating the args->argv[i] string in place (don’t do that).

In other words, code that uses args_foo(args, ...) and args->argv[i] can
easily be converted to args.bar(...) and args[i] (with std::string
arguments instead of char*) at will and in arbitrarily small steps.

5 years agoMake ccache build on Solaris 11.4 (#572)
Philipp Storz [Mon, 6 Apr 2020 19:50:27 +0000 (21:50 +0200)] 
Make ccache build on Solaris 11.4 (#572)

These changes enable building on Oracle Solaris 11.4 for both i386 and sparc.

5 years agoEnable check_format and clang-tidy checks in CI (#562)
Alexander Lanin [Mon, 6 Apr 2020 19:46:40 +0000 (21:46 +0200)] 
Enable check_format and clang-tidy checks in CI (#562)

5 years agoImprove const-ness of parameters related to argv
Joel Rosdahl [Sun, 5 Apr 2020 17:23:45 +0000 (19:23 +0200)] 
Improve const-ness of parameters related to argv

5 years agoAdd .git-blame-ignore-revs
Joel Rosdahl [Sun, 29 Mar 2020 14:31:02 +0000 (16:31 +0200)] 
Add .git-blame-ignore-revs

5 years agoPrepare for v3.7.9
Joel Rosdahl [Sun, 29 Mar 2020 14:11:08 +0000 (16:11 +0200)] 
Prepare for v3.7.9

(cherry picked from commit f7f2333b46bcb2a0cbb323c144d59cc5abb267f6)

5 years agoRemove obsolete src/lockfile.cpp
Joel Rosdahl [Wed, 25 Mar 2020 20:50:26 +0000 (21:50 +0100)] 
Remove obsolete src/lockfile.cpp

It should have been removed in c181fdd9.

Fixes #569.

5 years agoLet run-clang-format always exit with success in non-check mode
Joel Rosdahl [Wed, 25 Mar 2020 20:09:00 +0000 (21:09 +0100)] 
Let run-clang-format always exit with success in non-check mode

I don’t consider explicit reformatting to be an error.

5 years agoMake check_format exit with the appropriate status (#565)
Thomas Otto [Tue, 24 Mar 2020 19:35:53 +0000 (20:35 +0100)] 
Make check_format exit with the appropriate status (#565)

Also print only diff to stdout and fix tabs.

5 years agoImprove name of tmp file in x_unlink
Joel Rosdahl [Sun, 22 Mar 2020 13:41:44 +0000 (14:41 +0100)] 
Improve name of tmp file in x_unlink

There is no need to generate a unique temporary name in x_unlink since
we don’t care whether the temporary file is clobbered on NFS. The
previous usage of tmp_string() was not quite correct since the returned
string is supposed to be passed to mkstemp, not used as is.

(cherry picked from commit e7776305184c9338ee97334078153f298f6cfea7)

5 years agoDisable hard link mode when the output object file is /dev/null
Joel Rosdahl [Sun, 22 Mar 2020 13:30:23 +0000 (14:30 +0100)] 
Disable hard link mode when the output object file is /dev/null

When hard link mode is enabled, ccache ≥3.6 unlinks the output file
before writing to it as a workaround for a bug in Clang (#331). This
unfortunately means that /dev/null will be removed when building as root
(don’t do that, BTW) with hard link mode enabled and /dev/null as the
the output file. A similar problem exists if the dependency file is
/dev/null, regardless of hard link mode.

Fix this by not unlinking the output file if it’s /dev/null and by not
copying files to /dev/null at all. (There is no need to handle other
non-regular output files since /dev/null is the only allowed non-regular
output file.)

Fixes #564.

(cherry picked from commit 9a794689a8ba47e79c96d6c370976448b756973c)

5 years agoRemove superfluous unlink before rename
Joel Rosdahl [Sun, 22 Mar 2020 19:17:06 +0000 (20:17 +0100)] 
Remove superfluous unlink before rename

5 years agoconfigure: Error out if failing to download libzstd or libb2
Joel Rosdahl [Wed, 18 Mar 2020 19:29:51 +0000 (20:29 +0100)] 
configure: Error out if failing to download libzstd or libb2

5 years agoAlign entries in dev.mk.in
Joel Rosdahl [Wed, 18 Mar 2020 19:26:40 +0000 (20:26 +0100)] 
Align entries in dev.mk.in

5 years agoPrepare for v3.7.8
Joel Rosdahl [Mon, 16 Mar 2020 20:58:29 +0000 (21:58 +0100)] 
Prepare for v3.7.8

(cherry picked from commit ec65f9f88cf75cbd9f04d88c4a3345fb60911975)

5 years agowin32: Log epoch timestamp if localtime_r fails
Joel Rosdahl [Sat, 14 Mar 2020 14:55:12 +0000 (15:55 +0100)] 
win32: Log epoch timestamp if localtime_r fails

(cherry picked from commit 21fc81c11966d674c3b3cfe30ccf3cdff7f6dfee)

5 years agodoc: Clarify include_file_ctime sloppiness in the Performance section
Joel Rosdahl [Sat, 14 Mar 2020 09:18:53 +0000 (10:18 +0100)] 
doc: Clarify include_file_ctime sloppiness in the Performance section

(cherry picked from commit fc8182ae95af0f46fc8f71ab29e91534636325b7)

5 years agoCacheEntryReader: Fix return type (#554)
Thomas Otto [Tue, 10 Mar 2020 20:52:45 +0000 (21:52 +0100)] 
CacheEntryReader: Fix return type (#554)

5 years agoUse tmp_unlink to remove temporary file in use_relative_paths_in_depfile
Joel Rosdahl [Tue, 10 Mar 2020 18:51:39 +0000 (19:51 +0100)] 
Use tmp_unlink to remove temporary file in use_relative_paths_in_depfile

No need to remove via another temporary file.

(cherry picked from commit c74b625aaa46db85797a691c81f129834c7fd82e)

5 years agoC++-ify lockfile routines
Joel Rosdahl [Fri, 6 Mar 2020 18:39:32 +0000 (19:39 +0100)] 
C++-ify lockfile routines

5 years agoSimplify lock breaking
Joel Rosdahl [Fri, 6 Mar 2020 18:31:15 +0000 (19:31 +0100)] 
Simplify lock breaking

Acquiring a .lock.lock file does not make lock breaking significantly
safer; there is still a race condition. Simplify it by simply deleting
the lockfile when breaking and try to acquire it again.

5 years agoRewrite the Windows version of the lockfile routines
Joel Rosdahl [Wed, 26 Feb 2020 21:50:12 +0000 (22:50 +0100)] 
Rewrite the Windows version of the lockfile routines

Instead of emulating the POSIX version, use the native Windows file API
to create a lockfile. This should mitigate several problems with the old
implementation.

Hopefully fixes #537.

(cherry picked from commit 53b9fdd6272896bb4a2dc42c9680d4030f86b33c)

5 years agoCap time to sleep to 10 ms when failing to acquire a lock
Joel Rosdahl [Wed, 26 Feb 2020 21:48:31 +0000 (22:48 +0100)] 
Cap time to sleep to 10 ms when failing to acquire a lock

(cherry picked from commit 41ffc7ec009237da51040c6059b1bcd7903af30d)

5 years agoRewrite absolute input path to relative
Joel Rosdahl [Sun, 1 Mar 2020 21:09:37 +0000 (22:09 +0100)] 
Rewrite absolute input path to relative

This can now be done due to no longer using realpath in
make_relative_path (e8444a38).

5 years agoLet development version be BRANCH.SHORTHASH
Joel Rosdahl [Sun, 1 Mar 2020 20:16:09 +0000 (21:16 +0100)] 
Let development version be BRANCH.SHORTHASH

Previously the version of a master-based development build was something
like 3.7.1+NNN_gSHORTHASH which is a bit misleading.

5 years agoConvert counters to a class (#548)
Thomas Otto [Sun, 1 Mar 2020 21:07:54 +0000 (22:07 +0100)] 
Convert counters to a class (#548)

Also remove file writing logic from `stats_update_size()` and
delete unused declaration of `stats_timestamp()`.

5 years agoConvert the single ofstream use to fwrite (#552)
Thomas Otto [Sun, 1 Mar 2020 20:32:34 +0000 (21:32 +0100)] 
Convert the single ofstream use to fwrite (#552)

5 years agoRead/write optimizations (#551)
Erik Johansson [Sun, 1 Mar 2020 20:30:06 +0000 (21:30 +0100)] 
Read/write optimizations (#551)

* Avoid one extra read call after the final bytes are read

If read returns less then the requested number of bytes, the file is at
EOF. This can be used in all places where a read is done, but it makes extra
impact in read_file where if the buffer is made one byte bigger than needed,
EOF can be detected before a unnecessary memory reallocation is done.

* Use write instead of fwrite to write the result file

This avoids the caching in stdio where a write is split into two (at least on
my system): first a small 4k one and then one with the remaining 60k.

5 years agoAvoid duplicate stat calls (#550)
Erik Johansson [Sun, 1 Mar 2020 20:17:49 +0000 (21:17 +0100)] 
Avoid duplicate stat calls (#550)

hash_source_code_string will, in read_file, stat the file to get the file
size. But when called from verify_result, the file size is already known so by
using this size the number of stat calls in a normal run can be cut in half.

5 years agoFix empty <obj>.ccache-log in debug mode without log_file set
Joel Rosdahl [Tue, 25 Feb 2020 21:02:50 +0000 (22:02 +0100)] 
Fix empty <obj>.ccache-log in debug mode without log_file set

Regression in dcf6ab3f349a33974b31ce2e7c06a2085149ab4a.

5 years agoAdd notes about intentional use of CCACHE_DEBUG in test cases
Joel Rosdahl [Tue, 25 Feb 2020 21:02:17 +0000 (22:02 +0100)] 
Add notes about intentional use of CCACHE_DEBUG in test cases

5 years agoRestore test suite debug output where needed (#546)
Thomas Otto [Tue, 25 Feb 2020 20:59:17 +0000 (21:59 +0100)] 
Restore test suite debug output where needed (#546)

Two fileclone tests rely on the output.

5 years agoLow hanging fruits of some auto fixable improvements via clang-tidy (#545)
Alexander Lanin [Tue, 25 Feb 2020 20:14:01 +0000 (21:14 +0100)] 
Low hanging fruits of some auto fixable improvements via clang-tidy (#545)

5 years agoMerge pull request #544 from erijo/out-of-tree-commands
Joel Rosdahl [Mon, 24 Feb 2020 20:30:41 +0000 (21:30 +0100)] 
Merge pull request #544 from erijo/out-of-tree-commands

5 years agoFix four minor cppcheck warnings 544/head
Erik Johansson [Sun, 23 Feb 2020 20:56:59 +0000 (21:56 +0100)] 
Fix four minor cppcheck warnings

- uninitvar:src/ccache.cpp:3422: Uninitialized variable: ctx
- redundantInitialization:src/legacy_util.cpp:1067: Redundant initialization
  for 'q'. The initialized value is overwritten before it is read.
- constVariable:src/stats.cpp:429: Variable 'ctx' can be declared with const
- variableScope:src/Util.cpp:404: The scope of the variable 'right' can be
  reduced.

5 years agoPass std::string instead of .c_str()
Erik Johansson [Sun, 23 Feb 2020 20:54:42 +0000 (21:54 +0100)] 
Pass std::string instead of .c_str()

to function taking std::string.

5 years agoRemove unused function stats_get_pending
Erik Johansson [Sun, 23 Feb 2020 20:53:03 +0000 (21:53 +0100)] 
Remove unused function stats_get_pending

5 years agoMake cppcheck, format and check_format work in out-of-tree build
Erik Johansson [Sun, 23 Feb 2020 20:52:02 +0000 (21:52 +0100)] 
Make cppcheck, format and check_format work in out-of-tree build

5 years agoRemove leftover debug settings in test suites
Joel Rosdahl [Sun, 23 Feb 2020 20:37:41 +0000 (21:37 +0100)] 
Remove leftover debug settings in test suites

5 years agoDon’t use realpath(3) for normalization when computing relative paths
Joel Rosdahl [Thu, 20 Feb 2020 20:24:15 +0000 (21:24 +0100)] 
Don’t use realpath(3) for normalization when computing relative paths

The current working directory (CWD) can come from two sources: Either
the return value of getcwd(3) (“actual CWD” below) or the environment
variable $PWD (“apparent CWD” below). The former is returned by e.g.
$(CURDIR) in Makefiles and by “pwd -P” and is always in normalized form
(no “.” or “..” parts or extra slashes). The latter is returned by “echo
$PWD” or “pwd” and can potentially be in unnormalized form on some
systems.

The actual CWD and apparent CWD may also differ if there are symlinks in
the path. Absolute paths to files given to ccache can therefore be based
on either of these CWD forms. When computing relative paths under the
base directory the CWD needs be in normalized form for the algorithm to
be reasonably simple.

2df269a3 solved a bug with an unnormalized apparent CWD by using
realpath(3) for normalization. Using realpath also makes the algorithm
correct in the presence of symlinks. It however also means that all
symlinks (both in CWD and in command line arguments) are dereferenced.
The downside of this is that if either of the symlink targets contain
specific names (such as build ID, date, username or similar) then the
relative paths will also contain those specific path names, leading to
cache misses.

Solve this by:

- Performing normalization without using realpath, i.e. without
  expanding symlinks.
- Computing a relative path based on normalized CWD and normalized path.
- Checking whether the relative path resolves to the same i-node as the
  original path. If it does, use it, otherwise just use the original
  path (and take a potential cache miss).
- Doing the above calculation both for the actual and the apparent CWD
  and choose the best one.

This solves the problem that PR #491 intended to address in a better
way.

5 years agoImprove basedir calculation on Windows
Joel Rosdahl [Sun, 23 Feb 2020 19:45:07 +0000 (20:45 +0100)] 
Improve basedir calculation on Windows

Now basedir with backslashes or forward slashes should work.

5 years agoLet Util::get_apparent_cwd return a normalized CWD
Joel Rosdahl [Thu, 20 Feb 2020 20:23:13 +0000 (21:23 +0100)] 
Let Util::get_apparent_cwd return a normalized CWD

5 years agoAdd Stat::same_inode_as method
Joel Rosdahl [Thu, 20 Feb 2020 20:20:07 +0000 (21:20 +0100)] 
Add Stat::same_inode_as method

5 years agoAdd default Stat constructor
Joel Rosdahl [Thu, 20 Feb 2020 20:05:56 +0000 (21:05 +0100)] 
Add default Stat constructor

5 years agoC++-ify make_relative_path
Joel Rosdahl [Wed, 19 Feb 2020 20:25:49 +0000 (21:25 +0100)] 
C++-ify make_relative_path

5 years agoC++-ify get_relative_path
Joel Rosdahl [Wed, 19 Feb 2020 19:33:46 +0000 (20:33 +0100)] 
C++-ify get_relative_path

5 years agoC++-ify common_dir_prefix_length
Joel Rosdahl [Wed, 19 Feb 2020 18:18:01 +0000 (19:18 +0100)] 
C++-ify common_dir_prefix_length

5 years agoImplement Util::normalize_absolute_path
Joel Rosdahl [Wed, 19 Feb 2020 10:00:24 +0000 (11:00 +0100)] 
Implement Util::normalize_absolute_path

Normalization here means syntactically removing redundant slashes and
resolving "." and ".." parts. The algorithm does however *not* follow
symlinks, so the result may not actually resolve to `path`.

5 years agoMake Util::is_absolute_path work with MSYS/Cygwin/POSIX win32 paths
Joel Rosdahl [Sun, 23 Feb 2020 18:00:59 +0000 (19:00 +0100)] 
Make Util::is_absolute_path work with MSYS/Cygwin/POSIX win32 paths

5 years agoC++-ify is_absolute_path
Joel Rosdahl [Sun, 23 Feb 2020 08:43:41 +0000 (09:43 +0100)] 
C++-ify is_absolute_path

5 years agoSort test cases
Joel Rosdahl [Mon, 17 Feb 2020 20:55:09 +0000 (21:55 +0100)] 
Sort test cases

5 years agoMove basedir tests to the basedir test suite
Joel Rosdahl [Mon, 17 Feb 2020 19:46:05 +0000 (20:46 +0100)] 
Move basedir tests to the basedir test suite

5 years agoAdd pch test suite probe for seemingly broken compiler support
Joel Rosdahl [Sat, 22 Feb 2020 21:18:48 +0000 (22:18 +0100)] 
Add pch test suite probe for seemingly broken compiler support

This fixes a problem mentioned by Orion Poplawski in a comment to PR #217.

5 years agoConst-ify Context& parameters where possible
Joel Rosdahl [Sat, 22 Feb 2020 12:34:18 +0000 (13:34 +0100)] 
Const-ify Context& parameters where possible

5 years agoSimplify setting of ctx.args_info.profile_dir default value
Joel Rosdahl [Sat, 22 Feb 2020 12:33:37 +0000 (13:33 +0100)] 
Simplify setting of ctx.args_info.profile_dir default value

5 years agoConvert stats_update(x) + failed() to failed(x) in hash_*command*()
Joel Rosdahl [Sat, 22 Feb 2020 12:14:21 +0000 (13:14 +0100)] 
Convert stats_update(x) + failed() to failed(x) in hash_*command*()

5 years agoUse find_executable_in_path to find executable in hash_command_output
Joel Rosdahl [Sat, 22 Feb 2020 12:46:30 +0000 (13:46 +0100)] 
Use find_executable_in_path to find executable in hash_command_output

This makes the Windows version behave similar to the non-Windows
version: just search in $PATH, not potentially in the path specified by
the “path” configuration setting.

5 years agoMake failure to run compiler_check command a soft error
Joel Rosdahl [Sat, 22 Feb 2020 12:12:16 +0000 (13:12 +0100)] 
Make failure to run compiler_check command a soft error

No need to make a failure when running the compiler check fatal since
other misconfigured settings can have a similar effect without resulting
in fatal errors.

5 years agoRename cc_process_args to process_args
Joel Rosdahl [Sat, 22 Feb 2020 11:55:22 +0000 (12:55 +0100)] 
Rename cc_process_args to process_args

5 years agoConvert stats_update(x) + failed() to failed(x) in cc_process_args
Joel Rosdahl [Sat, 22 Feb 2020 11:53:15 +0000 (12:53 +0100)] 
Convert stats_update(x) + failed() to failed(x) in cc_process_args

5 years agoConvert most stats_update(x) + failed() to failed(x)
Joel Rosdahl [Sat, 22 Feb 2020 10:03:32 +0000 (11:03 +0100)] 
Convert most stats_update(x) + failed() to failed(x)

5 years agoDon’t increment STATS_COMPILER on fatal error
Joel Rosdahl [Sat, 22 Feb 2020 16:37:22 +0000 (17:37 +0100)] 
Don’t increment STATS_COMPILER on fatal error

Statistics counters are otherwise never incremented on fatal errors.

5 years agoMake it possible to run failed() and not execute the real compiler
Joel Rosdahl [Sat, 22 Feb 2020 16:12:48 +0000 (17:12 +0100)] 
Make it possible to run failed() and not execute the real compiler

This removes one of the last x_exit calls deeper into the main ccache
code paths.

5 years agoRemove leftover cc_reset declaration
Joel Rosdahl [Sat, 22 Feb 2020 11:56:11 +0000 (12:56 +0100)] 
Remove leftover cc_reset declaration

5 years agoMerge pull request #543 from totph/ctx5
Joel Rosdahl [Sat, 22 Feb 2020 20:47:33 +0000 (21:47 +0100)] 
Merge pull request #543 from totph/ctx5

Final Globals -> Context moves

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