Skip to content
Merged
3 changes: 2 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ 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
with:
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 .
Expand Down
71 changes: 4 additions & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Comment on lines -167 to -199

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

- name: Setup build directory
run: mkdir builds

Expand Down Expand Up @@ -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:
Expand All @@ -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

Expand Down
39 changes: 3 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand Down
5 changes: 3 additions & 2 deletions src/viam/sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ 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")
set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--config-file=../.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")
set_target_properties(viamsdk PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
endif()

Expand Down
4 changes: 4 additions & 0 deletions src/viam/sdk/common/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ std::string bytes_to_string(const std::vector<unsigned char>& b) {
return img_string;
}

namespace {

std::string random_debug_key() {
static const char alphanum[] = "abcdefghijklmnopqrstuvwxyz";
static std::default_random_engine generator(
Expand All @@ -111,6 +113,8 @@ std::string random_debug_key() {
return key;
}

} // namespace

ProtoStruct debug_map() {
return debug_map(random_debug_key());
}
Expand Down
4 changes: 4 additions & 0 deletions src/viam/sdk/common/version_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ std::string sdk_version() {
return result;
}

namespace {

int get_sub_version(int which) {
static const std::array<int, 3> components = [] {
std::array<int, 3> result;
Expand All @@ -38,6 +40,8 @@ int get_sub_version(int which) {
return components[which];
}

} // namespace

int sdk_major_version() {
return get_sub_version(0);
}
Expand Down
Loading