Skip to content

proper reporting of rust version based on git commit hash - build-info#123

Open
stephen-derosa wants to merge 2 commits into
livekit:mainfrom
stephen-derosa:sderosa/BOT-348-ffi-lib-reporting
Open

proper reporting of rust version based on git commit hash - build-info#123
stephen-derosa wants to merge 2 commits into
livekit:mainfrom
stephen-derosa:sderosa/BOT-348-ffi-lib-reporting

Conversation

@stephen-derosa
Copy link
Copy Markdown
Collaborator

Overview

Fixes C++ SDK version reporting by sending the release version (LIVEKIT_BUILD_VERSION) to the Rust FFI instead of the build-flavored value (LIVEKIT_BUILD_VERSION_FULL, e.g. 1.2.3-release).

Also adds release provenance metadata to SDK bundles via share/livekit/build-info.json, recording the C++ SDK version, C++ commit, Rust submodule commit, and bundled livekit-ffi crate version. Release CI now validates that bundled artifacts include the expected version metadata and do not fall back to 0.0.0.

Validation:

Added a C++ unit test to ensure the server-facing version does not include -debug / -release.
Verified bundle install produces expected build.h and build-info.json.

BOT-348

Related MR

@stephen-derosa stephen-derosa self-assigned this May 11, 2026
@stephen-derosa stephen-derosa force-pushed the sderosa/BOT-348-ffi-lib-reporting branch 2 times, most recently from 7de6a21 to 93c8e84 Compare May 12, 2026 22:28
Comment thread build-info.json.in
@@ -0,0 +1,8 @@
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very minor suggestion: since this is a build info/bundled version thing and isn't really user-facing, consider an alternative sub-folder (besides root) for it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

.build-info.json.in ?

Comment thread CMakeLists.txt

set(LIVEKIT_FFI_VERSION "unknown")
set(LIVEKIT_FFI_CARGO_TOML "${RUST_ROOT}/livekit-ffi/Cargo.toml")
if(EXISTS "${LIVEKIT_FFI_CARGO_TOML}")
Copy link
Copy Markdown
Contributor

@ladvoc ladvoc May 12, 2026

Choose a reason for hiding this comment

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

suggestion: Might not be worth doing here because of the dep on jq, but this could be more robust:

cargo metadata --format-version 1 | jq -r '.packages[] | select(.name=="livekit-ffi").version'

@stephen-derosa stephen-derosa force-pushed the sderosa/BOT-348-ffi-lib-reporting branch from 9d7abc5 to cb091f6 Compare May 12, 2026 22:55
Copy link
Copy Markdown
Collaborator

@xianshijing-lk xianshijing-lk left a comment

Choose a reason for hiding this comment

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

some comments

Comment thread build-info.json.in
@@ -0,0 +1,8 @@
{
"sdk": "cpp",
"sdk_version": "@LIVEKIT_VERSION@",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should you use the sanitized LIVEKIT_PROJECT_VERSION instead ?

Comment thread CMakeLists.txt
endif()
endif()

string(TIMESTAMP BUILD_DATE "%Y-%m-%d %H:%M:%S")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nite, BUILD_DATE is local time ?

maybe we can consider something like
string(TIMESTAMP BUILD_DATE "%Y-%m-%dT%H:%M:%SZ" UTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants