From 5e5a41b3082b8fc95f654e5447b21b5f6cd970d3 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 7 Apr 2026 22:51:41 -0600 Subject: [PATCH 01/28] Add clang-tidy in GHA CI --- .clang-tidy | 21 ++++++++++++ .github/workflows/builds.yml | 62 ++++++++++++++++++++++++++++++++++++ compile_commands.json | 1 + 3 files changed, 84 insertions(+) create mode 100644 .clang-tidy create mode 120000 compile_commands.json diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..855e151 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,21 @@ +Checks: > + -*, + bugprone-*, + performance-*, + modernize-*, + readability-braces-around-statements, + readability-misleading-indentation, + readability-redundant-smartptr-get, + -modernize-use-trailing-return-type, + -modernize-avoid-c-arrays, + -bugprone-easily-swappable-parameters + +WarningsAsErrors: '' + +HeaderFilterRegex: '(include/livekit|src|bridge/(include|src)|examples)' + +FormatStyle: file + +CheckOptions: + - key: modernize-use-nullptr.NullMacros + value: 'NULL' diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 1a7dfef..89e1fc5 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -244,6 +244,16 @@ jobs: ${{ matrix.build_dir }}/bin/ retention-days: 7 + - name: Upload compile database (for clang-tidy) + if: matrix.name == 'linux-x64' + uses: actions/upload-artifact@v4 + with: + name: compile-database + path: | + ${{ matrix.build_dir }}/compile_commands.json + ${{ matrix.build_dir }}/generated/ + retention-days: 1 + # ---------- Cleanup ---------- - name: Clean after build (best-effort) if: always() @@ -382,3 +392,55 @@ jobs: cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk cmake --build build --parallel ' + + clang-tidy: + name: clang-tidy + needs: build + runs-on: ubuntu-latest + continue-on-error: true + if: ${{ !cancelled() }} + + steps: + - name: Checkout (with submodules) + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Install dependencies + run: | + set -eux + sudo apt-get update + sudo apt-get install -y \ + clang-tidy \ + llvm-dev libclang-dev clang \ + libssl-dev \ + libprotobuf-dev protobuf-compiler \ + libabsl-dev \ + libspdlog-dev \ + libva-dev libdrm-dev libgbm-dev libx11-dev libgl1-mesa-dev \ + libxext-dev libxcomposite-dev libxdamage-dev libxfixes-dev \ + libxrandr-dev libxi-dev libxkbcommon-dev \ + libasound2-dev libpulse-dev \ + libwayland-dev libdecor-0-dev + + - name: Download compile database + uses: actions/download-artifact@v4 + with: + name: compile-database + path: build-release/ + + - name: Collect source files + run: | + find src/ bridge/src/ examples/ \ + -name '*.cpp' -not -path '*/tests/*' \ + | sort -u > /tmp/tidy-files.txt + echo "Files to analyze ($(wc -l < /tmp/tidy-files.txt)):" + cat /tmp/tidy-files.txt + + - name: Run clang-tidy + run: | + run-clang-tidy \ + -p build-release \ + -header-filter='(include/livekit|src|bridge/(include|src)|examples)' \ + $(cat /tmp/tidy-files.txt) diff --git a/compile_commands.json b/compile_commands.json new file mode 120000 index 0000000..5a5ec6c --- /dev/null +++ b/compile_commands.json @@ -0,0 +1 @@ +build-release/compile_commands.json \ No newline at end of file From 5e2268f46be6b1b8de672f9d52dc7648d5794064 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 7 Apr 2026 22:51:41 -0600 Subject: [PATCH 02/28] Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/builds.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 89e1fc5..93e5756 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -35,6 +35,8 @@ on: permissions: contents: read + actions: read + packages: read env: CARGO_TERM_COLOR: always From a584b27fbbac50fd74d7ed187ac21c85e1147328 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 7 Apr 2026 22:51:42 -0600 Subject: [PATCH 03/28] Remove compile commands --- compile_commands.json | 1 - 1 file changed, 1 deletion(-) delete mode 120000 compile_commands.json diff --git a/compile_commands.json b/compile_commands.json deleted file mode 120000 index 5a5ec6c..0000000 --- a/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -build-release/compile_commands.json \ No newline at end of file From 918a2c0b87e7b5be7855ab5a3cdcb4343ca60048 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 7 Apr 2026 22:51:42 -0600 Subject: [PATCH 04/28] Possibly fix pathing --- .github/workflows/builds.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 93e5756..472901a 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -430,7 +430,13 @@ jobs: uses: actions/download-artifact@v4 with: name: compile-database - path: build-release/ + + - name: Verify compile database + run: | + echo "Artifact contents:" + find build-release/ -type f | head -20 + test -f build-release/compile_commands.json + echo "compile_commands.json found ($(wc -l < build-release/compile_commands.json) lines)" - name: Collect source files run: | From e65e8ab599238470b426d94e206290401617f791 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 09:40:50 -0600 Subject: [PATCH 05/28] Rebase and optimize build for debugging --- .github/workflows/builds.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 472901a..4a9a34f 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -55,22 +55,22 @@ jobs: name: linux-x64 build_cmd: ./build.sh release-examples build_dir: build-release - - os: ubuntu-24.04-arm - name: linux-arm64 - build_cmd: ./build.sh release-examples - build_dir: build-release - - os: macos-latest - name: macos-arm64 - build_cmd: ./build.sh release-examples - build_dir: build-release - - os: macos-latest - name: macos-x64 - build_cmd: ./build.sh release-examples --macos-arch x86_64 - build_dir: build-release - - os: windows-latest - name: windows-x64 - build_cmd: .\build.cmd release-examples - build_dir: build-release + # - os: ubuntu-24.04-arm + # name: linux-arm64 + # build_cmd: ./build.sh release-examples + # build_dir: build-release + # - os: macos-latest + # name: macos-arm64 + # build_cmd: ./build.sh release-examples + # build_dir: build-release + # - os: macos-latest + # name: macos-x64 + # build_cmd: ./build.sh release-examples --macos-arch x86_64 + # build_dir: build-release + # - os: windows-latest + # name: windows-x64 + # build_cmd: .\build.cmd release-examples + # build_dir: build-release name: Build (${{ matrix.name }}) runs-on: ${{ matrix.os }} From 99081abb75b2ac970c6d61968cbb4f91ab2cfced Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 11:04:44 -0600 Subject: [PATCH 06/28] Debugging clang stage --- .github/workflows/builds.yml | 37 +++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 4a9a34f..123a30c 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -246,6 +246,16 @@ jobs: ${{ matrix.build_dir }}/bin/ retention-days: 7 + - name: Debug compile database before upload + if: matrix.name == 'linux-x64' + run: | + echo "=== Files to be uploaded ===" + echo "build_dir=${{ matrix.build_dir }}" + ls -la ${{ matrix.build_dir }}/compile_commands.json || echo "compile_commands.json NOT FOUND" + echo "Generated headers:" + ls -la ${{ matrix.build_dir }}/generated/*.pb.h 2>/dev/null | head -5 || echo "No .pb.h files found" + echo "Generated header count: $(find ${{ matrix.build_dir }}/generated -name '*.pb.h' 2>/dev/null | wc -l)" + - name: Upload compile database (for clang-tidy) if: matrix.name == 'linux-x64' uses: actions/upload-artifact@v4 @@ -430,13 +440,30 @@ jobs: uses: actions/download-artifact@v4 with: name: compile-database + path: build-release/ - - name: Verify compile database + - name: Debug download artifact layout run: | - echo "Artifact contents:" - find build-release/ -type f | head -20 - test -f build-release/compile_commands.json - echo "compile_commands.json found ($(wc -l < build-release/compile_commands.json) lines)" + echo "=== Workspace root ===" + ls -la + echo "" + echo "=== build-release/ contents ===" + find build-release/ -type f 2>/dev/null | head -30 || echo "build-release/ directory NOT FOUND" + echo "" + echo "=== Looking for compile_commands.json anywhere ===" + find . -name 'compile_commands.json' -not -path './.git/*' 2>/dev/null + echo "" + echo "=== Looking for .pb.h anywhere ===" + find . -name '*.pb.h' -not -path './.git/*' 2>/dev/null | head -5 + echo "" + if [ -f build-release/compile_commands.json ]; then + echo "SUCCESS: build-release/compile_commands.json found ($(wc -l < build-release/compile_commands.json) lines)" + else + echo "FAIL: build-release/compile_commands.json not found" + echo "Trying without build-release/ prefix:" + ls -la compile_commands.json 2>/dev/null || echo " Not at workspace root either" + exit 1 + fi - name: Collect source files run: | From 36e91108b0ce6c28feaffd5a6f0ec6d84c84d9e6 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 11:57:48 -0600 Subject: [PATCH 07/28] Remove debug output --- .github/workflows/builds.yml | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 123a30c..8f7aee6 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -441,30 +441,7 @@ jobs: with: name: compile-database path: build-release/ - - - name: Debug download artifact layout - run: | - echo "=== Workspace root ===" - ls -la - echo "" - echo "=== build-release/ contents ===" - find build-release/ -type f 2>/dev/null | head -30 || echo "build-release/ directory NOT FOUND" - echo "" - echo "=== Looking for compile_commands.json anywhere ===" - find . -name 'compile_commands.json' -not -path './.git/*' 2>/dev/null - echo "" - echo "=== Looking for .pb.h anywhere ===" - find . -name '*.pb.h' -not -path './.git/*' 2>/dev/null | head -5 - echo "" - if [ -f build-release/compile_commands.json ]; then - echo "SUCCESS: build-release/compile_commands.json found ($(wc -l < build-release/compile_commands.json) lines)" - else - echo "FAIL: build-release/compile_commands.json not found" - echo "Trying without build-release/ prefix:" - ls -la compile_commands.json 2>/dev/null || echo " Not at workspace root either" - exit 1 - fi - + - name: Collect source files run: | find src/ bridge/src/ examples/ \ From 85caa49b269630d97eaae9eb6da97d224bcf36b3 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 12:09:32 -0600 Subject: [PATCH 08/28] Try cpplinter stage instead --- .github/workflows/builds.yml | 52 +++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 8f7aee6..809e59c 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -246,16 +246,6 @@ jobs: ${{ matrix.build_dir }}/bin/ retention-days: 7 - - name: Debug compile database before upload - if: matrix.name == 'linux-x64' - run: | - echo "=== Files to be uploaded ===" - echo "build_dir=${{ matrix.build_dir }}" - ls -la ${{ matrix.build_dir }}/compile_commands.json || echo "compile_commands.json NOT FOUND" - echo "Generated headers:" - ls -la ${{ matrix.build_dir }}/generated/*.pb.h 2>/dev/null | head -5 || echo "No .pb.h files found" - echo "Generated header count: $(find ${{ matrix.build_dir }}/generated -name '*.pb.h' 2>/dev/null | wc -l)" - - name: Upload compile database (for clang-tidy) if: matrix.name == 'linux-x64' uses: actions/upload-artifact@v4 @@ -411,6 +401,9 @@ jobs: runs-on: ubuntu-latest continue-on-error: true if: ${{ !cancelled() }} + permissions: + contents: read + pull-requests: write steps: - name: Checkout (with submodules) @@ -441,18 +434,33 @@ jobs: with: name: compile-database path: build-release/ - - - name: Collect source files - run: | - find src/ bridge/src/ examples/ \ - -name '*.cpp' -not -path '*/tests/*' \ - | sort -u > /tmp/tidy-files.txt - echo "Files to analyze ($(wc -l < /tmp/tidy-files.txt)):" - cat /tmp/tidy-files.txt - name: Run clang-tidy + uses: cpp-linter/cpp-linter-action@v2 + id: linter + with: + style: '' + tidy-checks: '' + database: build-release + files-changed-only: true + lines-changed-only: false + ignore: 'build-*|client-sdk-rust|vcpkg_installed' + file-annotations: true + thread-comments: update + step-summary: true + tidy-review: true + passive-reviews: true + no-lgtm: true + version: '' + + - name: Check warning thresholds + env: + TIDY_FINDINGS: ${{ steps.linter.outputs.clang-tidy-checks-failed }} + MAX_TIDY_FINDINGS: '0' run: | - run-clang-tidy \ - -p build-release \ - -header-filter='(include/livekit|src|bridge/(include|src)|examples)' \ - $(cat /tmp/tidy-files.txt) + echo "clang-tidy findings: ${TIDY_FINDINGS}" + if [ "${TIDY_FINDINGS}" -gt "${MAX_TIDY_FINDINGS}" ]; then + echo "::warning::clang-tidy found ${TIDY_FINDINGS} issue(s), threshold is ${MAX_TIDY_FINDINGS}" + exit 1 + fi + echo "clang-tidy findings within threshold" From cce7d8ba09f23092e8a88762646d5ce72cd547c3 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 16:33:44 -0600 Subject: [PATCH 09/28] Hopefully fix clang issue --- .github/workflows/builds.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 809e59c..05f0884 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -451,7 +451,6 @@ jobs: tidy-review: true passive-reviews: true no-lgtm: true - version: '' - name: Check warning thresholds env: From cccbc74cc00dbe59ca779d5dccba8ebd35342ce3 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 16:56:36 -0600 Subject: [PATCH 10/28] Add github token --- .github/workflows/builds.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 05f0884..cb8c0ff 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -438,6 +438,8 @@ jobs: - name: Run clang-tidy uses: cpp-linter/cpp-linter-action@v2 id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: style: '' tidy-checks: '' From 72c2fe469e51021ffa0df368899fd6e1470efd47 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 17:40:21 -0600 Subject: [PATCH 11/28] Turn files changed only off --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index cb8c0ff..e0ec9ae 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -444,7 +444,7 @@ jobs: style: '' tidy-checks: '' database: build-release - files-changed-only: true + files-changed-only: false lines-changed-only: false ignore: 'build-*|client-sdk-rust|vcpkg_installed' file-annotations: true From 8aa951d56230e20a5d321d1bee2cdf6ce84b2343 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 20:45:53 -0600 Subject: [PATCH 12/28] New clang-tidy error list for the critical stuff --- .clang-tidy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 855e151..8fee8e5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -10,7 +10,16 @@ Checks: > -modernize-avoid-c-arrays, -bugprone-easily-swappable-parameters -WarningsAsErrors: '' +WarningsAsErrors: > + bugprone-use-after-move, + bugprone-dangling-handle, + bugprone-undefined-memory-manipulation, + bugprone-move-forwarding-reference, + bugprone-incorrect-roundings, + bugprone-sizeof-expression, + bugprone-string-literal-with-embedded-nul, + bugprone-suspicious-memset-usage, + bugprone-infinite-loop HeaderFilterRegex: '(include/livekit|src|bridge/(include|src)|examples)' From 65d923e03c670049f3bb76db2586f8eeea10bddb Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 21:27:16 -0600 Subject: [PATCH 13/28] Adjustments to clang-tidy checks --- .clang-tidy | 9 +++++++-- .github/workflows/builds.yml | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 8fee8e5..ba581b4 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,23 +3,28 @@ Checks: > bugprone-*, performance-*, modernize-*, - readability-braces-around-statements, readability-misleading-indentation, readability-redundant-smartptr-get, -modernize-use-trailing-return-type, -modernize-avoid-c-arrays, -bugprone-easily-swappable-parameters + # Suppressing spammy ones for now + -modernize-use-nodiscard, + -readability-braces-around-statements, +# These warnings have determined to be critical and are as such treated as errors WarningsAsErrors: > + clang-analyzer-*, bugprone-use-after-move, bugprone-dangling-handle, + bugprone-infinite-loop, + bugprone-narrowing-conversions, bugprone-undefined-memory-manipulation, bugprone-move-forwarding-reference, bugprone-incorrect-roundings, bugprone-sizeof-expression, bugprone-string-literal-with-embedded-nul, bugprone-suspicious-memset-usage, - bugprone-infinite-loop HeaderFilterRegex: '(include/livekit|src|bridge/(include|src)|examples)' diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index e0ec9ae..62b1fb7 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -399,7 +399,7 @@ jobs: name: clang-tidy needs: build runs-on: ubuntu-latest - continue-on-error: true + continue-on-error: false if: ${{ !cancelled() }} permissions: contents: read @@ -457,7 +457,7 @@ jobs: - name: Check warning thresholds env: TIDY_FINDINGS: ${{ steps.linter.outputs.clang-tidy-checks-failed }} - MAX_TIDY_FINDINGS: '0' + MAX_TIDY_FINDINGS: '396' run: | echo "clang-tidy findings: ${TIDY_FINDINGS}" if [ "${TIDY_FINDINGS}" -gt "${MAX_TIDY_FINDINGS}" ]; then From 45b9e5b42e46996a7478f38d548842d2a6405691 Mon Sep 17 00:00:00 2001 From: Alan George Date: Thu, 9 Apr 2026 12:46:15 -0600 Subject: [PATCH 14/28] Fix one introduce another --- bridge/src/bridge_audio_track.cpp | 6 +++++- src/ffi_client.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bridge/src/bridge_audio_track.cpp b/bridge/src/bridge_audio_track.cpp index 5816cfc..0e93581 100644 --- a/bridge/src/bridge_audio_track.cpp +++ b/bridge/src/bridge_audio_track.cpp @@ -38,7 +38,11 @@ BridgeAudioTrack::BridgeAudioTrack( : name_(std::move(name)), sample_rate_(sample_rate), num_channels_(num_channels), source_(std::move(source)), track_(std::move(track)), publication_(std::move(publication)), - participant_(participant) {} + participant_(participant) { + std::cout << "Bad name use: " << name << "\n"; // Should invoke clang-tidy warning + + while(true); // should invoke another warning + } BridgeAudioTrack::~BridgeAudioTrack() { release(); } diff --git a/src/ffi_client.cpp b/src/ffi_client.cpp index 9c20691..82f4d1c 100644 --- a/src/ffi_client.cpp +++ b/src/ffi_client.cpp @@ -244,7 +244,7 @@ void FfiClient::PushEvent(const proto::FfiEvent &event) const { void LivekitFfiCallback(const uint8_t *buf, size_t len) { proto::FfiEvent event; - event.ParseFromArray(buf, len); + event.ParseFromArray(buf, static_cast(len)); // TODO: this fixes for now, what if len exceeds int? FfiClient::instance().PushEvent(event); } From 357b85fe9395cb082b6f0b26f2b667a2d086de9f Mon Sep 17 00:00:00 2001 From: Alan George Date: Thu, 9 Apr 2026 16:07:45 -0600 Subject: [PATCH 15/28] Cleanup clang file --- .clang-tidy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index ba581b4..5171352 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,14 +3,13 @@ Checks: > bugprone-*, performance-*, modernize-*, + -readability-braces-around-statements, readability-misleading-indentation, readability-redundant-smartptr-get, -modernize-use-trailing-return-type, -modernize-avoid-c-arrays, - -bugprone-easily-swappable-parameters - # Suppressing spammy ones for now -modernize-use-nodiscard, - -readability-braces-around-statements, + -bugprone-easily-swappable-parameters # These warnings have determined to be critical and are as such treated as errors WarningsAsErrors: > From be4d8a46a6e3107dc57d5ec5d21188fc744222c1 Mon Sep 17 00:00:00 2001 From: Alan George Date: Fri, 10 Apr 2026 13:45:04 -0600 Subject: [PATCH 16/28] Revert bridge_audio_track change that induced clang-tidy --- bridge/src/bridge_audio_track.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bridge/src/bridge_audio_track.cpp b/bridge/src/bridge_audio_track.cpp index 0e93581..5816cfc 100644 --- a/bridge/src/bridge_audio_track.cpp +++ b/bridge/src/bridge_audio_track.cpp @@ -38,11 +38,7 @@ BridgeAudioTrack::BridgeAudioTrack( : name_(std::move(name)), sample_rate_(sample_rate), num_channels_(num_channels), source_(std::move(source)), track_(std::move(track)), publication_(std::move(publication)), - participant_(participant) { - std::cout << "Bad name use: " << name << "\n"; // Should invoke clang-tidy warning - - while(true); // should invoke another warning - } + participant_(participant) {} BridgeAudioTrack::~BridgeAudioTrack() { release(); } From 13e99482c4066e7a2713b76829fb6121caee4d9d Mon Sep 17 00:00:00 2001 From: Alan George Date: Mon, 13 Apr 2026 19:05:05 -0600 Subject: [PATCH 17/28] Modernize namespaces --- bridge/include/livekit_bridge/rpc_constants.h | 15 ++------------- bridge/src/rpc_constants.cpp | 8 ++------ .../integration/test_bridge_rpc_roundtrip.cpp | 6 ++---- bridge/tests/test_bridge_audio_track.cpp | 6 ++---- bridge/tests/test_bridge_video_track.cpp | 6 ++---- bridge/tests/test_livekit_bridge.cpp | 6 ++---- bridge/tests/test_rpc_controller.cpp | 6 ++---- src/lk_log.h | 6 ++---- src/tests/common/audio_utils.h | 6 ++---- src/tests/common/test_common.h | 6 ++---- src/tests/common/video_utils.h | 6 ++---- src/tests/integration/test_audio_frame.cpp | 6 ++---- .../integration/test_audio_processing_module.cpp | 6 ++---- src/tests/integration/test_data_track.cpp | 6 ++---- src/tests/integration/test_logging.cpp | 6 ++---- src/tests/integration/test_media_multistream.cpp | 6 ++---- src/tests/integration/test_room.cpp | 6 ++---- src/tests/integration/test_rpc.cpp | 6 ++---- src/tests/integration/test_sdk_initialization.cpp | 6 ++---- src/tests/stress/test_audio_frame_stress.cpp | 6 ++---- src/tests/stress/test_latency_measurement.cpp | 6 ++---- src/tests/stress/test_room_stress.cpp | 6 ++---- src/tests/stress/test_rpc_stress.cpp | 6 ++---- 23 files changed, 46 insertions(+), 103 deletions(-) diff --git a/bridge/include/livekit_bridge/rpc_constants.h b/bridge/include/livekit_bridge/rpc_constants.h index 3511239..b3aaa09 100644 --- a/bridge/include/livekit_bridge/rpc_constants.h +++ b/bridge/include/livekit_bridge/rpc_constants.h @@ -20,16 +20,7 @@ #pragma once #include - -namespace livekit_bridge { -namespace rpc { - -/// Built-in RPC method name used by remote track control. -/// Allows remote participants to mute or unmute tracks -/// published by this bridge. Must be called after connect(). -/// Audio/video tracks support mute and unmute. Data tracks -/// only support mute and unmute. -namespace track_control { +namespace livekit_bridge::rpc::track_control { enum class Action { kActionMute, kActionUnmute }; @@ -49,6 +40,4 @@ extern const char *const kResponseOk; /// Build a track-control RPC payload: ":". std::string formatPayload(const char *action, const std::string &track_name); -} // namespace track_control -} // namespace rpc -} // namespace livekit_bridge +} // namespace livekit_bridge::rpc::track_control diff --git a/bridge/src/rpc_constants.cpp b/bridge/src/rpc_constants.cpp index 03386fe..c4168f2 100644 --- a/bridge/src/rpc_constants.cpp +++ b/bridge/src/rpc_constants.cpp @@ -16,9 +16,7 @@ #include "livekit_bridge/rpc_constants.h" -namespace livekit_bridge { -namespace rpc { -namespace track_control { +namespace livekit_bridge::rpc::track_control { const char *const kMethod = "lk.bridge.track-control"; const char *const kActionMute = "mute"; @@ -36,6 +34,4 @@ std::string formatPayload(const char *action, const std::string &track_name) { return payload; } -} // namespace track_control -} // namespace rpc -} // namespace livekit_bridge +} // namespace livekit_bridge::rpc::track_control diff --git a/bridge/tests/integration/test_bridge_rpc_roundtrip.cpp b/bridge/tests/integration/test_bridge_rpc_roundtrip.cpp index e649450..31f259b 100644 --- a/bridge/tests/integration/test_bridge_rpc_roundtrip.cpp +++ b/bridge/tests/integration/test_bridge_rpc_roundtrip.cpp @@ -17,8 +17,7 @@ #include "../common/bridge_test_common.h" #include -namespace livekit_bridge { -namespace test { +namespace livekit_bridge::test { class BridgeRpcRoundtripTest : public BridgeTestBase {}; @@ -267,5 +266,4 @@ TEST_F(BridgeRemoteTrackControlTest, RemoteMuteNonexistentTrack) { } } -} // namespace test -} // namespace livekit_bridge +} // namespace livekit_bridge::test diff --git a/bridge/tests/test_bridge_audio_track.cpp b/bridge/tests/test_bridge_audio_track.cpp index 8e7274e..cca5971 100644 --- a/bridge/tests/test_bridge_audio_track.cpp +++ b/bridge/tests/test_bridge_audio_track.cpp @@ -24,8 +24,7 @@ #include #include -namespace livekit_bridge { -namespace test { +namespace livekit_bridge::test { class BridgeAudioTrackTest : public ::testing::Test { protected: @@ -114,5 +113,4 @@ TEST_F(BridgeAudioTrackTest, UnmuteOnReleasedTrackDoesNotCrash) { << "unmute() on a released track should be a no-op"; } -} // namespace test -} // namespace livekit_bridge +} // namespace livekit_bridge::test diff --git a/bridge/tests/test_bridge_video_track.cpp b/bridge/tests/test_bridge_video_track.cpp index 08517b0..2e01444 100644 --- a/bridge/tests/test_bridge_video_track.cpp +++ b/bridge/tests/test_bridge_video_track.cpp @@ -24,8 +24,7 @@ #include #include -namespace livekit_bridge { -namespace test { +namespace livekit_bridge::test { class BridgeVideoTrackTest : public ::testing::Test { protected: @@ -110,5 +109,4 @@ TEST_F(BridgeVideoTrackTest, UnmuteOnReleasedTrackDoesNotCrash) { << "unmute() on a released track should be a no-op"; } -} // namespace test -} // namespace livekit_bridge +} // namespace livekit_bridge::test diff --git a/bridge/tests/test_livekit_bridge.cpp b/bridge/tests/test_livekit_bridge.cpp index 43c8f6f..2b093d4 100644 --- a/bridge/tests/test_livekit_bridge.cpp +++ b/bridge/tests/test_livekit_bridge.cpp @@ -24,8 +24,7 @@ #include -namespace livekit_bridge { -namespace test { +namespace livekit_bridge::test { class LiveKitBridgeTest : public ::testing::Test { protected: @@ -134,5 +133,4 @@ TEST_F(LiveKitBridgeTest, ClearNonExistentCallbackIsNoOp) { }) << "Clearing a callback that was never registered should be a no-op"; } -} // namespace test -} // namespace livekit_bridge +} // namespace livekit_bridge::test diff --git a/bridge/tests/test_rpc_controller.cpp b/bridge/tests/test_rpc_controller.cpp index be2d035..a59547d 100644 --- a/bridge/tests/test_rpc_controller.cpp +++ b/bridge/tests/test_rpc_controller.cpp @@ -28,8 +28,7 @@ #include #include -namespace livekit_bridge { -namespace test { +namespace livekit_bridge::test { // Records (action, track_name) pairs passed to the TrackActionFn callback. struct TrackActionRecord { @@ -269,5 +268,4 @@ TEST_F(RpcControllerTest, FormatPayloadRoundTrip) { EXPECT_EQ(recorded_actions_[0].track_name, track_name); } -} // namespace test -} // namespace livekit_bridge +} // namespace livekit_bridge::test diff --git a/src/lk_log.h b/src/lk_log.h index 7c51596..21a064b 100644 --- a/src/lk_log.h +++ b/src/lk_log.h @@ -20,8 +20,7 @@ #include #include -namespace livekit { -namespace detail { +namespace livekit::detail { /// Returns the shared "livekit" logger instance. /// The logger is created lazily on first access and lives until @@ -31,8 +30,7 @@ std::shared_ptr getLogger(); /// Tears down the spdlog logger. Called by livekit::shutdown(). void shutdownLogger(); -} // namespace detail -} // namespace livekit +} // namespace livekit::detail // Convenience macros — two-tier filtering: // diff --git a/src/tests/common/audio_utils.h b/src/tests/common/audio_utils.h index 1576b9a..0f85547 100644 --- a/src/tests/common/audio_utils.h +++ b/src/tests/common/audio_utils.h @@ -24,8 +24,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { // Default audio parameters for tests constexpr int kDefaultAudioSampleRate = 48000; @@ -116,5 +115,4 @@ inline void fillToneFrame(AudioFrame &frame, double freq_hz, int sample_rate, } } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/common/test_common.h b/src/tests/common/test_common.h index 3133adc..6f5c785 100644 --- a/src/tests/common/test_common.h +++ b/src/tests/common/test_common.h @@ -34,8 +34,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { using namespace std::chrono_literals; @@ -435,5 +434,4 @@ class LiveKitTestBase : public ::testing::Test { TestConfig config_; }; -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/common/video_utils.h b/src/tests/common/video_utils.h index eb743c5..829168e 100644 --- a/src/tests/common/video_utils.h +++ b/src/tests/common/video_utils.h @@ -23,8 +23,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { // Default video dimensions for tests constexpr int kDefaultVideoWidth = 640; @@ -125,5 +124,4 @@ inline void runVideoLoop( } } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_audio_frame.cpp b/src/tests/integration/test_audio_frame.cpp index 9eba0be..25d1fda 100644 --- a/src/tests/integration/test_audio_frame.cpp +++ b/src/tests/integration/test_audio_frame.cpp @@ -18,8 +18,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { class AudioFrameTest : public ::testing::Test { protected: @@ -166,5 +165,4 @@ TEST_F(AudioFrameTest, InvalidDataSizeThrows) { EXPECT_THROW(AudioFrame(data, 48000, 2, 960), std::invalid_argument); } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_audio_processing_module.cpp b/src/tests/integration/test_audio_processing_module.cpp index 4c4b48c..fe2adae 100644 --- a/src/tests/integration/test_audio_processing_module.cpp +++ b/src/tests/integration/test_audio_processing_module.cpp @@ -28,8 +28,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { class AudioProcessingModuleTest : public ::testing::Test { protected: @@ -922,5 +921,4 @@ TEST_F(AudioProcessingModuleTest, AGCWithNoiseSuppressionCombined) { << "Combined AGC+NS should produce reasonable output"; } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_data_track.cpp b/src/tests/integration/test_data_track.cpp index 983497b..31a9b15 100644 --- a/src/tests/integration/test_data_track.cpp +++ b/src/tests/integration/test_data_track.cpp @@ -34,8 +34,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { using namespace std::chrono_literals; @@ -844,5 +843,4 @@ INSTANTIATE_TEST_SUITE_P(DataTrackScenarios, DataTrackTransportTest, size_t{196608})), dataTrackParamName); -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_logging.cpp b/src/tests/integration/test_logging.cpp index 88e1616..3e45fb3 100644 --- a/src/tests/integration/test_logging.cpp +++ b/src/tests/integration/test_logging.cpp @@ -25,8 +25,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { class LoggingTest : public ::testing::Test { protected: @@ -293,5 +292,4 @@ TEST_F(LoggingTest, ConcurrentLogEmissionDoesNotCrash) { EXPECT_GE(call_count.load(), kThreads * kIterations); } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_media_multistream.cpp b/src/tests/integration/test_media_multistream.cpp index 8b98fe9..908a9cc 100644 --- a/src/tests/integration/test_media_multistream.cpp +++ b/src/tests/integration/test_media_multistream.cpp @@ -26,8 +26,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { using namespace std::chrono_literals; @@ -248,5 +247,4 @@ TEST_F(MediaMultiStreamIntegrationTest, runPublishTwoVideoAndTwoAudioTracks(true); } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_room.cpp b/src/tests/integration/test_room.cpp index f815472..a5f4fbe 100644 --- a/src/tests/integration/test_room.cpp +++ b/src/tests/integration/test_room.cpp @@ -17,8 +17,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { class RoomTest : public ::testing::Test { protected: @@ -160,5 +159,4 @@ TEST_F(RoomServerTest, ConnectWithInvalidUrl) { EXPECT_FALSE(connected) << "Should fail to connect to invalid URL"; } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_rpc.cpp b/src/tests/integration/test_rpc.cpp index 1747eaf..8d38147 100644 --- a/src/tests/integration/test_rpc.cpp +++ b/src/tests/integration/test_rpc.cpp @@ -26,8 +26,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { using namespace std::chrono_literals; @@ -532,5 +531,4 @@ TEST_F(RpcIntegrationTest, OneMinuteIntegration) { receiver_room.reset(); } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/integration/test_sdk_initialization.cpp b/src/tests/integration/test_sdk_initialization.cpp index 4d8fa02..9391ebc 100644 --- a/src/tests/integration/test_sdk_initialization.cpp +++ b/src/tests/integration/test_sdk_initialization.cpp @@ -17,8 +17,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { class SDKInitializationTest : public ::testing::Test { protected: @@ -69,5 +68,4 @@ TEST_F(SDKInitializationTest, MultipleShutdowns) { EXPECT_NO_THROW(livekit::shutdown()); } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/stress/test_audio_frame_stress.cpp b/src/tests/stress/test_audio_frame_stress.cpp index 41f92e9..efecfe0 100644 --- a/src/tests/stress/test_audio_frame_stress.cpp +++ b/src/tests/stress/test_audio_frame_stress.cpp @@ -22,8 +22,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { class AudioFrameStressTest : public ::testing::Test { protected: @@ -283,5 +282,4 @@ TEST_F(AudioFrameStressTest, SimulatedRealtimeProcessing) { << "Processing takes longer than real-time allows"; } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/stress/test_latency_measurement.cpp b/src/tests/stress/test_latency_measurement.cpp index e93d210..f48a457 100644 --- a/src/tests/stress/test_latency_measurement.cpp +++ b/src/tests/stress/test_latency_measurement.cpp @@ -20,8 +20,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { // Audio configuration for latency test constexpr int kAudioSampleRate = 48000; @@ -852,5 +851,4 @@ TEST_F(LatencyMeasurementTest, FullDeplexAudioLatency) { << "At least one B->A latency measurement should be recorded"; } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/stress/test_room_stress.cpp b/src/tests/stress/test_room_stress.cpp index 50cc986..1f84db1 100644 --- a/src/tests/stress/test_room_stress.cpp +++ b/src/tests/stress/test_room_stress.cpp @@ -22,8 +22,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { class RoomStressTest : public ::testing::Test { protected: @@ -238,5 +237,4 @@ TEST_F(RoomServerStressTest, RepeatedConnectDisconnect) { << std::endl; } -} // namespace test -} // namespace livekit +} // namespace livekit::test diff --git a/src/tests/stress/test_rpc_stress.cpp b/src/tests/stress/test_rpc_stress.cpp index 4e25a7b..6998ff6 100644 --- a/src/tests/stress/test_rpc_stress.cpp +++ b/src/tests/stress/test_rpc_stress.cpp @@ -19,8 +19,7 @@ #include #include -namespace livekit { -namespace test { +namespace livekit::test { // Maximum RPC payload size (15KB) constexpr size_t kMaxRpcPayloadSize = 15 * 1024; @@ -887,5 +886,4 @@ TEST_F(RpcStressTest, HighThroughputBurst) { receiver_room.reset(); } -} // namespace test -} // namespace livekit +} // namespace livekit::test From 695a2429382804bb32bdaeb9ee2ea451a912af16 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 10:42:56 -0600 Subject: [PATCH 18/28] Fix two clang issues --- include/livekit/data_track_stream.h | 2 +- src/ffi_client.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/livekit/data_track_stream.h b/include/livekit/data_track_stream.h index 3cfcf8a..bfef046 100644 --- a/include/livekit/data_track_stream.h +++ b/include/livekit/data_track_stream.h @@ -124,7 +124,7 @@ class DataTrackStream { FfiHandle subscription_handle_; /** FfiClient listener id for routing FfiEvent callbacks to this object. */ - std::int64_t listener_id_{0}; + std::int32_t listener_id_{0}; }; } // namespace livekit diff --git a/src/ffi_client.cpp b/src/ffi_client.cpp index 82f4d1c..15115c9 100644 --- a/src/ffi_client.cpp +++ b/src/ffi_client.cpp @@ -651,10 +651,8 @@ FfiClient::publishDataTrackAsync(std::uint64_t local_participant_handle, "PublishDataTrackCallback missing track"})); return; } - proto::OwnedLocalDataTrack track = cb.track(); pr.set_value( - Result::success( - std::move(track))); + Result::success(cb.track())); }); proto::FfiRequest req; From d55804a78e3fee9d0c9053d6be8e634691257956 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 10:59:54 -0600 Subject: [PATCH 19/28] Use all possible cores on clang-tidy --- .github/workflows/builds.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 2cc7c42..5b6230b 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -558,13 +558,14 @@ jobs: database: build-release files-changed-only: false lines-changed-only: false - ignore: 'build-*|client-sdk-rust|vcpkg_installed' + ignore: 'build-*|cpp-example-collection|client-sdk-rust|vcpkg_installed' file-annotations: true thread-comments: update step-summary: true tidy-review: true passive-reviews: true no-lgtm: true + jobs: 0 # use all available CPU cores - name: Check warning thresholds env: From 808f781a8b2398ccae250ac4bbb27cafad818406 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 11:09:13 -0600 Subject: [PATCH 20/28] Use Node24 versions of things --- .github/workflows/builds.yml | 66 +++++++++++++++-------------- .github/workflows/docker-images.yml | 22 +++++----- .github/workflows/license_check.yml | 2 +- .github/workflows/make-release.yml | 12 +++--- .github/workflows/pin_check.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- 6 files changed, 54 insertions(+), 52 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 5b6230b..1c7610f 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -67,29 +67,31 @@ jobs: name: linux-x64 build_cmd: ./build.sh release-tests && ./build.sh release-examples build_dir: build-release - - os: ubuntu-24.04-arm - name: linux-arm64 - build_cmd: ./build.sh release-tests && ./build.sh release-examples - build_dir: build-release - - os: macos-latest - name: macos-arm64 - build_cmd: ./build.sh release-tests && ./build.sh release-examples - build_dir: build-release - - os: macos-latest - name: macos-x64 - build_cmd: ./build.sh release-tests && ./build.sh release-examples --macos-arch x86_64 - build_dir: build-release - - os: windows-latest - name: windows-x64 - build_cmd: .\build.cmd release-tests && .\build.cmd release-examples - build_dir: build-release + # Temporarily comment these out to ensure clang-tidy gets done faster + # TODO: undo before merge + # - os: ubuntu-24.04-arm + # name: linux-arm64 + # build_cmd: ./build.sh release-tests && ./build.sh release-examples + # build_dir: build-release + # - os: macos-latest + # name: macos-arm64 + # build_cmd: ./build.sh release-tests && ./build.sh release-examples + # build_dir: build-release + # - os: macos-latest + # name: macos-x64 + # build_cmd: ./build.sh release-tests && ./build.sh release-examples --macos-arch x86_64 + # build_dir: build-release + # - os: windows-latest + # name: windows-x64 + # build_cmd: .\build.cmd release-tests && .\build.cmd release-examples + # build_dir: build-release name: Build (${{ matrix.name }}) runs-on: ${{ matrix.os }} steps: - name: Checkout (with submodules) - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive fetch-depth: 1 @@ -100,7 +102,7 @@ jobs: # ---------- vcpkg caching for Windows ---------- - name: Export GitHub Actions cache environment variables if: runner.os == 'Windows' - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); @@ -150,7 +152,7 @@ jobs: # ---------- Cache Cargo ---------- - name: Cache Cargo registry - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: | ~/.cargo/registry @@ -159,7 +161,7 @@ jobs: restore-keys: ${{ runner.os }}-${{ matrix.name }}-cargo-reg- - name: Cache Cargo target - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: client-sdk-rust/target key: ${{ runner.os }}-${{ matrix.name }}-cargo-target-${{ hashFiles('**/Cargo.lock') }} @@ -305,7 +307,7 @@ jobs: - name: Upload test results if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: test-results-${{ matrix.name }} path: ${{ matrix.build_dir }}/unit-test-results.xml @@ -313,7 +315,7 @@ jobs: # ---------- Upload artifacts ---------- - name: Upload build artifacts - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: livekit-sdk-${{ matrix.name }} path: | @@ -324,7 +326,7 @@ jobs: - name: Upload compile database (for clang-tidy) if: matrix.name == 'linux-x64' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: compile-database path: | @@ -350,7 +352,7 @@ jobs: steps: - name: Checkout (with submodules) - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive fetch-depth: 0 @@ -392,7 +394,7 @@ jobs: 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: livekit-cpp-sdk-docker-x64 path: livekit-cpp-sdk-x64-docker.tar.gz @@ -405,7 +407,7 @@ jobs: steps: - name: Checkout (with submodules) - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive fetch-depth: 0 @@ -447,7 +449,7 @@ jobs: docker save livekit-cpp-sdk:${{ github.sha }} | gzip > livekit-cpp-sdk-arm64-docker.tar.gz - name: Upload Docker image artifact - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: livekit-cpp-sdk-docker-arm64 path: livekit-cpp-sdk-arm64-docker.tar.gz @@ -461,7 +463,7 @@ jobs: steps: - name: Download Docker image artifact - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: livekit-cpp-sdk-docker-arm64 @@ -488,7 +490,7 @@ jobs: steps: - name: Download Docker image artifact - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: livekit-cpp-sdk-docker-x64 @@ -519,7 +521,7 @@ jobs: steps: - name: Checkout (with submodules) - uses: actions/checkout@v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive fetch-depth: 0 @@ -542,13 +544,13 @@ jobs: libwayland-dev libdecor-0-dev - name: Download compile database - uses: actions/download-artifact@v4 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: compile-database path: build-release/ - name: Run clang-tidy - uses: cpp-linter/cpp-linter-action@v2 + uses: cpp-linter/cpp-linter-action@77c390c5ba9c947ebc185a3e49cc754f1558abb5 # v2.18.0 id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index acbcdfc..ebdae31 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -34,7 +34,7 @@ jobs: sdk_image: ${{ steps.refs.outputs.sdk_image }} steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 @@ -106,7 +106,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Free disk space uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 @@ -120,7 +120,7 @@ jobs: swap-storage: true - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Login to GHCR shell: bash @@ -150,7 +150,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Free disk space uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 @@ -164,7 +164,7 @@ jobs: swap-storage: true - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Login to GHCR shell: bash @@ -197,7 +197,7 @@ jobs: steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Login to GHCR shell: bash @@ -231,7 +231,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive fetch-depth: 0 @@ -248,7 +248,7 @@ jobs: swap-storage: true - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Login to GHCR shell: bash @@ -285,7 +285,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive fetch-depth: 0 @@ -302,7 +302,7 @@ jobs: swap-storage: true - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Login to GHCR shell: bash @@ -342,7 +342,7 @@ jobs: steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Login to GHCR shell: bash diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index d1392b5..f28aac1 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -11,7 +11,7 @@ jobs: contents: read steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check License Headers shell: bash run: | diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index e57014e..b0c6b1b 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout (with submodules) - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive fetch-depth: 0 @@ -87,7 +87,7 @@ jobs: # ---------- vcpkg for Windows ---------- - name: Export GitHub Actions cache environment variables if: runner.os == 'Windows' - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); @@ -136,7 +136,7 @@ jobs: # ---------- Cache Cargo ---------- - name: Cache Cargo registry - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: | ~/.cargo/registry @@ -201,7 +201,7 @@ jobs: # ---------- Upload artifact (raw directory, no pre-compression) ---------- - name: Upload build artifact - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }} path: sdk-out/livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }} @@ -217,7 +217,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Extract version id: version @@ -249,7 +249,7 @@ jobs: echo "SDK Version: $VERSION" - name: Download all artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: path: ${{ github.workspace }}/artifacts diff --git a/.github/workflows/pin_check.yml b/.github/workflows/pin_check.yml index 71cbace..6bf1db9 100644 --- a/.github/workflows/pin_check.yml +++ b/.github/workflows/pin_check.yml @@ -11,7 +11,7 @@ jobs: contents: read steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Pin Check uses: suzuki-shunsuke/pinact-action@cf51507d80d4d6522a07348e3d58790290eaf0b6 # v2.0.0 with: diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index d3570b9..f302146 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -8,7 +8,7 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 # Note: submodules and LFS not needed for docs generation # Doxygen only reads from include/, docs/, README.md, and examples/ From 648f4b064e646ba1b22f7cefd20a420eaaafd167 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 11:42:36 -0600 Subject: [PATCH 21/28] build improvements: *-all build configs, ccache, configure stage to optimize clang-tidy run --- .github/workflows/builds.yml | 101 +++++++++++++++++++++++++++++------ CMakePresets.json | 100 ++++++++++++++++++++++++++++++++++ build.sh | 28 ++++++++++ 3 files changed, 212 insertions(+), 17 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 1c7610f..8817af9 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -65,25 +65,25 @@ jobs: include: - os: ubuntu-latest name: linux-x64 - build_cmd: ./build.sh release-tests && ./build.sh release-examples + build_cmd: ./build.sh release-all build_dir: build-release # Temporarily comment these out to ensure clang-tidy gets done faster # TODO: undo before merge # - os: ubuntu-24.04-arm # name: linux-arm64 - # build_cmd: ./build.sh release-tests && ./build.sh release-examples + # build_cmd: ./build.sh release-all # build_dir: build-release # - os: macos-latest # name: macos-arm64 - # build_cmd: ./build.sh release-tests && ./build.sh release-examples + # build_cmd: ./build.sh release-all # build_dir: build-release # - os: macos-latest # name: macos-x64 - # build_cmd: ./build.sh release-tests && ./build.sh release-examples --macos-arch x86_64 + # build_cmd: ./build.sh release-all --macos-arch x86_64 # build_dir: build-release # - os: windows-latest # name: windows-x64 - # build_cmd: .\build.cmd release-tests && .\build.cmd release-examples + # build_cmd: .\build.cmd release-all # build_dir: build-release name: Build (${{ matrix.name }}) @@ -121,7 +121,7 @@ jobs: set -eux sudo apt-get update sudo apt-get install -y \ - build-essential cmake ninja-build pkg-config \ + build-essential cmake ninja-build pkg-config ccache \ llvm-dev libclang-dev clang \ libva-dev libdrm-dev libgbm-dev libx11-dev libgl1-mesa-dev \ libxext-dev libxcomposite-dev libxdamage-dev libxfixes-dev \ @@ -168,10 +168,26 @@ jobs: restore-keys: | ${{ runner.os }}-${{ matrix.name }}-cargo-target- + # ---------- ccache ---------- + - name: Cache ccache + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ~/.cache/ccache + key: ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.sha }} + restore-keys: ${{ runner.os }}-${{ matrix.name }}-ccache- + + - name: Configure ccache + run: | + ccache --set-config=max_size=500M + ccache --set-config=compression=true + ccache -z + # ---------- Build environment setup ---------- - name: Set Linux build environment if: runner.os == 'Linux' run: | + echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV + echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV echo "CXXFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV echo "CFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV LLVM_VERSION=$(llvm-config --version | cut -d. -f1) @@ -324,15 +340,9 @@ jobs: ${{ matrix.build_dir }}/bin/ retention-days: 7 - - name: Upload compile database (for clang-tidy) - if: matrix.name == 'linux-x64' - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: compile-database - path: | - ${{ matrix.build_dir }}/compile_commands.json - ${{ matrix.build_dir }}/generated/ - retention-days: 1 + - name: Print ccache stats + if: always() + run: ccache -s # ---------- Cleanup ---------- - name: Clean after build (best-effort) @@ -509,9 +519,66 @@ jobs: cmake --build build --parallel ' + # Lightweight job: configure-only to produce compile_commands.json + generated + # protobuf headers for clang-tidy, without waiting for the full build. + configure: + name: Configure (compile database) + runs-on: ubuntu-latest + + steps: + - name: Checkout (with submodules) + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + submodules: recursive + fetch-depth: 1 + + - name: Install deps (Ubuntu) + run: | + set -eux + sudo apt-get update + sudo apt-get install -y \ + build-essential cmake ninja-build pkg-config \ + llvm-dev libclang-dev clang \ + libva-dev libdrm-dev libgbm-dev libx11-dev libgl1-mesa-dev \ + libxext-dev libxcomposite-dev libxdamage-dev libxfixes-dev \ + libxrandr-dev libxi-dev libxkbcommon-dev \ + libasound2-dev libpulse-dev \ + libssl-dev \ + libprotobuf-dev protobuf-compiler \ + libabsl-dev \ + libwayland-dev libdecor-0-dev \ + libspdlog-dev + + - name: Install Rust (stable) + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 + with: + toolchain: stable + + - name: Set Linux build environment + run: | + echo "CXXFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV + echo "CFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV + LLVM_VERSION=$(llvm-config --version | cut -d. -f1) + echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> $GITHUB_ENV + + - name: CMake configure + run: cmake --preset linux-release-all + + - name: Generate protobuf headers + run: cmake --build build-release --target livekit_proto + + - name: Upload compile database + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: compile-database + path: | + build-release/compile_commands.json + build-release/generated/ + retention-days: 1 + clang-tidy: name: clang-tidy - needs: build + needs: configure runs-on: ubuntu-latest continue-on-error: false if: ${{ !cancelled() }} @@ -524,7 +591,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: recursive - fetch-depth: 0 + fetch-depth: 1 - name: Install dependencies run: | diff --git a/CMakePresets.json b/CMakePresets.json index 5f6b3be..3c863d7 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -207,6 +207,32 @@ "LIVEKIT_BUILD_TESTS": "OFF" } }, + { + "name": "windows-release-all", + "displayName": "Windows x64 Release with Tests + Examples", + "description": "Build for Windows x64 Release with tests and examples", + "inherits": "windows-base", + "binaryDir": "${sourceDir}/build-release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "LIVEKIT_BUILD_EXAMPLES": "ON", + "LIVEKIT_BUILD_TESTS": "ON", + "VCPKG_MANIFEST_FEATURES": "examples" + } + }, + { + "name": "windows-debug-all", + "displayName": "Windows x64 Debug with Tests + Examples", + "description": "Build for Windows x64 Debug with tests and examples", + "inherits": "windows-base", + "binaryDir": "${sourceDir}/build-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LIVEKIT_BUILD_EXAMPLES": "ON", + "LIVEKIT_BUILD_TESTS": "ON", + "VCPKG_MANIFEST_FEATURES": "examples" + } + }, { "name": "windows-release-tests", "displayName": "Windows x64 Release with Tests", @@ -231,6 +257,30 @@ "LIVEKIT_BUILD_TESTS": "ON" } }, + { + "name": "linux-release-all", + "displayName": "Linux Release with Tests + Examples", + "description": "Build for Linux Release with tests and examples", + "inherits": "linux-base", + "binaryDir": "${sourceDir}/build-release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "LIVEKIT_BUILD_EXAMPLES": "ON", + "LIVEKIT_BUILD_TESTS": "ON" + } + }, + { + "name": "linux-debug-all", + "displayName": "Linux Debug with Tests + Examples", + "description": "Build for Linux Debug with tests and examples", + "inherits": "linux-base", + "binaryDir": "${sourceDir}/build-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LIVEKIT_BUILD_EXAMPLES": "ON", + "LIVEKIT_BUILD_TESTS": "ON" + } + }, { "name": "linux-release-tests", "displayName": "Linux Release with Tests", @@ -255,6 +305,30 @@ "LIVEKIT_BUILD_TESTS": "ON" } }, + { + "name": "macos-release-all", + "displayName": "macOS Release with Tests + Examples", + "description": "Build for macOS Release with tests and examples", + "inherits": "macos-base", + "binaryDir": "${sourceDir}/build-release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "LIVEKIT_BUILD_EXAMPLES": "ON", + "LIVEKIT_BUILD_TESTS": "ON" + } + }, + { + "name": "macos-debug-all", + "displayName": "macOS Debug with Tests + Examples", + "description": "Build for macOS Debug with tests and examples", + "inherits": "macos-base", + "binaryDir": "${sourceDir}/build-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LIVEKIT_BUILD_EXAMPLES": "ON", + "LIVEKIT_BUILD_TESTS": "ON" + } + }, { "name": "macos-release-tests", "displayName": "macOS Release with Tests", @@ -333,6 +407,32 @@ "name": "macos-debug-examples", "configurePreset": "macos-debug-examples" }, + { + "name": "windows-release-all", + "configurePreset": "windows-release-all", + "configuration": "Release" + }, + { + "name": "windows-debug-all", + "configurePreset": "windows-debug-all", + "configuration": "Debug" + }, + { + "name": "linux-release-all", + "configurePreset": "linux-release-all" + }, + { + "name": "linux-debug-all", + "configurePreset": "linux-debug-all" + }, + { + "name": "macos-release-all", + "configurePreset": "macos-release-all" + }, + { + "name": "macos-debug-all", + "configurePreset": "macos-debug-all" + }, { "name": "windows-release-tests", "configurePreset": "windows-release-tests", diff --git a/build.sh b/build.sh index dad2d83..13b6727 100755 --- a/build.sh +++ b/build.sh @@ -34,9 +34,11 @@ Commands: debug Configure + build Debug version (build-debug/) debug-examples Configure + build Debug version with examples debug-tests Configure + build Debug version with tests + debug-all Configure + build Debug version with tests + examples release Configure + build Release version (build-release/) release-examples Configure + build Release version with examples release-tests Configure + build Release version with tests + release-all Configure + build Release version with tests + examples build-all Configure + build all of the above (debug/release + examples + tests) clean Clean both Debug and Release build directories clean-all Full clean (build dirs + Rust targets) @@ -408,6 +410,32 @@ case "${cmd}" in fi fi ;; + release-all) + BUILD_TYPE="Release" + BUILD_DIR="${PROJECT_ROOT}/build-release" + PRESET="${OS_TYPE}-release-all" + configure + build + if [[ "${DO_BUNDLE}" == "1" ]]; then + install_bundle + if [[ "${DO_ARCHIVE}" == "1" ]]; then + archive_bundle + fi + fi + ;; + debug-all) + BUILD_TYPE="Debug" + BUILD_DIR="${PROJECT_ROOT}/build-debug" + PRESET="${OS_TYPE}-debug-all" + configure + build + if [[ "${DO_BUNDLE}" == "1" ]]; then + install_bundle + if [[ "${DO_ARCHIVE}" == "1" ]]; then + archive_bundle + fi + fi + ;; build-all) echo "==> Build-all: debug, debug-examples, debug-tests, release, release-examples, release-tests" BUILD_TYPE="Debug" From afba69d6860a459702b83b55eee15ed5c5cf8922 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 12:26:08 -0600 Subject: [PATCH 22/28] Attempt to fix diagnostic clang errors --- .github/workflows/builds.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 8817af9..00d2949 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -574,6 +574,14 @@ jobs: path: | build-release/compile_commands.json build-release/generated/ + build-release/_deps/googletest-src/googletest/include/ + build-release/_deps/googletest-src/googletest/src/ + build-release/_deps/googletest-src/googlemock/include/ + build-release/_deps/googletest-src/googlemock/src/ + build-release/_deps/livekit_spdlog-src/include/ + build-release/_deps/livekit_protobuf-src/src/google/ + build-release/_deps/livekit_protobuf-src/third_party/utf8_range/ + build-release/_deps/livekit_abseil-src/absl/ retention-days: 1 clang-tidy: @@ -627,6 +635,7 @@ jobs: database: build-release files-changed-only: false lines-changed-only: false + extensions: 'c,cpp,cc,cxx' ignore: 'build-*|cpp-example-collection|client-sdk-rust|vcpkg_installed' file-annotations: true thread-comments: update From f242a9dd9071b3daf1d4751a193f280a79826cdf Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 12:53:22 -0600 Subject: [PATCH 23/28] Cleaner compile database --- .github/workflows/builds.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 00d2949..b7036ed 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -574,14 +574,7 @@ jobs: path: | build-release/compile_commands.json build-release/generated/ - build-release/_deps/googletest-src/googletest/include/ - build-release/_deps/googletest-src/googletest/src/ - build-release/_deps/googletest-src/googlemock/include/ - build-release/_deps/googletest-src/googlemock/src/ - build-release/_deps/livekit_spdlog-src/include/ - build-release/_deps/livekit_protobuf-src/src/google/ - build-release/_deps/livekit_protobuf-src/third_party/utf8_range/ - build-release/_deps/livekit_abseil-src/absl/ + build-release/_deps/*-src/ retention-days: 1 clang-tidy: From 9561293fbc18920819b7b00c9cadcce9d9f59d01 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 13:35:15 -0600 Subject: [PATCH 24/28] Some bugprone fixes --- include/livekit/audio_stream.h | 2 +- include/livekit/video_stream.h | 2 +- src/data_track_stream.cpp | 2 +- src/tests/integration/test_rpc.cpp | 2 +- src/tests/stress/test_latency_measurement.cpp | 12 ++++++++---- src/tests/unit/test_audio_processing_module.cpp | 3 ++- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/livekit/audio_stream.h b/include/livekit/audio_stream.h index c066e87..334d761 100644 --- a/include/livekit/audio_stream.h +++ b/include/livekit/audio_stream.h @@ -142,7 +142,7 @@ class AudioStream { FfiHandle stream_handle_; // Listener id registered on FfiClient - std::int64_t listener_id_{0}; + std::int32_t listener_id_{0}; }; } // namespace livekit diff --git a/include/livekit/video_stream.h b/include/livekit/video_stream.h index 0f66608..e7db742 100644 --- a/include/livekit/video_stream.h +++ b/include/livekit/video_stream.h @@ -130,7 +130,7 @@ class VideoStream { FfiHandle stream_handle_; // Listener id registered on FfiClient - std::int64_t listener_id_{0}; + std::int32_t listener_id_{0}; }; } // namespace livekit diff --git a/src/data_track_stream.cpp b/src/data_track_stream.cpp index 4a23d74..d8c8519 100644 --- a/src/data_track_stream.cpp +++ b/src/data_track_stream.cpp @@ -68,7 +68,7 @@ bool DataTrackStream::read(DataTrackFrame &out) { } void DataTrackStream::close() { - std::int64_t listener_id = -1; + std::int32_t listener_id = -1; { std::lock_guard lock(mutex_); if (closed_) { diff --git a/src/tests/integration/test_rpc.cpp b/src/tests/integration/test_rpc.cpp index 8d38147..939a6f6 100644 --- a/src/tests/integration/test_rpc.cpp +++ b/src/tests/integration/test_rpc.cpp @@ -70,7 +70,7 @@ static const std::vector kSampleSentences = { // Generate a payload of specified size using repeating sentences (compressible) std::string generateRandomPayload(size_t size) { static std::random_device rd; - static std::mt19937 gen(rd()); + static std::mt19937 gen(static_cast(rd())); static std::uniform_int_distribution dis(0, kSampleSentences.size() - 1); diff --git a/src/tests/stress/test_latency_measurement.cpp b/src/tests/stress/test_latency_measurement.cpp index 7e76e34..7c23482 100644 --- a/src/tests/stress/test_latency_measurement.cpp +++ b/src/tests/stress/test_latency_measurement.cpp @@ -454,7 +454,8 @@ TEST_F(LatencyMeasurementTest, AudioLatency) { uint64_t send_time_us = last_high_energy_send_time_us.load(); if (send_time_us > 0) { - double latency_ms = (receive_time_us - send_time_us) / 1000.0; + double latency_ms = + static_cast(receive_time_us - send_time_us) / 1000.0; if (latency_ms > 0 && latency_ms < 5000) { // Sanity check stats.addMeasurement(latency_ms); std::cout << " Audio latency: " << std::fixed @@ -676,7 +677,8 @@ TEST_F(LatencyMeasurementTest, FullDeplexAudioLatency) { if (send_from_a_us == 0 || detect_us <= send_from_a_us) { continue; } - double a_to_b_ms = (detect_us - send_from_a_us) / 1000.0; + double a_to_b_ms = + static_cast(detect_us - send_from_a_us) / 1000.0; if (a_to_b_ms < kMinValidOneWayMs || a_to_b_ms > 5000) { continue; } @@ -742,7 +744,8 @@ TEST_F(LatencyMeasurementTest, FullDeplexAudioLatency) { } a_received_pulse_id.store(pulse_id); - double b_to_a_ms = (receive_us - send_from_b_us) / 1000.0; + double b_to_a_ms = + static_cast(receive_us - send_from_b_us) / 1000.0; if (b_to_a_ms >= kMinValidBToAMs && b_to_a_ms < 5000) { b_to_a_stats.addMeasurement(b_to_a_ms); std::cout << " B->A latency: " << std::fixed << std::setprecision(2) @@ -750,7 +753,8 @@ TEST_F(LatencyMeasurementTest, FullDeplexAudioLatency) { } if (send_from_a_us > 0) { - double rtt_ms = (receive_us - send_from_a_us) / 1000.0; + double rtt_ms = + static_cast(receive_us - send_from_a_us) / 1000.0; if (rtt_ms > 0 && rtt_ms < 10000) { round_trip_stats.addMeasurement(rtt_ms); std::cout << " A->B->A latency: " << std::fixed diff --git a/src/tests/unit/test_audio_processing_module.cpp b/src/tests/unit/test_audio_processing_module.cpp index d31e4d9..1e5620e 100644 --- a/src/tests/unit/test_audio_processing_module.cpp +++ b/src/tests/unit/test_audio_processing_module.cpp @@ -65,7 +65,8 @@ class AudioProcessingModuleTest : public ::testing::Test { // Helper to fill frame with random noise static void fillWithNoise(AudioFrame &frame, double amplitude = 5000.0, unsigned int seed = 0) { - std::mt19937 gen(seed == 0 ? std::random_device{}() : seed); + std::mt19937 gen(static_cast( + seed == 0 ? std::random_device{}() : seed)); std::uniform_real_distribution<> dis(-amplitude, amplitude); auto &data = frame.data(); From a9ff2997ab1597a73250306ff1b2b11b664cd052 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 14:21:06 -0600 Subject: [PATCH 25/28] Additional fixes --- src/data_stream.cpp | 4 ++-- src/room.cpp | 2 +- src/tests/stress/test_rpc_stress.cpp | 3 ++- src/tests/unit/test_audio_processing_module.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/data_stream.cpp b/src/data_stream.cpp index e971249..70d871a 100644 --- a/src/data_stream.cpp +++ b/src/data_stream.cpp @@ -344,8 +344,8 @@ void ByteStreamWriter::write(const std::vector &data) { while (offset < data.size()) { const std::size_t n = std::min(kStreamChunkSize, data.size() - offset); - std::vector chunk(data.begin() + offset, - data.begin() + offset + n); + auto it = data.begin() + static_cast(offset); + std::vector chunk(it, it + static_cast(n)); sendChunk(chunk); offset += n; } diff --git a/src/room.cpp b/src/room.cpp index 919e126..f4ffd74 100644 --- a/src/room.cpp +++ b/src/room.cpp @@ -188,7 +188,7 @@ bool Room::Connect(const std::string &url, const std::string &token, // Install listener (Room is fully initialized) auto listenerId = FfiClient::instance().AddListener( - std::bind(&Room::OnEvent, this, std::placeholders::_1)); + [this](const proto::FfiEvent &e) { OnEvent(e); }); { std::lock_guard g(lock_); listener_id_ = listenerId; diff --git a/src/tests/stress/test_rpc_stress.cpp b/src/tests/stress/test_rpc_stress.cpp index 6998ff6..44e712c 100644 --- a/src/tests/stress/test_rpc_stress.cpp +++ b/src/tests/stress/test_rpc_stress.cpp @@ -115,7 +115,8 @@ std::string generateRandomPayload(size_t size) { loadTestData(); static thread_local std::random_device rd; - static thread_local std::mt19937 gen(rd()); + static thread_local std::mt19937 gen( + static_cast(rd())); if (gTestDataLines.empty()) { // Should not happen, but return empty string if no data diff --git a/src/tests/unit/test_audio_processing_module.cpp b/src/tests/unit/test_audio_processing_module.cpp index 1e5620e..048aa1c 100644 --- a/src/tests/unit/test_audio_processing_module.cpp +++ b/src/tests/unit/test_audio_processing_module.cpp @@ -894,7 +894,7 @@ TEST_F(AudioProcessingModuleTest, AGCWithNoiseSuppressionCombined) { // Add noise on top auto &data = frame.data(); - std::mt19937 gen(kSeed + 50 + i); + std::mt19937 gen(static_cast(kSeed + 50 + i)); std::uniform_real_distribution<> dis(-kNoiseAmplitude, kNoiseAmplitude); for (auto &sample : data) { sample = static_cast(std::clamp( From c977e817670cc437bd76e1e3529974ad615ba1f9 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 14:30:19 -0600 Subject: [PATCH 26/28] Hopefully cleaner run --- .github/workflows/builds.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index b7036ed..7c97292 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -575,6 +575,7 @@ jobs: build-release/compile_commands.json build-release/generated/ build-release/_deps/*-src/ + include/livekit/build.h retention-days: 1 clang-tidy: @@ -629,7 +630,7 @@ jobs: files-changed-only: false lines-changed-only: false extensions: 'c,cpp,cc,cxx' - ignore: 'build-*|cpp-example-collection|client-sdk-rust|vcpkg_installed' + ignore: 'build-*|cpp-example-collection|client-sdk-rust|vcpkg_installed|bridge/tests/integration' file-annotations: true thread-comments: update step-summary: true From 25128401b2e431490c665b833613a33fc4dae9e6 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 18:14:15 -0600 Subject: [PATCH 27/28] Ignore tests folder --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 7c97292..2eef957 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -630,7 +630,7 @@ jobs: files-changed-only: false lines-changed-only: false extensions: 'c,cpp,cc,cxx' - ignore: 'build-*|cpp-example-collection|client-sdk-rust|vcpkg_installed|bridge/tests/integration' + ignore: 'build-*|cpp-example-collection|client-sdk-rust|vcpkg_installed|src/tests|bridge/tests' file-annotations: true thread-comments: update step-summary: true From f3be56261b24670cd81990eed3b6587a0414d86c Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 14 Apr 2026 19:29:54 -0600 Subject: [PATCH 28/28] Turn on all stages again --- .github/workflows/builds.yml | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 2eef957..5ca505d 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -67,24 +67,22 @@ jobs: name: linux-x64 build_cmd: ./build.sh release-all build_dir: build-release - # Temporarily comment these out to ensure clang-tidy gets done faster - # TODO: undo before merge - # - os: ubuntu-24.04-arm - # name: linux-arm64 - # build_cmd: ./build.sh release-all - # build_dir: build-release - # - os: macos-latest - # name: macos-arm64 - # build_cmd: ./build.sh release-all - # build_dir: build-release - # - os: macos-latest - # name: macos-x64 - # build_cmd: ./build.sh release-all --macos-arch x86_64 - # build_dir: build-release - # - os: windows-latest - # name: windows-x64 - # build_cmd: .\build.cmd release-all - # build_dir: build-release + - os: ubuntu-24.04-arm + name: linux-arm64 + build_cmd: ./build.sh release-all + build_dir: build-release + - os: macos-latest + name: macos-arm64 + build_cmd: ./build.sh release-all + build_dir: build-release + - os: macos-latest + name: macos-x64 + build_cmd: ./build.sh release-all --macos-arch x86_64 + build_dir: build-release + - os: windows-latest + name: windows-x64 + build_cmd: .\build.cmd release-all + build_dir: build-release name: Build (${{ matrix.name }}) runs-on: ${{ matrix.os }}