Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 113 additions & 4 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ on:
- .github/workflows/**
workflow_dispatch:

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
# vcpkg binary caching for Windows
Expand Down Expand Up @@ -252,7 +255,7 @@ jobs:
./build.sh clean-all || true
fi

docker-build:
docker-build-x64:
name: Build (docker-linux-x64)
runs-on: ubuntu-latest

Expand All @@ -267,9 +270,115 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: docker build -t livekit-cpp-sdk:${{ github.sha }} . -f docker/Dockerfile
run: |
docker buildx build \
--platform linux/amd64 \
--load \
-t livekit-cpp-sdk-x64:${{ github.sha }} \
. \
-f docker/Dockerfile

- name: Verify installed SDK inside image
run: |
docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -c \
'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake'

- name: Build SDK inside Docker
- name: Save Docker image artifact
run: |
docker save livekit-cpp-sdk-x64:${{ github.sha }} | gzip > livekit-cpp-sdk-x64-docker.tar.gz

- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: livekit-cpp-sdk-docker-x64
path: livekit-cpp-sdk-x64-docker.tar.gz
retention-days: 7

docker-build-linux-arm64:
name: Build (docker-linux-arm64)
runs-on: ubuntu-24.04-arm

steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker buildx build \
--platform linux/arm64 \
--load \
-t livekit-cpp-sdk:${{ github.sha }} \
. \
-f docker/Dockerfile

- name: Verify installed SDK inside image
run: |
docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -c \
'cd /client-sdk-cpp && chmod +x build.sh && ./build.sh release-examples'
'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake'

- name: Save Docker image artifact
run: |
docker save livekit-cpp-sdk:${{ github.sha }} | gzip > livekit-cpp-sdk-arm64-docker.tar.gz

- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: livekit-cpp-sdk-docker-arm64
path: livekit-cpp-sdk-arm64-docker.tar.gz
retention-days: 7

build-collections-linux-arm64:
name: Build (cpp-example-collection-linux-arm64)
runs-on: ubuntu-24.04-arm
needs: docker-build-linux-arm64

steps:
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: livekit-cpp-sdk-docker-arm64

- name: Load Docker image
run: gzip -dc livekit-cpp-sdk-arm64-docker.tar.gz | docker load

- name: Build cpp-example-collection against installed SDK
run: |
docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -lc '
set -euxo pipefail
git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection
cd /tmp/cpp-example-collection
git checkout sderosa/examples-migration
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
cmake --build build --parallel
'

build-collections-x64:
name: Build (cpp-example-collection-x64)
runs-on: ubuntu-latest
needs: docker-build-x64

steps:
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: livekit-cpp-sdk-docker-x64

- name: Load Docker image
run: gzip -dc livekit-cpp-sdk-x64-docker.tar.gz | docker load

- name: Build cpp-example-collection against installed SDK
run: |
docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -lc '
set -euxo pipefail
git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection
cd /tmp/cpp-example-collection
git checkout sderosa/examples-migration
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
cmake --build build --parallel
'
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ target_include_directories(livekit

target_link_libraries(livekit
PUBLIC
$<BUILD_INTERFACE:spdlog::spdlog>
spdlog::spdlog
PRIVATE
livekit_ffi
${LIVEKIT_PROTOBUF_TARGET}
Expand Down
2 changes: 1 addition & 1 deletion cmake/spdlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FetchContent_Declare(
set(SPDLOG_BUILD_SHARED OFF CACHE BOOL "" FORCE)
set(SPDLOG_BUILD_EXAMPLE OFF CACHE BOOL "" FORCE)
set(SPDLOG_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SPDLOG_INSTALL OFF CACHE BOOL "" FORCE)
set(SPDLOG_INSTALL ON CACHE BOOL "" FORCE)
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Setting SPDLOG_INSTALL to ON will make the vendored spdlog subproject participate in the parent install step (installing its headers/CMake package). This can be surprising when LiveKit is consumed via add_subdirectory and can also reintroduce the kind of subproject install/export issues you explicitly disabled for vendored protobuf/abseil (cmake/protobuf.cmake notes this to avoid export-set errors). Consider gating this with LIVEKIT_IS_TOPLEVEL (or introducing a LIVEKIT_INSTALL_DEPS option) so dependency installs only happen for the standalone SDK bundle use case.

Suggested change
set(SPDLOG_INSTALL ON CACHE BOOL "" FORCE)
if(LIVEKIT_IS_TOPLEVEL)
# When building LiveKit as the top-level project, allow vendored spdlog to install
set(SPDLOG_INSTALL ON CACHE BOOL "" FORCE)
else()
# When LiveKit is consumed as a subproject, avoid installing vendored spdlog
set(SPDLOG_INSTALL OFF CACHE BOOL "" FORCE)
endif()

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had been of the thought that we should package spdlog with our SW to enable our logging macros (very useful) out of the box. But do we think we should require applications to explicitly install and link their app against us + spdlog? curious on your experience here @xianshijing-lk


FetchContent_MakeAvailable(livekit_spdlog)

Expand Down
18 changes: 18 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,33 @@ FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/root
ENV SDK_INSTALL_PREFIX=/opt/livekit-sdk

# Install make, pkg-config, and base build deps (pkg-config + libglib2.0-dev for Rust glib-sys, libasound2-dev for alsa-sys)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
libasound2-dev \
libabsl-dev \
libclang-dev \
libdrm-dev \
libglib2.0-dev \
libprotobuf-dev \
libdecor-0-dev \
libspdlog-dev \
libssl-dev \
libunwind-dev \
libusb-1.0-0-dev \
libva-dev \
libwayland-dev \
make \
ninja-build \
pkg-config \
protobuf-compiler \
wget \
llvm-dev \
clang \
xz-utils \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -122,3 +130,13 @@ RUN mkdir -p /client-sdk-cpp/client-sdk-rust/.cargo \
&& printf '%s\n' '[target.x86_64-unknown-linux-gnu]' 'linker = "/root/gcc-14/bin/g++"' \
'[target.aarch64-unknown-linux-gnu]' 'linker = "/root/gcc-14/bin/g++"' > /client-sdk-cpp/client-sdk-rust/.cargo/config.toml

# Build and install the SDK into a fixed prefix so downstream projects can
# consume the image as a prebuilt LiveKit SDK environment.
RUN LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \
&& export LIBCLANG_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib" \
&& export CXXFLAGS="-Wno-deprecated-declarations" \
&& export CFLAGS="-Wno-deprecated-declarations" \
&& chmod +x /client-sdk-cpp/build.sh \
&& cd /client-sdk-cpp \
&& ./build.sh release --bundle --prefix "${SDK_INSTALL_PREFIX}" \
&& test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake"
Loading