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.
This commit is contained in:
Max Lv
2026-10-14 19:20:21 +08:00
parent 2285528788
commit 18550f5868
3 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -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 \
-2
View File
@@ -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; }
+6
View File
@@ -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);