From 720711be8bd47552507aca11769123870189ed66 Mon Sep 17 00:00:00 2001 From: Stephen DeRosa Date: Thu, 9 Apr 2026 13:41:40 -0600 Subject: [PATCH 1/4] GHS Docker: set cpp-examples-collection to latest commit --- .github/workflows/builds.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 1a7dfef..af29692 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -353,7 +353,7 @@ jobs: 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 + git checkout f231c0c75028d1dcf13edcecd369d030d2c7c8d4 cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk cmake --build build --parallel ' @@ -378,7 +378,7 @@ jobs: 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 + git checkout f231c0c75028d1dcf13edcecd369d030d2c7c8d4 cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk cmake --build build --parallel ' From 87b12c65f1f48e562b6101a65d221ba39b0cb717 Mon Sep 17 00:00:00 2001 From: Stephen DeRosa Date: Thu, 9 Apr 2026 16:24:08 -0600 Subject: [PATCH 2/4] docker buildx --- .github/workflows/builds.yml | 28 +++++++++++++++++ docker/Dockerfile | 58 ++++++++++++++++++++++++++++++++++-- 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index af29692..16f6ebc 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -266,6 +266,17 @@ jobs: submodules: recursive fetch-depth: 0 + - name: Free disk space (GitHub-hosted runner) + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -283,6 +294,9 @@ jobs: docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -c \ 'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake' + - name: Prune BuildKit cache + run: docker buildx prune -af + - name: Save Docker image artifact run: | docker save livekit-cpp-sdk-x64:${{ github.sha }} | gzip > livekit-cpp-sdk-x64-docker.tar.gz @@ -305,6 +319,17 @@ jobs: submodules: recursive fetch-depth: 0 + - name: Free disk space (GitHub-hosted runner) + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -322,6 +347,9 @@ jobs: docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -c \ 'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake' + - name: Prune BuildKit cache + run: docker buildx prune -af + - name: Save Docker image artifact run: | docker save livekit-cpp-sdk:${{ github.sha }} | gzip > livekit-cpp-sdk-arm64-docker.tar.gz diff --git a/docker/Dockerfile b/docker/Dockerfile index ccdc1c7..0942462 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,7 +18,7 @@ # Run with: # docker run -it --network host livekit-cpp-sdk:latest bash -FROM ubuntu:22.04 +FROM ubuntu:22.04 AS builder ENV DEBIAN_FRONTEND=noninteractive ENV HOME=/root @@ -122,8 +122,6 @@ COPY examples /client-sdk-cpp/examples COPY cmake /client-sdk-cpp/cmake COPY CMakeLists.txt /client-sdk-cpp/CMakeLists.txt COPY build.h.in /client-sdk-cpp/build.h.in -COPY build.sh /client-sdk-cpp/build.sh -COPY build.cmd /client-sdk-cpp/build.cmd # Configure Rust linker: use full GCC path so liblto_plugin.so is found (not /home/installs/ which has no plugin) RUN mkdir -p /client-sdk-cpp/client-sdk-rust/.cargo \ @@ -140,3 +138,57 @@ RUN LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \ && cd /client-sdk-cpp \ && ./build.sh release --bundle --prefix "${SDK_INSTALL_PREFIX}" \ && test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake" + +# Flatten GCC install lib dirs (amd64 uses lib64; some targets use only lib/) +# so the runtime stage can COPY a single path. +RUN mkdir -p /root/gcc14-for-runtime \ + && if [ -d /root/gcc-14/lib64 ]; then cp -a /root/gcc-14/lib64/. /root/gcc14-for-runtime/; fi \ + && if [ -d /root/gcc-14/lib ]; then cp -a /root/gcc-14/lib/. /root/gcc14-for-runtime/; fi + +# ----------------------------------------------------------------------------- +# Runtime image: installed SDK + deps to build/run downstream apps (e.g. +# cpp-example-collection). Omits Rust, the full GCC 14 build tree, CMake in +# $HOME, and /client-sdk-cpp sources — large reduction vs. single-stage. +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV HOME=/root +ENV SDK_INSTALL_PREFIX=/opt/livekit-sdk +# Prebuilt Rust/C++ artifacts were linked with GCC 14’s libstdc++; ship those +# DSOs without the full compiler prefix. +ENV LD_LIBRARY_PATH=/opt/livekit-gcc14-lib + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + curl \ + git \ + libabsl-dev \ + libasound2-dev \ + libdecor-0-dev \ + libdrm-dev \ + libgl1-mesa-dev \ + libprotobuf-dev \ + libspdlog-dev \ + libssl-dev \ + libva-dev \ + libwayland-dev \ + libx11-dev \ + libxcursor-dev \ + libxext-dev \ + libxfixes-dev \ + libxi-dev \ + libxrandr-dev \ + ninja-build \ + pkg-config \ + protobuf-compiler \ + wget \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /opt/livekit-sdk /opt/livekit-sdk +COPY --from=builder /root/gcc14-for-runtime /opt/livekit-gcc14-lib + +WORKDIR /root + +RUN test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake" From 41de357a1d71d8e05ae611b09bdd27acdb03cbb4 Mon Sep 17 00:00:00 2001 From: Stephen DeRosa Date: Thu, 9 Apr 2026 17:07:43 -0600 Subject: [PATCH 3/4] fix gcc install dir --- docker/Dockerfile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0942462..ac39f9d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -139,24 +139,23 @@ RUN LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \ && ./build.sh release --bundle --prefix "${SDK_INSTALL_PREFIX}" \ && test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake" -# Flatten GCC install lib dirs (amd64 uses lib64; some targets use only lib/) -# so the runtime stage can COPY a single path. -RUN mkdir -p /root/gcc14-for-runtime \ - && if [ -d /root/gcc-14/lib64 ]; then cp -a /root/gcc-14/lib64/. /root/gcc14-for-runtime/; fi \ - && if [ -d /root/gcc-14/lib ]; then cp -a /root/gcc-14/lib/. /root/gcc14-for-runtime/; fi - # ----------------------------------------------------------------------------- # Runtime image: installed SDK + deps to build/run downstream apps (e.g. -# cpp-example-collection). Omits Rust, the full GCC 14 build tree, CMake in -# $HOME, and /client-sdk-cpp sources — large reduction vs. single-stage. +# cpp-example-collection). Omits Rust, CMake in $HOME, and /client-sdk-cpp +# sources. Ships the full GCC 14 *install* prefix (not the GCC source tree) so +# downstream links use the same libstdc++ as liblivekit.so (GLIBCXX_3.4.32+). FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive ENV HOME=/root ENV SDK_INSTALL_PREFIX=/opt/livekit-sdk -# Prebuilt Rust/C++ artifacts were linked with GCC 14’s libstdc++; ship those -# DSOs without the full compiler prefix. -ENV LD_LIBRARY_PATH=/opt/livekit-gcc14-lib + +COPY --from=builder /root/gcc-14 /opt/gcc-14 + +ENV PATH=/opt/gcc-14/bin:$PATH +ENV CC=/opt/gcc-14/bin/gcc +ENV CXX=/opt/gcc-14/bin/g++ +ENV LD_LIBRARY_PATH=/opt/gcc-14/lib64:/opt/gcc-14/lib RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ @@ -187,7 +186,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /opt/livekit-sdk /opt/livekit-sdk -COPY --from=builder /root/gcc14-for-runtime /opt/livekit-gcc14-lib WORKDIR /root From 68f0086bb85df449d16aaed8bc01a6d4dab6b0d9 Mon Sep 17 00:00:00 2001 From: Stephen DeRosa Date: Thu, 9 Apr 2026 17:08:47 -0600 Subject: [PATCH 4/4] restore docker file to no buildx, free disk space before builds --- .github/workflows/builds.yml | 6 ---- docker/Dockerfile | 56 ++---------------------------------- 2 files changed, 3 insertions(+), 59 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 16f6ebc..7b1c51f 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -294,9 +294,6 @@ jobs: docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -c \ 'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake' - - name: Prune BuildKit cache - run: docker buildx prune -af - - name: Save Docker image artifact run: | docker save livekit-cpp-sdk-x64:${{ github.sha }} | gzip > livekit-cpp-sdk-x64-docker.tar.gz @@ -347,9 +344,6 @@ jobs: docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -c \ 'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake' - - name: Prune BuildKit cache - run: docker buildx prune -af - - name: Save Docker image artifact run: | docker save livekit-cpp-sdk:${{ github.sha }} | gzip > livekit-cpp-sdk-arm64-docker.tar.gz diff --git a/docker/Dockerfile b/docker/Dockerfile index ac39f9d..ccdc1c7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,7 +18,7 @@ # Run with: # docker run -it --network host livekit-cpp-sdk:latest bash -FROM ubuntu:22.04 AS builder +FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive ENV HOME=/root @@ -122,6 +122,8 @@ COPY examples /client-sdk-cpp/examples COPY cmake /client-sdk-cpp/cmake COPY CMakeLists.txt /client-sdk-cpp/CMakeLists.txt COPY build.h.in /client-sdk-cpp/build.h.in +COPY build.sh /client-sdk-cpp/build.sh +COPY build.cmd /client-sdk-cpp/build.cmd # Configure Rust linker: use full GCC path so liblto_plugin.so is found (not /home/installs/ which has no plugin) RUN mkdir -p /client-sdk-cpp/client-sdk-rust/.cargo \ @@ -138,55 +140,3 @@ RUN LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \ && cd /client-sdk-cpp \ && ./build.sh release --bundle --prefix "${SDK_INSTALL_PREFIX}" \ && test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake" - -# ----------------------------------------------------------------------------- -# Runtime image: installed SDK + deps to build/run downstream apps (e.g. -# cpp-example-collection). Omits Rust, CMake in $HOME, and /client-sdk-cpp -# sources. Ships the full GCC 14 *install* prefix (not the GCC source tree) so -# downstream links use the same libstdc++ as liblivekit.so (GLIBCXX_3.4.32+). -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV HOME=/root -ENV SDK_INSTALL_PREFIX=/opt/livekit-sdk - -COPY --from=builder /root/gcc-14 /opt/gcc-14 - -ENV PATH=/opt/gcc-14/bin:$PATH -ENV CC=/opt/gcc-14/bin/gcc -ENV CXX=/opt/gcc-14/bin/g++ -ENV LD_LIBRARY_PATH=/opt/gcc-14/lib64:/opt/gcc-14/lib - -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - libabsl-dev \ - libasound2-dev \ - libdecor-0-dev \ - libdrm-dev \ - libgl1-mesa-dev \ - libprotobuf-dev \ - libspdlog-dev \ - libssl-dev \ - libva-dev \ - libwayland-dev \ - libx11-dev \ - libxcursor-dev \ - libxext-dev \ - libxfixes-dev \ - libxi-dev \ - libxrandr-dev \ - ninja-build \ - pkg-config \ - protobuf-compiler \ - wget \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=builder /opt/livekit-sdk /opt/livekit-sdk - -WORKDIR /root - -RUN test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake"