From 86a1ae9b1f56fc62d7233f4f478b443153c72b6c Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Tue, 7 Jul 2026 13:59:46 -0400 Subject: [PATCH 1/7] use new images in test.yml Co-Authored-By: Claude Opus 4.8 --- .github/workflows/test.yml | 39 +++---------------------------------- src/viam/sdk/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a6a53543b..a9f9e42c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: if: github.repository_owner == 'viamrobotics' runs-on: ubuntu-latest container: - image: debian:bookworm + image: ghcr.io/viamrobotics/cpp-sdk-system-debian:bookworm strategy: fail-fast: false matrix: @@ -26,46 +26,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install dependencies + - name: Install test-only dependencies run: | apt-get update - apt-get -y dist-upgrade DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - build-essential \ - ca-certificates \ - cmake \ curl \ - doxygen \ - g++ \ gettext \ - gdb \ - git \ - gnupg \ - gpg \ - less \ - libboost-all-dev \ - libc-ares-dev \ - libgrpc++-dev \ - libprotobuf-dev \ - libre2-dev \ - libssl-dev \ - lsof \ - ninja-build \ - pkg-config \ - protobuf-compiler-grpc \ - software-properties-common \ - sudo \ - wget \ - zlib1g-dev - - bash -c 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -' - apt-add-repository -y 'deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-15 main' - apt-add-repository -y 'deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-15 main' - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -t llvm-toolchain-bookworm-15 \ - clang-15 \ - clang-tidy-15 \ - clang-format + lsof - name: Build viam server run: | diff --git a/src/viam/sdk/CMakeLists.txt b/src/viam/sdk/CMakeLists.txt index 1cde78387..2068c9884 100644 --- a/src/viam/sdk/CMakeLists.txt +++ b/src/viam/sdk/CMakeLists.txt @@ -48,7 +48,7 @@ if (VIAMCPPSDK_SANITIZED_BUILD) target_compile_options(viamsdk PRIVATE -fsanitize=undefined -fno-omit-frame-pointer -fno-sanitize-recover) endif() if (VIAMCPPSDK_CLANG_TIDY) - find_program(CLANG_TIDY_EXE NAMES "clang-tidy-15" "clang-tidy") + find_program(CLANG_TIDY_EXE NAMES "clang-tidy-19" "clang-tidy-15" "clang-tidy") set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--config-file=../.clang-tidy") set_target_properties(viamsdk PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") endif() From 411e91248344c36012809a2410e8fadd1cffb6ea Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Tue, 7 Jul 2026 14:05:42 -0400 Subject: [PATCH 2/7] linter and release jobs Co-Authored-By: Claude Opus 4.8 --- .github/workflows/linter.yml | 3 +- .github/workflows/release.yml | 71 ++--------------------------------- 2 files changed, 6 insertions(+), 68 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 5022776a5..1ab844fc2 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -11,7 +11,7 @@ jobs: cpp-linter: if: github.repository_owner == 'viamrobotics' runs-on: ubuntu-latest - container: ghcr.io/viamrobotics/cpp-base:bullseye-amd64 + container: ghcr.io/viamrobotics/cpp-sdk-system-debian:bullseye steps: - name: Checkout Code uses: actions/checkout@v4 @@ -19,6 +19,7 @@ jobs: fetch-depth: 0 - name: verify no uncommitted changes run: | + ln -sf "$(command -v clang-format-19)" /usr/local/bin/clang-format chown $(whoami) . git init git add . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13bb97272..c4e1dfb34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,11 +151,11 @@ jobs: include: - target: aarch64-ubuntu-jammy-gnu platform: linux_aarch64-ubuntu-jammy - image: ubuntu:22.04 + image: ghcr.io/viamrobotics/cpp-sdk-system-ubuntu:jammy runs_on: github-linux-arm64-8core - target: x86_64-ubuntu-jammy-gnu platform: linux_x86_64-ubuntu-jammy - image: ubuntu:22.04 + image: ghcr.io/viamrobotics/cpp-sdk-system-ubuntu:jammy runs_on: ubuntu-large steps: @@ -164,39 +164,6 @@ jobs: with: ref: ${{ needs.prepare.outputs.sha }} - - name: Install dependencies - run: | - apt-get update - apt-get -y dist-upgrade - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - build-essential \ - ca-certificates \ - curl \ - doxygen \ - g++ \ - gdb \ - git \ - gnupg \ - gpg \ - less \ - libboost-all-dev \ - libgrpc++-dev \ - libprotobuf-dev \ - libssl-dev \ - ninja-build \ - pkg-config \ - protobuf-compiler \ - protobuf-compiler-grpc \ - software-properties-common \ - sudo \ - wget \ - - sudo wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null - sudo echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null - - apt-get update - apt-get -y install cmake=3.25.2-0kitware1ubuntu22.04.1 cmake-data=3.25.2-0kitware1ubuntu22.04.1 - - name: Setup build directory run: mkdir builds @@ -234,11 +201,11 @@ jobs: include: - target: aarch64-debian-bookworm platform: linux_aarch64-debian-bookworm - image: debian:bookworm + image: ghcr.io/viamrobotics/cpp-sdk-system-debian:bookworm runs_on: github-linux-arm64-8core - target: x86_64-debian-bookworm platform: linux_x86_64-debian-bookworm - image: debian:bookworm + image: ghcr.io/viamrobotics/cpp-sdk-system-debian:bookworm runs_on: ubuntu-large steps: @@ -247,36 +214,6 @@ jobs: with: ref: ${{ needs.prepare.outputs.sha }} - - name: Install dependencies - run: | - apt-get update - apt-get -y dist-upgrade - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - doxygen \ - g++ \ - gdb \ - git \ - gnupg \ - gpg \ - less \ - libboost-all-dev \ - libc-ares-dev \ - libgrpc++-dev \ - libprotobuf-dev \ - libre2-dev \ - libssl-dev \ - ninja-build \ - pkg-config \ - protobuf-compiler-grpc \ - software-properties-common \ - sudo \ - wget \ - zlib1g-dev - - name: Setup build directory run: mkdir builds From 5752def2069a40a606626609bb788b128a791b2f Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Wed, 8 Jul 2026 13:50:13 -0400 Subject: [PATCH 3/7] Suppress clang-diagnostic-enum-constexpr-conversion from Boost MPL headers Co-Authored-By: Claude Opus 4.8 (1M context) --- .clang-tidy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index 03439f028..c4b42851b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,6 +9,7 @@ # misc-include-cleaner: TODO(RSDK-5479) this is overly finnicky, add IWYU support and fix. # readability-function-cognitive-complexity: No, complexity is subjective and sometimes necessary. # readability-else-after-return: No, this causes code complexification +# clang-diagnostic-enum-constexpr-conversion: Boost MPL headers trip this hard error on clang>=16; not our code. Checks: > -*, bugprone-*, @@ -28,6 +29,7 @@ Checks: > -misc-include-cleaner, -readability-function-cognitive-complexity, -readability-else-after-return, + -clang-diagnostic-enum-constexpr-conversion, WarningsAsErrors: '*' FormatStyle: none CheckOptions: From d2e0f2143cefe40ee21b5a5921f03dc261805862 Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Wed, 8 Jul 2026 13:59:27 -0400 Subject: [PATCH 4/7] Pass -Wno-enum-constexpr-conversion to clang-tidy for Boost MPL headers Co-Authored-By: Claude Opus 4.8 (1M context) --- .clang-tidy | 2 -- src/viam/sdk/CMakeLists.txt | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index c4b42851b..03439f028 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,7 +9,6 @@ # misc-include-cleaner: TODO(RSDK-5479) this is overly finnicky, add IWYU support and fix. # readability-function-cognitive-complexity: No, complexity is subjective and sometimes necessary. # readability-else-after-return: No, this causes code complexification -# clang-diagnostic-enum-constexpr-conversion: Boost MPL headers trip this hard error on clang>=16; not our code. Checks: > -*, bugprone-*, @@ -29,7 +28,6 @@ Checks: > -misc-include-cleaner, -readability-function-cognitive-complexity, -readability-else-after-return, - -clang-diagnostic-enum-constexpr-conversion, WarningsAsErrors: '*' FormatStyle: none CheckOptions: diff --git a/src/viam/sdk/CMakeLists.txt b/src/viam/sdk/CMakeLists.txt index 2068c9884..39b1913ed 100644 --- a/src/viam/sdk/CMakeLists.txt +++ b/src/viam/sdk/CMakeLists.txt @@ -49,7 +49,8 @@ if (VIAMCPPSDK_SANITIZED_BUILD) endif() if (VIAMCPPSDK_CLANG_TIDY) find_program(CLANG_TIDY_EXE NAMES "clang-tidy-19" "clang-tidy-15" "clang-tidy") - set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--config-file=../.clang-tidy") + # -Wno-enum-constexpr-conversion: Boost MPL headers trip this hard clang error on clang>=16; not our code. + set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--config-file=../.clang-tidy" "--extra-arg=-Wno-enum-constexpr-conversion") set_target_properties(viamsdk PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") endif() From 5072c59b5e27565e238601413823d55ece490a3b Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:26:15 -0400 Subject: [PATCH 5/7] anon ns --- src/viam/sdk/common/utils.cpp | 4 ++++ src/viam/sdk/common/version_metadata.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/viam/sdk/common/utils.cpp b/src/viam/sdk/common/utils.cpp index 1d30dec7e..86ff78d5f 100644 --- a/src/viam/sdk/common/utils.cpp +++ b/src/viam/sdk/common/utils.cpp @@ -95,6 +95,8 @@ std::string bytes_to_string(const std::vector& b) { return img_string; } +namespace { + std::string random_debug_key() { static const char alphanum[] = "abcdefghijklmnopqrstuvwxyz"; static std::default_random_engine generator( @@ -111,6 +113,8 @@ std::string random_debug_key() { return key; } +} // namespace + ProtoStruct debug_map() { return debug_map(random_debug_key()); } diff --git a/src/viam/sdk/common/version_metadata.cpp b/src/viam/sdk/common/version_metadata.cpp index 8605b417c..956b5c43b 100644 --- a/src/viam/sdk/common/version_metadata.cpp +++ b/src/viam/sdk/common/version_metadata.cpp @@ -18,6 +18,8 @@ std::string sdk_version() { return result; } +namespace { + int get_sub_version(int which) { static const std::array components = [] { std::array result; @@ -38,6 +40,8 @@ int get_sub_version(int which) { return components[which]; } +} // namespace + int sdk_major_version() { return get_sub_version(0); } From 7d4af3590b91d8d1eff9c89ad78f650088312435 Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Fri, 10 Jul 2026 15:24:59 -0400 Subject: [PATCH 6/7] Use distro-default LLVM in base images; pin SDK clang-tidy to 15 Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/linter.yml | 1 - .github/workflows/test.yml | 1 + etc/docker/Dockerfile | 1 - etc/docker/scripts/install-base.sh | 6 +++++ etc/docker/scripts/install-llvm.sh | 41 ------------------------------ etc/docker/scripts/lib/common.sh | 5 ---- src/viam/sdk/CMakeLists.txt | 5 ++-- 7 files changed, 9 insertions(+), 51 deletions(-) delete mode 100755 etc/docker/scripts/install-llvm.sh diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1ab844fc2..d23c2fde4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -19,7 +19,6 @@ jobs: fetch-depth: 0 - name: verify no uncommitted changes run: | - ln -sf "$(command -v clang-format-19)" /usr/local/bin/clang-format chown $(whoami) . git init git add . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9f9e42c6..969ed9ccf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,7 @@ jobs: run: | apt-get update DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + clang-tidy-15 \ curl \ gettext \ lsof diff --git a/etc/docker/Dockerfile b/etc/docker/Dockerfile index ea854342a..32bd2c66c 100644 --- a/etc/docker/Dockerfile +++ b/etc/docker/Dockerfile @@ -33,7 +33,6 @@ COPY scripts/ /opt/scripts/ RUN chmod -R +x /opt/scripts RUN /opt/scripts/install-base.sh -RUN /opt/scripts/install-llvm.sh RUN /opt/scripts/install-cmake.sh diff --git a/etc/docker/scripts/install-base.sh b/etc/docker/scripts/install-base.sh index 945a5d3a0..8f2b5bf51 100755 --- a/etc/docker/scripts/install-base.sh +++ b/etc/docker/scripts/install-base.sh @@ -3,6 +3,9 @@ # Universal devkit: compilers, build tools, and the apt machinery the later # scripts lean on (wget/gnupg for signed-by repo adds, software-properties-common # for add-apt-repository on distros that still want it). +# +# The LLVM toolchain (clang, clang-tidy, clang-format) comes from the distro's own +# default version. Consumers needing a specific major install it themselves. set -euo pipefail [[ "${DEBUG:-}" ]] && set -x @@ -17,6 +20,9 @@ rm -rf /var/lib/apt/lists/* apt_install \ build-essential \ ca-certificates \ + clang \ + clang-format \ + clang-tidy \ g++ \ gcc \ git \ diff --git a/etc/docker/scripts/install-llvm.sh b/etc/docker/scripts/install-llvm.sh deleted file mode 100755 index 09de8e415..000000000 --- a/etc/docker/scripts/install-llvm.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -# -# LLVM toolchain (clang, clang-tidy, clang-format) at ${LLVM_VERSION}. -# Version-gated: use the distro's own clang-${LLVM_VERSION} when apt offers it, -# else add apt.llvm.org for the current distro codename. - -set -euo pipefail -[[ "${DEBUG:-}" ]] && set -x - -# shellcheck disable=SC1091 -. "$(dirname "$0")/lib/common.sh" - -# LLVM_VERSION is pinned in lib/common.sh. -LLVM_PKGS=( - "clang-${LLVM_VERSION}" - "clang-tidy-${LLVM_VERSION}" - "clang-format-${LLVM_VERSION}" -) - -apt-get update -clang_candidate="$(apt_candidate "clang-${LLVM_VERSION}")" -rm -rf /var/lib/apt/lists/* - -if [[ -n "${clang_candidate}" ]]; then - # Distro ships it directly. - apt_install "${LLVM_PKGS[@]}" -else - # apt.llvm.org suite name: llvm-toolchain--, except - # Debian sid which drops the codename segment (llvm-toolchain-). - if [[ "${DISTRO_CODENAME}" == "sid" ]]; then - repo_path="unstable" - suite="llvm-toolchain-${LLVM_VERSION}" - else - repo_path="${DISTRO_CODENAME}" - suite="llvm-toolchain-${DISTRO_CODENAME}-${LLVM_VERSION}" - fi - add_apt_repo "llvm" \ - "https://apt.llvm.org/llvm-snapshot.gpg.key" \ - "http://apt.llvm.org/${repo_path}/ ${suite} main" - apt_install_from "${suite}" "${LLVM_PKGS[@]}" -fi diff --git a/etc/docker/scripts/lib/common.sh b/etc/docker/scripts/lib/common.sh index 5c41efc6d..583b3c503 100644 --- a/etc/docker/scripts/lib/common.sh +++ b/etc/docker/scripts/lib/common.sh @@ -8,11 +8,6 @@ set -euo pipefail # ---- pinned toolchain versions (not configurable at docker build time) ---- -# LLVM_VERSION: the clang/clang-tidy/clang-format major version installed by -# install-llvm.sh. -LLVM_VERSION=19 -export LLVM_VERSION - # CMAKE_MIN_VERSION: minimum cmake install-cmake.sh accepts before pulling a # newer one from Kitware (Ubuntu) or Debian backports. CMAKE_MIN_VERSION=3.25 diff --git a/src/viam/sdk/CMakeLists.txt b/src/viam/sdk/CMakeLists.txt index 39b1913ed..1cde78387 100644 --- a/src/viam/sdk/CMakeLists.txt +++ b/src/viam/sdk/CMakeLists.txt @@ -48,9 +48,8 @@ if (VIAMCPPSDK_SANITIZED_BUILD) target_compile_options(viamsdk PRIVATE -fsanitize=undefined -fno-omit-frame-pointer -fno-sanitize-recover) endif() if (VIAMCPPSDK_CLANG_TIDY) - find_program(CLANG_TIDY_EXE NAMES "clang-tidy-19" "clang-tidy-15" "clang-tidy") - # -Wno-enum-constexpr-conversion: Boost MPL headers trip this hard clang error on clang>=16; not our code. - set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--config-file=../.clang-tidy" "--extra-arg=-Wno-enum-constexpr-conversion") + find_program(CLANG_TIDY_EXE NAMES "clang-tidy-15" "clang-tidy") + set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--config-file=../.clang-tidy") set_target_properties(viamsdk PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") endif() From 6bd3158f2b28ade8772f7b477c3c0ed42edfb2eb Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:04:22 -0400 Subject: [PATCH 7/7] docker base images: let unstable sid cell fail without blocking merge Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/docker-base-images.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docker-base-images.yml b/.github/workflows/docker-base-images.yml index 9a3df2b1f..d7831b87f 100644 --- a/.github/workflows/docker-base-images.yml +++ b/.github/workflows/docker-base-images.yml @@ -69,6 +69,9 @@ jobs: - arch: arm64 runner: ubuntu-24.04-arm runs-on: ${{ matrix.runner }} + # Unstable distros (debian sid) are allowed to fail without blocking the + # merge/publish of the stable cells. A stable cell's failure still gates. + continue-on-error: ${{ endsWith(matrix.cell.target, '-sid') }} steps: - uses: actions/checkout@v4 @@ -134,6 +137,9 @@ jobs: matrix: cell: ${{ fromJson(needs.matrix.outputs.cells) }} runs-on: ubuntu-latest + # Match the build job: a missing-digest sid merge fails on its own without + # blocking the stable cells' manifest push. + continue-on-error: ${{ endsWith(matrix.cell.target, '-sid') }} steps: - uses: docker/setup-buildx-action@v3