]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
17 months agochore: Add missing #includes
Joel Rosdahl [Mon, 19 Feb 2024 19:10:02 +0000 (20:10 +0100)] 
chore: Add missing #includes

17 months agorefactor: Use util::Bytes::insert for span<const uint8_t>
Joel Rosdahl [Sun, 18 Feb 2024 08:43:34 +0000 (09:43 +0100)] 
refactor: Use util::Bytes::insert for span<const uint8_t>

17 months agoenhance: Add util::Bytes::insert for span<const uint8_t>
Joel Rosdahl [Sun, 18 Feb 2024 08:40:15 +0000 (09:40 +0100)] 
enhance: Add util::Bytes::insert for span<const uint8_t>

17 months agorefactor: Avoid raw fmt::format call in TextTable
Joel Rosdahl [Sun, 18 Feb 2024 08:33:36 +0000 (09:33 +0100)] 
refactor: Avoid raw fmt::format call in TextTable

17 months agochore: Clean up usage of #include in headers
Joel Rosdahl [Sat, 17 Feb 2024 08:46:41 +0000 (09:46 +0100)] 
chore: Clean up usage of #include in headers

17 months agochore: Tweak formatting and comments
Joel Rosdahl [Mon, 12 Feb 2024 20:35:15 +0000 (21:35 +0100)] 
chore: Tweak formatting and comments

17 months agoci: Add new compilers and update actions (#1402)
Raihaan Shouhell [Sun, 11 Feb 2024 17:21:18 +0000 (01:21 +0800)] 
ci: Add new compilers and update actions (#1402)

17 months agofeat: Add support for -fcallgraph-info (#1401)
Raihaan Shouhell [Sun, 11 Feb 2024 17:20:38 +0000 (01:20 +0800)] 
feat: Add support for -fcallgraph-info (#1401)

17 months agofix: Mark -fcallgraph-info as too hard
Joel Rosdahl [Sun, 11 Feb 2024 15:26:03 +0000 (16:26 +0100)] 
fix: Mark -fcallgraph-info as too hard

-fcallgraph-info generates a .ci file which ccache currently doesn't
know how to store and restore.

Fixes #1400.

17 months agofeat: Port the inode cache to Windows (#1388)
Thomas Ferrand [Sun, 11 Feb 2024 15:11:47 +0000 (16:11 +0100)] 
feat: Port the inode cache to Windows (#1388)

This PR ports the existing InodeCache to make it work under Windows.
This speeds up ccache a lot, both in the hit and miss cases, when a lot
of headers files are included in several compilation units. In our case
this makes the difference between ccache being worth using or not.

The logic of the InodeCache itself is unchanged. I introduced a
MemoryMap helper class that does the platform specific calls to
mmap/MapViewOfFile. Despite its generic name, I've implemented what was
needed for the InodeCache, it only supports mapping a file (no anonymous
mmap) in a shared fashion with read/write access.
Due to differences in behavior between unix and Windows regarding
unlinking a file that is opened, I am not convinced that it will work
correctly in every situation (for example if a process hold a bucket
lock for more than 5 seconds, the cache is dropped and recreated, under
Windows that won't work as the unlink will fail). That being said it
seems to work well enough when nothing unexpected happens.

I made a small change to the unit test because under Windows, we can't
open() a directory so instead I try to open a temp file in that
directory. After that change the unit tests pass unmodified.
For the bash based test, only the symbolic link test fails. This is
quite strange, when I try to run the test, the call to `ln -fs test1.c
test2.c` fails, but when run manually the same command succeeds. I tried
to run the test manually and it fails anyway but I haven't done anything
to fix it, this looks like more an issue from the DirEntry side than the
InodeCache side. Because of that I've left the bash based test disabled
for Windows, maybe we want to change that to only disable the symbolic
link test?

17 months agochore: Use brace initialization for integer literals
Joel Rosdahl [Sun, 11 Feb 2024 11:07:27 +0000 (12:07 +0100)] 
chore: Use brace initialization for integer literals

17 months agochore: Bail out on too large files on 32-bit systems
Joel Rosdahl [Sat, 10 Feb 2024 20:33:08 +0000 (21:33 +0100)] 
chore: Bail out on too large files on 32-bit systems

17 months agochore: Improve log messages for selected compression level
Joel Rosdahl [Sat, 10 Feb 2024 09:35:56 +0000 (10:35 +0100)] 
chore: Improve log messages for selected compression level

17 months agoperf: Avoid value initialization of data in util::Bytes
Joel Rosdahl [Sat, 10 Feb 2024 09:14:44 +0000 (10:14 +0100)] 
perf: Avoid value initialization of data in util::Bytes

17 months agofix: Fix reading of files larger than 2^31 bytes
Joel Rosdahl [Sat, 10 Feb 2024 08:54:19 +0000 (09:54 +0100)] 
fix: Fix reading of files larger than 2^31 bytes

For some kernels read(2) makes a short read for counts larger than 2^31,
even for files on 64-bit architectures. Other kernels seem to not like
large counts at all, returning a failure.

Fix this by limiting the read buffer to a smaller value. This also
removes a short read optimization which should have been removed in
cff3bf417420ea88fe53e7267ae2a356898ae326.

17 months agochore: Further improve /Tc and /Tp handling
Joel Rosdahl [Wed, 7 Feb 2024 20:09:02 +0000 (21:09 +0100)] 
chore: Further improve /Tc and /Tp handling

- Remember if /Tc or /Tp was used and prepend it to the source file sent
  to the preprocessor and compiler.
- Mark non-concatenated versions of /Tc and /Tp as too hard for now.

17 months agochore: Fix grammar in NEWS
Joel Rosdahl [Wed, 7 Feb 2024 16:47:51 +0000 (17:47 +0100)] 
chore: Fix grammar in NEWS

17 months agochore: Update NEWS
Joel Rosdahl [Mon, 5 Feb 2024 19:27:16 +0000 (20:27 +0100)] 
chore: Update NEWS

(cherry picked from commit ec510e9b0f333b8e97aee98108de3e0858340d59)

17 months agochore: Update copyright years
Joel Rosdahl [Mon, 5 Feb 2024 19:17:16 +0000 (20:17 +0100)] 
chore: Update copyright years

17 months agofix: Fix MSVC crash when using /Zi /Fddebug.pdb
Joel Rosdahl [Mon, 5 Feb 2024 18:51:49 +0000 (19:51 +0100)] 
fix: Fix MSVC crash when using /Zi /Fddebug.pdb

With /Zi, MSVC starts a long-lived mspdbsrv.exe background process. The
implementation of #1274 kills all processes created by ccache including
mspdbsrv.exe, which can make cl.exe crash with this error message:

    fatal error C1090: PDB API call failed, error code '23': (0x000006BA)

Fix this by setting JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK to only kill
the compiler and not processes that the compiler creates.

Fixes #1386 in a better way.

17 months agochore: Undo revert in "Fix MSVC crash when using /Zi /Fddebug.pdb"
Joel Rosdahl [Mon, 5 Feb 2024 18:42:57 +0000 (19:42 +0100)] 
chore: Undo revert in "Fix MSVC crash when using /Zi /Fddebug.pdb"

In preparation for solving #1386 while keeping the essence of #1274.

This reverts commit a2bf2956d78599b2397081a9e7b253a569c7c932.

18 months agofix: Don't crash on full disk when recompressing the cache
Joel Rosdahl [Sun, 4 Feb 2024 14:33:51 +0000 (15:33 +0100)] 
fix: Don't crash on full disk when recompressing the cache

18 months agochore: Make implementation of /Tc and /Tp actually work
Joel Rosdahl [Sun, 4 Feb 2024 08:26:26 +0000 (09:26 +0100)] 
chore: Make implementation of /Tc and /Tp actually work

In addition to 7b8aaf562feb.

18 months agofix: Detect bad remote storage URLs gracefully again
Joel Rosdahl [Sat, 3 Feb 2024 19:49:57 +0000 (20:49 +0100)] 
fix: Detect bad remote storage URLs gracefully again

Regression in 829f93c48f21.

Fixes #1394.

18 months agofeat: Add support for MSVC /Tc and /Tp options
Joel Rosdahl [Sat, 3 Feb 2024 16:13:12 +0000 (17:13 +0100)] 
feat: Add support for MSVC /Tc and /Tp options

Closes #1387.

18 months agobump: Upgrade to fmt 10.2.1
Joel Rosdahl [Sat, 3 Feb 2024 09:46:33 +0000 (10:46 +0100)] 
bump: Upgrade to fmt 10.2.1

18 months agorefactor: Simplify Statistics::format_machine_readable slightly
Joel Rosdahl [Sat, 3 Feb 2024 09:42:29 +0000 (10:42 +0100)] 
refactor: Simplify Statistics::format_machine_readable slightly

18 months agobump: Upgrade to cpp-httplib 0.15.2
Joel Rosdahl [Wed, 31 Jan 2024 17:00:43 +0000 (18:00 +0100)] 
bump: Upgrade to cpp-httplib 0.15.2

18 months agofix: Fix MSVC crash when using /Zi /Fddebug.pdb
Joel Rosdahl [Mon, 22 Jan 2024 18:56:11 +0000 (19:56 +0100)] 
fix: Fix MSVC crash when using /Zi /Fddebug.pdb

This commit reverts 8e3ada3f830ad0e7d3ddf4eaf2b16e695bd084e4 (#1274).

Fixes #1386.

18 months agofeat: Let --inspect retain atime if possible
Joel Rosdahl [Fri, 26 Jan 2024 19:20:20 +0000 (20:20 +0100)] 
feat: Let --inspect retain atime if possible

For storage that relies on atime for LRU cleanup purposes, it makes
sense not to affect atime when inspecting cache entries.

18 months agoperf: Remove now unnecessary fs::path::string calls
Joel Rosdahl [Sat, 20 Jan 2024 14:04:03 +0000 (15:04 +0100)] 
perf: Remove now unnecessary fs::path::string calls

18 months agorefactor: fs::path-ify core::CacheEntry::Header
Joel Rosdahl [Sat, 20 Jan 2024 14:03:42 +0000 (15:03 +0100)] 
refactor: fs::path-ify core::CacheEntry::Header

18 months agoperf: Use util::PathString instead of fs::path copy
Joel Rosdahl [Sat, 20 Jan 2024 14:03:02 +0000 (15:03 +0100)] 
perf: Use util::PathString instead of fs::path copy

18 months agoenhance: Add util::PathString
Joel Rosdahl [Sat, 20 Jan 2024 14:00:17 +0000 (15:00 +0100)] 
enhance: Add util::PathString

18 months agochore: Remove obsolete section from LICENSE.adoc
Joel Rosdahl [Mon, 15 Jan 2024 20:36:04 +0000 (21:36 +0100)] 
chore: Remove obsolete section from LICENSE.adoc

18 months agochore: Fix some clang-tidy warnings
Joel Rosdahl [Mon, 15 Jan 2024 17:51:01 +0000 (18:51 +0100)] 
chore: Fix some clang-tidy warnings

18 months agofeat: Add support for MSVC /Yc option (precompiled headers) (#1384)
Clemens Wasser [Wed, 24 Jan 2024 19:58:47 +0000 (20:58 +0100)] 
feat: Add support for MSVC /Yc option (precompiled headers) (#1384)

18 months agofeat: Add `--print-stats` format selection, JSON format (#1382)
Kaspar Schleiser [Mon, 22 Jan 2024 19:22:06 +0000 (20:22 +0100)] 
feat: Add `--print-stats` format selection, JSON format (#1382)

18 months agofeat: Add `--print-log-stats` (#1381)
Kaspar Schleiser [Sat, 20 Jan 2024 19:42:15 +0000 (20:42 +0100)] 
feat: Add `--print-log-stats` (#1381)

This adds a "machine readable" variant of `--show-log-stats`, similar to
`--print-stats` as a variant of `--show-stats`.

18 months agochore: Remove left-over debug comment
Joel Rosdahl [Sun, 14 Jan 2024 10:48:40 +0000 (11:48 +0100)] 
chore: Remove left-over debug comment

18 months agofix: Disable caching for modified source/include files
Joel Rosdahl [Sun, 14 Jan 2024 09:46:54 +0000 (10:46 +0100)] 
fix: Disable caching for modified source/include files

On a cache miss, ccache opts out of the direct mode when a "too new"
include file is found. This is done to avoid a race condition in the
direct mode when a header file if modified after ccache is invoked but
before the compiler is executed. Modifying the main source code file is
not a race condition when "run_second_cpp = false", which was the case
at the time the direct mode was introduced. However, the default of
run_second_cpp was changed to true in ccache 3.3, and the potiential
race condition then exists for both the source and the include files.

Fix this by disabling caching completely (not only the direct mode) when
modification of a source/include file is detected.

Closes #1378.

18 months agofeat: Allow any prefix in prefix_command(_cpp) options
Joel Rosdahl [Sun, 14 Jan 2024 09:41:58 +0000 (10:41 +0100)] 
feat: Allow any prefix in prefix_command(_cpp) options

The prefix_command and prefix_command_cpp configuration options require
that the prefixes can be found in PATH.

This commit relaxes this requirement so that a relative prefix can be
used and a prefix program can have arguments.

18 months agorefactor: fs::path-ify util::is_dev_null_path
Joel Rosdahl [Sun, 14 Jan 2024 09:36:10 +0000 (10:36 +0100)] 
refactor: fs::path-ify util::is_dev_null_path

18 months agoenhance: Add Args::push_back(std::string&& arg)
Joel Rosdahl [Sun, 14 Jan 2024 09:35:25 +0000 (10:35 +0100)] 
enhance: Add Args::push_back(std::string&& arg)

18 months agochore: Remove time_of_compilation in favor of time_of_invocation
Joel Rosdahl [Tue, 9 Jan 2024 20:28:34 +0000 (21:28 +0100)] 
chore: Remove time_of_compilation in favor of time_of_invocation

We can compare source/include files against time of invocation just as
well; source files shouldn't be modified when ccache has started anyway.

18 months agorefactor: Move Util::is_absolute_path_with_prefix to util
Joel Rosdahl [Sun, 7 Jan 2024 13:53:01 +0000 (14:53 +0100)] 
refactor: Move Util::is_absolute_path_with_prefix to util

18 months agorefactor: Use std::string_view in compopt functions
Joel Rosdahl [Sun, 7 Jan 2024 12:29:20 +0000 (13:29 +0100)] 
refactor: Use std::string_view in compopt functions

18 months agofix: Avoid crash for -arch as last compiler option
Joel Rosdahl [Sat, 6 Jan 2024 19:21:44 +0000 (20:21 +0100)] 
fix: Avoid crash for -arch as last compiler option

The bug has been present since 89aa39f394e0fa4935e6cadd7184e372a37f9506
(ccache 3.3).

Fixes #1377.

18 months agorefactor: Convert usage of Util::remove_extension to std::filesystem
Joel Rosdahl [Tue, 2 Jan 2024 15:25:55 +0000 (16:25 +0100)] 
refactor: Convert usage of Util::remove_extension to std::filesystem

18 months agorefactor: Convert usage of Util::dir_name to std::filesystem
Joel Rosdahl [Tue, 2 Jan 2024 15:11:32 +0000 (16:11 +0100)] 
refactor: Convert usage of Util::dir_name to std::filesystem

18 months agoenhance: Add wrapper of std::filesystem::equivalent
Joel Rosdahl [Sat, 6 Jan 2024 20:11:20 +0000 (21:11 +0100)] 
enhance: Add wrapper of std::filesystem::equivalent

18 months agorefactor: Convert usage of Util::change_extension to std::filesystem
Joel Rosdahl [Tue, 2 Jan 2024 14:12:08 +0000 (15:12 +0100)] 
refactor: Convert usage of Util::change_extension to std::filesystem

18 months agorefactor: Convert usage of Util::get_extension to std::filesystem
Joel Rosdahl [Mon, 1 Jan 2024 12:37:53 +0000 (13:37 +0100)] 
refactor: Convert usage of Util::get_extension to std::filesystem

18 months agorefactor: Convert usage of util::real_path to std::filesystem
Joel Rosdahl [Sun, 31 Dec 2023 14:47:06 +0000 (15:47 +0100)] 
refactor: Convert usage of util::real_path to std::filesystem

18 months agotest: Add test of core::rewrite_stderr_to_absolute_paths
Joel Rosdahl [Sun, 31 Dec 2023 14:20:16 +0000 (15:20 +0100)] 
test: Add test of core::rewrite_stderr_to_absolute_paths

18 months agorefactor: Convert usage of Util::base_name to std::filesystem
Joel Rosdahl [Sun, 31 Dec 2023 10:10:27 +0000 (11:10 +0100)] 
refactor: Convert usage of Util::base_name to std::filesystem

18 months agoenhance: Add wrapper of std::filesystem::is_regular_file
Joel Rosdahl [Sun, 31 Dec 2023 14:45:49 +0000 (15:45 +0100)] 
enhance: Add wrapper of std::filesystem::is_regular_file

19 months agorefactor: fs::path-ify TestUtil
Joel Rosdahl [Sun, 31 Dec 2023 09:42:09 +0000 (10:42 +0100)] 
refactor: fs::path-ify TestUtil

19 months agochore: Update authors v4.9
Joel Rosdahl [Sat, 30 Dec 2023 15:08:02 +0000 (16:08 +0100)] 
chore: Update authors

19 months agochore: Update NEWS
Joel Rosdahl [Sat, 30 Dec 2023 15:05:19 +0000 (16:05 +0100)] 
chore: Update NEWS

19 months agoci: Add typos job
Joel Rosdahl [Sat, 30 Dec 2023 09:27:40 +0000 (10:27 +0100)] 
ci: Add typos job

19 months agoci: Bump to codespell 2.2.6
Joel Rosdahl [Sat, 30 Dec 2023 09:25:16 +0000 (10:25 +0100)] 
ci: Bump to codespell 2.2.6

19 months agofeat: Add support for undocumented GCC/Clang --include option
Joel Rosdahl [Fri, 22 Dec 2023 12:41:17 +0000 (13:41 +0100)] 
feat: Add support for undocumented GCC/Clang --include option

Note: Clang accepts a concatenated argument (--includefoo.h) but GCC
does not.

Closes #1324.

19 months agobump: Upgrade to cpp-httplib 0.14.3
Joel Rosdahl [Fri, 22 Dec 2023 12:37:24 +0000 (13:37 +0100)] 
bump: Upgrade to cpp-httplib 0.14.3

19 months agochore: Remove unused local variable
Joel Rosdahl [Mon, 18 Dec 2023 20:08:26 +0000 (21:08 +0100)] 
chore: Remove unused local variable

19 months agochore: Add debug log when finding -frecord-gcc-switches
Joel Rosdahl [Sun, 17 Dec 2023 21:00:04 +0000 (22:00 +0100)] 
chore: Add debug log when finding -frecord-gcc-switches

19 months agobuild: Set both C/CXX launchers if either is set (#1343)
Rafael Kitover [Sat, 16 Dec 2023 15:19:33 +0000 (07:19 -0800)] 
build: Set both C/CXX launchers if either is set (#1343)

Add cmake/EnableCcache.cmake and load it from the main file.

Make the standard cmake variables CMAKE_CXX_COMPILER_LAUNCHER and
CMAKE_C_COMPILER_LAUNCHER consistent with each other if either is not
set.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
19 months agofeat: Support st_Xtimensec fields in struct stat
Joel Rosdahl [Sat, 16 Dec 2023 09:59:20 +0000 (10:59 +0100)] 
feat: Support st_Xtimensec fields in struct stat

This increases file timestamp precision on some BSD-based OSes.

Closes #1369.

19 months agofix: Generalize expansion of remote storage URLs with sharding
Joel Rosdahl [Fri, 15 Dec 2023 19:01:49 +0000 (20:01 +0100)] 
fix: Generalize expansion of remote storage URLs with sharding

Fixes #1321.

19 months agofix: Correct util::LockFile sleep time constants
Joel Rosdahl [Wed, 13 Dec 2023 20:10:24 +0000 (21:10 +0100)] 
fix: Correct util::LockFile sleep time constants

Regression in 930d3b67a49f.

19 months agorefactor: Replace util::is_absolute_path with fs::path::is_absolute
Joel Rosdahl [Sat, 9 Dec 2023 12:44:17 +0000 (13:44 +0100)] 
refactor: Replace util::is_absolute_path with fs::path::is_absolute

19 months agochore: Fix some -Wconversion warnings
Joel Rosdahl [Mon, 4 Dec 2023 19:15:15 +0000 (20:15 +0100)] 
chore: Fix some -Wconversion warnings

19 months agofix: Handle -Xclang -ast-dump et al correctly
Joel Rosdahl [Sun, 3 Dec 2023 20:11:33 +0000 (21:11 +0100)] 
fix: Handle -Xclang -ast-dump et al correctly

Fixes #1356.

19 months agofeat: Improve processing of input file arguments
Joel Rosdahl [Sat, 2 Dec 2023 11:24:07 +0000 (12:24 +0100)] 
feat: Improve processing of input file arguments

Instead of checking if a non-option argument has a known file extension,
switch to the better heuristic of checking if the file exists or not: if
it doesn't exist it isn't an input argument.

20 months agofix: Use MSVC logic for clang-cl when handling precompiled header (#1365)
DarkShadow44 [Mon, 27 Nov 2023 19:34:30 +0000 (20:34 +0100)] 
fix: Use MSVC logic for clang-cl when handling precompiled header (#1365)

20 months agochore: Improve typos configuration (#1358)
Viktor Szépe [Sun, 26 Nov 2023 17:16:29 +0000 (18:16 +0100)] 
chore: Improve typos configuration (#1358)

20 months agoci: Remove matrix.config from build.yaml (#1360)
Viktor Szépe [Sun, 26 Nov 2023 17:15:13 +0000 (18:15 +0100)] 
ci: Remove matrix.config from build.yaml (#1360)

20 months agoci: Split dependency installation step into two (#1359)
Viktor Szépe [Sun, 26 Nov 2023 15:55:56 +0000 (16:55 +0100)] 
ci: Split dependency installation step into two (#1359)

20 months agotest: Fix regex in direct.bash (#1357)
Viktor Szépe [Sun, 26 Nov 2023 15:52:55 +0000 (16:52 +0100)] 
test: Fix regex in direct.bash (#1357)

20 months agofix: Detect compiler from unresolved symlink with fallback
Joel Rosdahl [Thu, 23 Nov 2023 20:46:20 +0000 (21:46 +0100)] 
fix: Detect compiler from unresolved symlink with fallback

This is a generalization of the fix in PR #1348 for issue #1347.

20 months agochore: Remove obsolete Util::is_dir_separator
Joel Rosdahl [Tue, 21 Nov 2023 20:02:43 +0000 (21:02 +0100)] 
chore: Remove obsolete Util::is_dir_separator

20 months agochore: Remove superfluous #includes
Joel Rosdahl [Tue, 21 Nov 2023 19:40:54 +0000 (20:40 +0100)] 
chore: Remove superfluous #includes

20 months agofix: Detect symlink called clang-cl as clang-cl (#1348)
DarkShadow44 [Thu, 23 Nov 2023 20:26:31 +0000 (21:26 +0100)] 
fix: Detect symlink called clang-cl as clang-cl (#1348)

Fixes #1347.

20 months agofeat: Add support for clang --analyze (#1345)
Mikhail B [Mon, 20 Nov 2023 20:57:49 +0000 (15:57 -0500)] 
feat: Add support for clang --analyze (#1345)

21 months agofix: Devmode unused function warnings on new MSVC (#1342)
Rafael Kitover [Sun, 29 Oct 2023 08:33:09 +0000 (08:33 +0000)] 
fix: Devmode unused function warnings on new MSVC (#1342)

MSVC apparently has overrides for the two definitions of operator== in
unittest/test_util_string.cpp in the <utility> header, raising a warning
about them being local unused functions:

https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4505?view=msvc-170

Disable this warning type in cmake/DevModeWarnings.cmake for MSVC.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
21 months agofeat: cmake -DOFFLINE=TRUE for offline builds (#1341)
Rafael Kitover [Sun, 29 Oct 2023 08:31:15 +0000 (08:31 +0000)] 
feat: cmake -DOFFLINE=TRUE for offline builds (#1341)

Add the cmake option OFFLINE, defaulting to the value of the standard
variable FETCHCONTENT_FULLY_DISCONNECTED, which is OFF by default, to
disable downloading anything from the internet.

When ON, set FETCHCONTENT_FULLY_DISCONNECTED to ON, ZSTD_FROM_INTERNET
to OFF and HIREDIS_FROM_INTERNET to OFF.

When downloading is OFF and either library is not found, throw an error
using find_package_handle_standard_args().

Add the option to INSTALL.md doc.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
21 months agofix: cmake -DSTATIC_LINK=ON on Linux/macOS (#1340)
Rafael Kitover [Sun, 29 Oct 2023 08:28:15 +0000 (08:28 +0000)] 
fix: cmake -DSTATIC_LINK=ON on Linux/macOS (#1340)

Make linking dependent libraries as static a hard requirement when
STATIC_LINK is ON, as opposed to the previous behavior of falling back
to dynamic libraries.

A side-effect of this is that if only a dynamic zstd/hiredis is
available on a system, it will not be found, and the download and build
code will be invoked to build a static version from the internet.

Add a general case to handle Linux, macOS and similar by linking
libgcc/libstdc++ statically on gcc/clang.

Move the code into cmake/StaticLinkSupport.cmake and include it from the
main file.

Fix #1330

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
21 months agofix: Mark -wrapper as too hard
Joel Rosdahl [Sun, 29 Oct 2023 07:28:07 +0000 (08:28 +0100)] 
fix: Mark -wrapper as too hard

See also #1339.

21 months agodocs: Improve language
Joel Rosdahl [Thu, 26 Oct 2023 17:07:44 +0000 (19:07 +0200)] 
docs: Improve language

21 months agorefactor: Use fs::weakly_canonical in prepare_debug_path
Joel Rosdahl [Mon, 23 Oct 2023 18:55:09 +0000 (20:55 +0200)] 
refactor: Use fs::weakly_canonical in prepare_debug_path

21 months agofix: Make handling of Clang config options more robust
Joel Rosdahl [Tue, 17 Oct 2023 19:36:35 +0000 (21:36 +0200)] 
fix: Make handling of Clang config options more robust

Closes #1335.

21 months agofix: Fix Windows is_absolute_path() crash on drive letter (#1338)
Martin Blanchard [Mon, 16 Oct 2023 19:06:47 +0000 (21:06 +0200)] 
fix: Fix Windows is_absolute_path() crash on drive letter (#1338)

21 months agofix: Fix sign-compare warning src/InodeCache.cpp on FreeBSD (#1331)
Philipp Storz [Mon, 16 Oct 2023 19:02:55 +0000 (21:02 +0200)] 
fix: Fix sign-compare warning src/InodeCache.cpp on FreeBSD (#1331)

As on FreeBSD 13.2 statfs.f_bavail is signed, InodeCache.cpp cannot be compiled
but gets a sign-compare warning:

  src/InodeCache.cpp:409:30: error: comparison of integers of different signs:
    'long' and 'unsigned long' [-Werror,-Wsign-compare]
      if (buf.f_bavail * 512 < k_min_fs_mib_left * 1024 * 1024) {
          ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

The problem is avoided by using static_cast to uint64_t.

21 months agofix: Let DirEntry::size_on_disk return likely size on disk
Joel Rosdahl [Mon, 16 Oct 2023 17:33:31 +0000 (19:33 +0200)] 
fix: Let DirEntry::size_on_disk return likely size on disk

st_blocks in struct stat cannot be trusted for some filesystems that do
transparent compression or deduplication. For instance, ZFS can adjust
the block count some time in the future when compression is finished.

The only reasonable fix for this seems to be to just guess how much
space the file will take using st_size.

Fixes #1332.

22 months agofix: Bail out on too hard options -fmodules-ts and -fmodule-header
Joel Rosdahl [Wed, 4 Oct 2023 16:13:52 +0000 (18:13 +0200)] 
fix: Bail out on too hard options -fmodules-ts and -fmodule-header

Fixes #1333.

22 months agochore: Add entries to codespell allow list
Joel Rosdahl [Mon, 2 Oct 2023 19:38:14 +0000 (21:38 +0200)] 
chore: Add entries to codespell allow list

22 months agorefactor: Move Logging to util
Joel Rosdahl [Mon, 2 Oct 2023 19:06:20 +0000 (21:06 +0200)] 
refactor: Move Logging to util

22 months agorefactor: Move Win32Util::error_message to util
Joel Rosdahl [Mon, 2 Oct 2023 18:45:02 +0000 (20:45 +0200)] 
refactor: Move Win32Util::error_message to util

22 months agorefactor: Move Win32Util::argv_to_string to util
Joel Rosdahl [Mon, 2 Oct 2023 16:38:05 +0000 (18:38 +0200)] 
refactor: Move Win32Util::argv_to_string to util

22 months agorefactor: Move Win32Util::add_exe_suffix to util
Joel Rosdahl [Mon, 2 Oct 2023 16:32:56 +0000 (18:32 +0200)] 
refactor: Move Win32Util::add_exe_suffix to util