From 21d034bfc5cbc7291502d9da9f8b95b387bf8f01 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 22 Oct 2026 20:56:16 -0700 Subject: [PATCH 1/4] chore(quest): claim quest/m1/cpp-free-function-prefix.md Quest-Claim: c281aaeb868af53c From 66983631a06abed268d251ade5a8b7295d06b02b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 22 Oct 2026 21:42:53 -0700 Subject: [PATCH 2/4] feat(cpp)!: generate unprefixed free functions cpp/moq/uniffi.toml sets the generator's new strip_function_prefix = "moq_", so moq::log_level and friends are the generated functions, and moq.hpp drops its five pass-through wrappers. The generator pin moves to v0.11.0-kixelated.6+v0.32.2. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cpp.yml | 2 +- .github/workflows/platform.yml | 4 ++-- .github/workflows/release-cpp.yml | 2 +- .github/workflows/release-shared-ffi.yml | 2 +- cpp/moq/README.md | 6 ++--- cpp/moq/include/moq/moq.hpp | 30 +----------------------- cpp/moq/uniffi.toml | 3 ++- flake.nix | 14 +++++------ quest/m1/README.md | 1 - quest/m1/cpp-free-function-prefix.md | 29 ----------------------- rs/moq-ffi/build.sh | 2 +- test/interop/clients/cpp/main.cpp | 2 +- 12 files changed, 20 insertions(+), 77 deletions(-) delete mode 100644 quest/m1/cpp-free-function-prefix.md diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index a61341a5920..5a804692b2e 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -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 diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 1ef63cb0b26..921ec319de7 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -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 @@ -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: diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml index 98b6d88d541..d64bf51b862 100644 --- a/.github/workflows/release-cpp.yml +++ b/.github/workflows/release-cpp.yml @@ -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 diff --git a/.github/workflows/release-shared-ffi.yml b/.github/workflows/release-shared-ffi.yml index ee699e05f3c..25dbe695f7c 100644 --- a/.github/workflows/release-shared-ffi.yml +++ b/.github/workflows/release-shared-ffi.yml @@ -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: diff --git a/cpp/moq/README.md b/cpp/moq/README.md index 7e7bfc04e49..6741ab9e770 100644 --- a/cpp/moq/README.md +++ b/cpp/moq/README.md @@ -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 @@ -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. diff --git a/cpp/moq/include/moq/moq.hpp b/cpp/moq/include/moq/moq.hpp index 495830cace7..58dc5805260 100644 --- a/cpp/moq/include/moq/moq.hpp +++ b/cpp/moq/include/moq/moq.hpp @@ -8,7 +8,6 @@ #include #include #include -#include #if defined(__cpp_impl_coroutine) && __has_include() #include @@ -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 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 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 Route::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> 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()); } diff --git a/cpp/moq/uniffi.toml b/cpp/moq/uniffi.toml index 1f910872903..dab402d70b5 100644 --- a/cpp/moq/uniffi.toml +++ b/cpp/moq/uniffi.toml @@ -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_" diff --git a/flake.nix b/flake.nix index 4d6d27e5ff8..b6107162193 100644 --- a/flake.nix +++ b/flake.nix @@ -399,22 +399,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-mXCNFHbAwMOvjAAwt099LQESFSdGjUL8Nyx4yrr1zt8="; }; - 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. diff --git a/quest/m1/README.md b/quest/m1/README.md index afb1c5d6779..749cf5f6907 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -149,7 +149,6 @@ tracks, so per-group stats stop costing cluster announces. - [Fragmented QUIC sends](/quest/m1/quic-send-fragments.md) - a chunk-size by retained-flight sweep decides whether `SendBuffer::get`'s front-to-back scan needs a cursor or index - [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 - [Subscribe update camera check](/quest/m1/subscribe-update-churn.md) - a person checks a physical-camera publish for SUBSCRIBE_UPDATE chatter; bbb and the fake camera measured quiet -- [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 - [Error cleanups](/quest/m1/error-cleanups.md) - delete the unused `Error::SessionClosed`; raw transport failures already map to `Unroutable` - [FromStr parsers](/quest/m1/from-str-trait.md) - hang, moq-auth, and moq-msf implement `FromStr` instead of inherent `from_str` - [Drop dead items](/quest/m1/drop-dead-items.md) - the audit's uncalled public items and test helpers are removed diff --git a/quest/m1/cpp-free-function-prefix.md b/quest/m1/cpp-free-function-prefix.md deleted file mode 100644 index 6bfc28bb2d9..00000000000 --- a/quest/m1/cpp-free-function-prefix.md +++ /dev/null @@ -1,29 +0,0 @@ -# [S] Strip moq_ from generated C++ free functions - -## Goal - -Generated C++ free functions drop moq-ffi's `moq_` prefix the way generated -types already drop `Moq` (`strip_type_prefix` in `cpp/moq/uniffi.toml`), so -`moq::log_level` is the generated function itself. `moq.hpp` -(`cpp/moq/include/moq/moq.hpp`) then deletes its five pass-through wrappers: -`log_level`, `mint_epoch`, `client_defaults`, `versions` and -`qlog_supported`. - -## Plan - -Decided with the maintainer on 2026-10-17: the goal as drafted, the follow-up -#5727 deferred. Moved to m1 on 2026-10-22 (maintainer, from an external API -audit): the C++ package is unpublished, so stripping the prefix before its -first publication avoids shipping both the `moq::moq_*` names and their -wrappers. - -The option belongs in the uniffi-bindgen-cpp fork, released and pinned the -way #5727 pinned `strip_type_prefix` (every place that PR moved the pin). -`epoch_time` stays in `moq.hpp`, since it converts milliseconds to a -`time_point`, and calls the stripped `epoch_time_ms`. Callers in `cpp/obs` and -`doc/lib/cpp` already use the short names. The C++ package is unreleased, so -no upgrade note. Public API: C++ only, `moq::moq_*` free functions are gone. - -## Related - -- [Hard-fork the binding generator](/quest/m2/uniffi-fork.md) - where the generator option will live once the fork moves diff --git a/rs/moq-ffi/build.sh b/rs/moq-ffi/build.sh index ff6e18fced1..64ef4cb71ae 100755 --- a/rs/moq-ffi/build.sh +++ b/rs/moq-ffi/build.sh @@ -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" \ diff --git a/test/interop/clients/cpp/main.cpp b/test/interop/clients/cpp/main.cpp index 07ba24d24ce..1db4124ba3e 100644 --- a/test/interop/clients/cpp/main.cpp +++ b/test/interop/clients/cpp/main.cpp @@ -453,7 +453,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()) { From f21edaa2c8fcbf4ef39aafd2c39c8a665f7131c7 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 23 Oct 2026 09:50:48 -0700 Subject: [PATCH 3/4] docs(cpp): note the unprefixed free functions in MIGRATE.md Co-Authored-By: Claude Opus 5.5 --- cpp/moq/MIGRATE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpp/moq/MIGRATE.md b/cpp/moq/MIGRATE.md index f7e71829805..f61caef8608 100644 --- a/cpp/moq/MIGRATE.md +++ b/cpp/moq/MIGRATE.md @@ -4,6 +4,11 @@ How to update your code for each breaking change, newest first. ## Unreleased +### Generated free functions drop the `moq_` prefix (#6476) + +`moq::moq_foo` is `moq::foo`, the name `moq.hpp` already wrapped most of them as; `moq::moq_epoch_time_ms` is `moq::epoch_time_ms`. +Regenerate the C++ bindings with `uniffi-bindgen-cpp` `v0.11.0-kixelated.6+v0.32.2`. + ### A broadcast reference waits for its sibling's announcement (#6254) Resolving a rendition's `broadcast` reference, through `BroadcastConsumer::resolve` and the rendition-based subscribes and fetches, now waits for a sibling nothing announces yet instead of failing as unroutable, so a late sibling plays once it is announced. From b496d6d3cbb347aa1866d07fa08ca75dc7f5b42b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 23 Oct 2026 10:11:05 -0700 Subject: [PATCH 4/4] fix(nix): pin the published uniffi-bindgen-cpp .6 tag's hash Co-Authored-By: Claude Opus 5.5 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 41734fc5631..5958c41f8d6 100644 --- a/flake.nix +++ b/flake.nix @@ -414,7 +414,7 @@ owner = "kixelated"; repo = "uniffi-bindgen-cpp"; rev = "v${version}"; - hash = "sha256-mXCNFHbAwMOvjAAwt099LQESFSdGjUL8Nyx4yrr1zt8="; + hash = "sha256-r0O/iAad2Z82KhG+6AOvqESAktaR7THQQVoR2CyP+ok="; }; cargoHash = "sha256-0YWQF8eSUsemU0Y3jgZh7Kgtno/58zBAxPYpcBwPRuk=";