From 11404dc2bbfb9033344ff360e72b66372edd0d9b Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 25 Feb 2026 15:50:45 -0600 Subject: Fix log copy truncation, enable ccache for build cache Fix "Copy all" log truncation: the code unconditionally stripped 2 chars (\r\n) from formatted log messages, but on Linux spdlog only appends \n. Every log message lost its last real character. Now strips trailing \r and \n dynamically. Enable ccache: it was installed in the Docker image but never activated. build-inner.sh now auto-detects ccache and sets CMAKE_*_COMPILER_LAUNCHER. build.sh mounts a persistent ccache volume (~/.cache/fluorine-ccache) into the container. CI workflow uses actions/cache to persist ccache across runs. Co-Authored-By: Claude Opus 4.6 --- libs/uibase/src/log.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'libs/uibase/src/log.cpp') diff --git a/libs/uibase/src/log.cpp b/libs/uibase/src/log.cpp index a44c9e3..b7c6a9a 100644 --- a/libs/uibase/src/log.cpp +++ b/libs/uibase/src/log.cpp @@ -109,11 +109,15 @@ protected: spdlog::memory_buf_t formatted; base_sink::formatter_->format(m, formatted); - if (formatted.size() >= 2) { - // remove \r\n - e.formattedMessage.assign(formatted.begin(), formatted.end() - 2); - } else { - e.formattedMessage = std::string(formatted); + // Strip trailing newline(s). spdlog appends \r\n on Windows but only + // \n on Linux; unconditionally removing 2 chars truncates the real message. + { + auto end = formatted.end(); + while (end != formatted.begin() && + (*(end - 1) == '\n' || *(end - 1) == '\r')) { + --end; + } + e.formattedMessage.assign(formatted.begin(), end); } (*m_f)(std::move(e)); -- cgit v1.3.1