From 18550f5868644268afc9aeef959f3de1fb8ca2b2 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Wed, 14 Oct 2026 19:20:21 +0800 Subject: [PATCH] Fix CI for the C++ core: libstdc++ headers, static unwinder, newer clang - docker/static: Alpine's libstdc++ headers come with g++, and the C++ tests' static libstdc++ needs an unwinder that compiler-rt lacks; add g++ and llvm-libunwind. - FixedBuffer: drop the unused kCapacity (clang-tidy 18 reports it as a dynamically initialized header static). - ss-server on Windows: manager_addr was only read in POSIX-only code, which newer clang rejects (-Wunused-but-set-global); say that the option is ignored there. --- docker/static/Dockerfile | 4 ++-- src/core/buffer.hpp | 2 -- src/server.c | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docker/static/Dockerfile b/docker/static/Dockerfile index a2e31b94..8fab5bc0 100644 --- a/docker/static/Dockerfile +++ b/docker/static/Dockerfile @@ -2,7 +2,7 @@ ARG ALPINE_IMAGE=alpine:3.24 FROM ${ALPINE_IMAGE} AS build ARG ALPINE_MIRROR=https://dl-cdn.alpinelinux.org/alpine RUN sed -i "s|https://dl-cdn.alpinelinux.org/alpine|${ALPINE_MIRROR}|g" /etc/apk/repositories \ - && apk add --no-cache clang lld make musl-dev compiler-rt libstdc++-dev cmake linux-headers python3 binutils file + && apk add --no-cache clang lld make musl-dev compiler-rt llvm-libunwind-static g++ libstdc++-dev cmake linux-headers python3 binutils file ENV CC=clang CXX=clang++ WORKDIR /src COPY . . @@ -11,7 +11,7 @@ RUN --network=none cmake -S . -B /build \ -DCMAKE_BUILD_TYPE=Release \ -DSS_DEPENDENCY_MODE=bundled -DWITH_STATIC=ON \ -DSS_BUILD_STATIC_LIBRARY=OFF -DSS_BUILD_SHARED_LIBRARY=OFF \ - -DSS_MINIMAL=${SS_MINIMAL} -DCMAKE_EXE_LINKER_FLAGS="-static -fuse-ld=lld --rtlib=compiler-rt" \ + -DSS_MINIMAL=${SS_MINIMAL} -DCMAKE_EXE_LINKER_FLAGS="-static -fuse-ld=lld --rtlib=compiler-rt --unwindlib=libunwind" \ -DCMAKE_INSTALL_PREFIX=/out \ && cmake --build /build --parallel 4 \ && ctest --test-dir /build -L 'unit|vendor' --output-on-failure --no-tests=error \ diff --git a/src/core/buffer.hpp b/src/core/buffer.hpp index 6d44a72a..52cbc584 100644 --- a/src/core/buffer.hpp +++ b/src/core/buffer.hpp @@ -33,8 +33,6 @@ class FixedBuffer { static_assert(N > 0 && N <= UINT32_MAX); public: - static constexpr std::size_t kCapacity = N; - constexpr std::size_t capacity() const noexcept { return N; } constexpr std::size_t size() const noexcept { return len_; } constexpr bool empty() const noexcept { return len_ == 0; } diff --git a/src/server.c b/src/server.c index e75e1bdc..a5ee7bb5 100644 --- a/src/server.c +++ b/src/server.c @@ -2588,6 +2588,12 @@ Same behavior as `-d`; see that option for details. Short alias: `-d`. } } +#ifdef __MINGW32__ + if (manager_addr != NULL) { + LOGE("--manager-address is not supported on Windows; ignored"); + } +#endif + #ifndef __MINGW32__ if (manager_addr != NULL) { ss_timer_init(&stat_update_watcher, stat_update_cb, UPDATE_INTERVAL, UPDATE_INTERVAL);