Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: ./.github/actions/just

- name: Install uniffi-bindgen-cpp
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.5+v0.32.2
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.6+v0.32.2

- name: Check
run: just cpp check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Install uniffi-bindgen-cpp
if: needs.scope.outputs.cpp == 'true' || needs.scope.outputs.obs == 'true'
shell: bash
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.5+v0.32.2
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.6+v0.32.2
- name: Rust compile and tests
if: needs.scope.outputs.rs == 'true'
shell: bash
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }}
- name: Install uniffi-bindgen-cpp
if: needs.scope.outputs.obs == 'true'
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.5+v0.32.2
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.6+v0.32.2
- name: Rust compile and tests
if: needs.scope.outputs.rs == 'true'
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
# The tag flake.nix pins; see the comment there.
- name: Install uniffi-bindgen-cpp
shell: bash
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.5+v0.32.2
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.6+v0.32.2

# The package version lives in cpp/moq/VERSION; a tag that disagrees is a mistake.
- name: Check version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-shared-ffi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Install uniffi-bindgen-cpp
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.5+v0.32.2
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.6+v0.32.2
- name: Download default-feature input
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
Expand Down
6 changes: 3 additions & 3 deletions cpp/moq/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# moq C++ package

C++17 bindings for [rs/moq-ffi](../../rs/moq-ffi): the sources `uniffi-bindgen-cpp` generates, plus `include/moq/moq.hpp`, a thin layer that adds the executor, shutdown, and `co_await` glue. `uniffi.toml` strips moq-ffi's `Moq` type prefix, so `MoqClient` is generated as `moq::Client`. Nothing here re-implements a method; a shape problem is fixed in moq-ffi, where every binding benefits. User docs: [doc/lib/cpp](../../doc/lib/cpp/index.md).
C++17 bindings for [rs/moq-ffi](../../rs/moq-ffi): the sources `uniffi-bindgen-cpp` generates, plus `include/moq/moq.hpp`, a thin layer that adds the executor, shutdown, and `co_await` glue. `uniffi.toml` strips moq-ffi's `Moq` type prefix and `moq_` function prefix, so `MoqClient` is generated as `moq::Client` and `moq_mint_epoch` as `moq::mint_epoch`. Nothing here re-implements a method; a shape problem is fixed in moq-ffi, where every binding benefits. User docs: [doc/lib/cpp](../../doc/lib/cpp/index.md).

## Layout

Expand All @@ -14,12 +14,12 @@ C++17 bindings for [rs/moq-ffi](../../rs/moq-ffi): the sources `uniffi-bindgen-c

`just cpp check` builds and installs the package, builds the probe against it with `find_package` at C++17 and C++23 and, outside Windows, with pkg-config at C++17, runs each, and compiles the doc samples (also outside Windows). It also builds the probe at C++23 over bindings at C++17, to prove the two link. The probe builds with exceptions and RTTI disabled. `just cpp check --archive FILE` runs the same consumer checks against an extracted release archive, without rebuilding the package. Release dry runs check every archive this way.

The generator is a fork, [kixelated/uniffi-bindgen-cpp](https://github.com/kixelated/uniffi-bindgen-cpp). It carries LiveKit's async support ported to uniffi 0.32, plus the `error_style = "expected"` and `strip_type_prefix` options `uniffi.toml` turns on. The dev shell provides it. Without Nix:
The generator is a fork, [kixelated/uniffi-bindgen-cpp](https://github.com/kixelated/uniffi-bindgen-cpp). It carries LiveKit's async support ported to uniffi 0.32, plus the `error_style = "expected"`, `strip_type_prefix`, and `strip_function_prefix` options `uniffi.toml` turns on. The dev shell provides it. Without Nix:

```bash
cargo install uniffi-bindgen-cpp --locked \
--git https://github.com/kixelated/uniffi-bindgen-cpp \
--tag v0.11.0-kixelated.5+v0.32.2
--tag v0.11.0-kixelated.6+v0.32.2
```

`flake.nix` pins the same tag and lists every other place that names it.
Expand Down
30 changes: 1 addition & 29 deletions cpp/moq/include/moq/moq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <functional>
#include <string>
#include <utility>
#include <vector>

#if defined(__cpp_impl_coroutine) && __has_include(<coroutine>)
#include <coroutine>
Expand Down Expand Up @@ -63,38 +62,11 @@ inline void shutdown() noexcept {
::uniffi::shutdown_async_dispatcher();
}

// Sets the log level: "error", "warn", "info", "debug", "trace", or "". Errors if called twice.
inline expected<void> log_level(const std::string &level) {
return moq_log_level(level);
}

// The settings a default ClientConfig dials with, for a settings UI to show. Knobs whose default
// depends on the backend (GSO, path MTU discovery, congestion control, system roots) stay unset.
inline ClientConfig client_defaults() {
return moq_client_defaults();
}

// The protocol versions offered by default, most preferred first, as ClientConfig::versions spells them.
inline std::vector<std::string> versions() {
return moq_versions();
}

// Whether this build can write qlog traces for QuicConfig::qlog.
inline bool qlog_supported() {
return moq_qlog_supported();
}

// Mints a fresh publisher epoch, ordered newest last. Announce one per run in AnnounceRoute::epoch,
// so viewers see a restart as a new broadcast instead of a stalled one.
inline std::string mint_epoch() {
return moq_mint_epoch();
}

// The wall-clock time an epoch encodes, to the millisecond. Errors unless it is a UUIDv7.
// Millisecond ticks hold every 48-bit UUIDv7 time, where system_clock's nanoseconds overflow in 2262.
inline expected<std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>>
epoch_time(const std::string &epoch) {
auto ms = moq_epoch_time_ms(epoch);
auto ms = epoch_time_ms(epoch);
if (!ms) {
return unexpected(std::move(ms).error());
}
Expand Down
3 changes: 2 additions & 1 deletion cpp/moq/uniffi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
# bindings build with exceptions disabled (Unreal's default).
[bindings.cpp]
error_style = "expected"
# moq-ffi prefixes its types for languages without namespaces; C++ has `moq::`.
# moq-ffi prefixes its types and free functions for languages without namespaces; C++ has `moq::`.
strip_type_prefix = "Moq"
strip_function_prefix = "moq_"
14 changes: 7 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -402,22 +402,22 @@
#
# This points at a fork of LiveKit's async branch (livekit/uniffi-bindgen-cpp
# PR #1): neither LiveKit nor NordSecurity has a uniffi 0.32 generator,
# and the fork adds `error_style = "expected"` and `strip_type_prefix`,
# which cpp/moq/uniffi.toml turns on. Its tags add a `-kixelated.N`
# pre-release so they never collide with upstream's. Move back upstream
# once one tags both.
# and the fork adds `error_style = "expected"`, `strip_type_prefix`, and
# `strip_function_prefix`, which cpp/moq/uniffi.toml turns on. Its tags
# add a `-kixelated.N` pre-release so they never collide with upstream's.
# Move back upstream once one tags both.
uniffi-bindgen-cpp = pkgs.rustPlatform.buildRustPackage rec {
pname = "uniffi-bindgen-cpp";
version = "0.11.0-kixelated.5+v0.32.2";
version = "0.11.0-kixelated.6+v0.32.2";

src = pkgs.fetchFromGitHub {
owner = "kixelated";
repo = "uniffi-bindgen-cpp";
rev = "v${version}";
hash = "sha256-y148irMNOsMrfjbUT/f3jlNmpxT0/z/2LVlP+t1oq8I=";
hash = "sha256-r0O/iAad2Z82KhG+6AOvqESAktaR7THQQVoR2CyP+ok=";
};

cargoHash = "sha256-QBURLIg255O6J4A+wzZVk4cUJPdJb6JepZKofX0fLZg=";
cargoHash = "sha256-0YWQF8eSUsemU0Y3jgZh7Kgtno/58zBAxPYpcBwPRuk=";

# The workspace's other member is the fixture crate, which pulls the
# uniffi examples in from git; build only the generator.
Expand Down
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ audit's receive-memory, priority, and lease bugs rank ahead of that reshape.
- [JSON encoder options without a downcast](/quest/m1/json-encoder-options.md) - moq-mux's `json_snapshot` takes its `deltas` switch through a typed path any custom catalog entry can use, not an `Any` downcast
- [CI housekeeping](/quest/m1/ci-housekeeping.md) - validate queue nextest at 24 threads and remove the actionlint queue ignore after its release
- [Main is no slower than release](/quest/m1/release-perf/README.md) - every benchmark where main is slower than release is fixed or accepted with a reason, checked by a final paired run before the cut
- [Unprefixed C++ free functions](/quest/m1/cpp-free-function-prefix.md) - generated free functions drop `moq_`, and `moq.hpp` deletes its five pass-through wrappers before C++ first publishes
- [API-diff check](/quest/m1/api-diff.md) - a recipe diffs every published package's API against its last release, run on PRs into release and against main before the cut
- [API Extractor checks](/quest/m1/api-extractor-checks.md) - API Extractor fails a PR on a forgotten export, an unresolved declaration, or an undocumented export, replacing the hand-rolled `.d.ts` checkers
- [Generated JS API reference](/quest/m1/js-api-reference.md) - the doc site renders an API reference for every `@moq/*` package from API Extractor's doc model
Expand Down
29 changes: 0 additions & 29 deletions quest/m1/cpp-free-function-prefix.md

This file was deleted.

2 changes: 1 addition & 1 deletion rs/moq-ffi/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ generate_bindings() {

# C++ uses a third-party bindgen too: a fork carrying LiveKit's async support
# ported to uniffi 0.32, which upstream has not released. Install it with:
# cargo install --locked uniffi-bindgen-cpp --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.5+v0.32.2
# cargo install --locked uniffi-bindgen-cpp --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.6+v0.32.2
if command -v uniffi-bindgen-cpp >/dev/null 2>&1; then
echo " Generating cpp bindings..."
uniffi-bindgen-cpp --library "$lib_path" \
Expand Down
2 changes: 1 addition & 1 deletion test/interop/clients/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ int main(int argc, char **argv) {
fail("--url and --broadcast are required");
}
// Warnings and errors from the Rust layer, such as a publication outside the grant.
ok(moq::moq_log_level("warn"), "log level");
ok(moq::log_level("warn"), "log level");

if (role == "publish") {
if (tones.empty()) {
Expand Down
Loading