J. Neuschäfer [Tue, 28 Oct 2025 18:48:23 +0000 (19:48 +0100)]
build(blake3): Assume aarch64 to be little-endian on CMake 3.18/3.19 (#1652)
The recently introduced detection of big-endian AArch64 uses the
CMAKE_C_BYTE_ORDER variable, which was introduced in 3.20, but ccache
currently only requires CMake 3.18.
To avoid using an undefined variable, simply assume AArch64 to be
little-endian on CMake versions that don't define the aforementioned
variable. This is okay because big-endian AArch64 has few users and the
subset of them that use CMake 3.18/3.19 is likely negligible.
Andrej [Mon, 6 Oct 2025 19:12:20 +0000 (21:12 +0200)]
docs: Reconcile max-size suffixes in documentation (#1640)
* Use explicit 'GB' suffix in example.
* Fix misleading `max_size` description. Default suffix is GiB, not GB. And default value is 5GiB also.
* `max_size` description - use explicit suffixes.
Joel Rosdahl [Sun, 5 Oct 2025 17:29:36 +0000 (19:29 +0200)]
chore: Improve util::FileLock
- Release current lock on move.
- Check for invalid file descriptor in acquire/release.
- Use UnlockFileEx on Windows for symmetry with LockFileEx.
- Added noexcept where applicable.
Joel Rosdahl [Sun, 28 Sep 2025 11:35:03 +0000 (13:35 +0200)]
fix: Handle -Xarch_host/-Xarch_device except with other -Xarch_*
-Xarch_host and -Xarch_device appear to have different semantics than
other -Xarch_* options, so add special case code that allows only
-Xarch_host options or only -Xarch_device options while falling back to
the compiler for other combinations.
A future improvement would be to add multi-pass support for -Xarch_host
and -Xarch_device combinations as well.
For example GetVolumePathName returns `F:/git_projects` on my computer which
does not fit in a char[4]. As a result GetVolumePathName returns an error and
a std::string is initialized from uninitialized memory which may not contain
a '\0' resulting in out of bounds memory reads.
Joel Rosdahl [Tue, 9 Sep 2025 16:34:34 +0000 (18:34 +0200)]
fix: Avoid expanding symlinks in relative path candidates
Commit 8223ed38abd9cf75ab75cb19dc2081c44bf568d0 changed
make_relative_path to also try matching real_path(path) against the
apparent/actual CWD, assuming that an absolute path p could be
substituted with real_path(p).
This assumption is incorrect for source files: if the source file
includes a file via a relative path, expanding symlinks may cause the
include file to be searched in the wrong directory.
Fix by reverting that change. The new test case "Symlink to source file,
longer symlink path" fails without this fix.
Joel Rosdahl [Sun, 7 Sep 2025 17:10:47 +0000 (19:10 +0200)]
fix: Hash specs file actually used by GCC
"gcc -specs=foo" (when "foo" doesn't include a slash) makes GCC search
in various system directories for the file, so ccache fails to hash the
file if it's found in such a directory.
Fix this by asking the compiler (using "-print-file-name") which file it
will actually read.
fix: Fix bad conversion from UTF-16 in util::read_file on Windows (#1627)
When interpreting a char* string that is null terminated as wchar* string
it is not guaranteed that the wchar* string is also null terminated. A char[3]
string/memeory region with the content ['a', '\0', '\0', 100] interpreted as
wchar* has no ending null character resulting in out of bounds memory reads
when trying to construct a std::wstring from it.
Joel Rosdahl [Sun, 10 Aug 2025 08:56:19 +0000 (10:56 +0200)]
ci: Improve binary build jobs
For x86_64, build in an Alma Linux 8 container since RHEL 8 is the
oldest still active LTS mainstream Linux distribution to my knowledge.
For aarch64, cross compile in an x86_64 environment instead of in a
native aarch64 environment. This is because I want to be able to build
release binaries locally on my x86_64 machine if there is some problem
with the CI environment and it feels good to match that in CI. The build
is still on Ubuntu 22.04 – I made a quick attempt to get
cross-compilation working in Alma Linux 8 working but gave up.