Skip to content

build: pin uniffi-bindgen-cpp with C durations - #6683

Merged
kixelated merged 5 commits into
mainfrom
quest/m1/c/duration
Oct 25, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest/m1/c/duration

Conversation

@kixelated

@kixelated kixelated commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m1/c/duration.md. The C backend of our uniffi-bindgen-cpp fork now renders UniFFI's builtin Duration, which unblocks binding durations. The generator change merged as kixelated/uniffi-bindgen-cpp#6 and is tagged v0.11.0-kixelated.7+v0.32.2.

Changes

  • Pins uniffi-bindgen-cpp to v0.11.0-kixelated.7+v0.32.2 everywhere the flake comment lists it: flake.nix, rs/moq-ffi/build.sh, cpp/moq/README.md, and the cpp, platform, release-cpp, and release-shared-ffi workflows.
  • Deletes the quest and its links. Updates the binding durations plan with what the generated C does now.

What the generator does

  • Generated C spells a duration moq_duration, a typedef int64_t count of nanoseconds. That mirrors C++'s std::chrono::nanoseconds and Go's time.Duration. Option<Duration> is { has_value, value }, like the other optional scalars.

  • The C++ converter, which C goes through, used to silently corrupt out-of-range values:

    • A negative duration reached Rust as about 584 billion years.
    • A Rust duration longer than INT64_MAX nanoseconds (about 292 years) overflowed.

    Both now fail. Under cpp/moq's expected style, the failure is an abort with a message.

  • The binding durations quest now notes that moq-ffi must not return a saturated Duration::MAX where it clamps to u64::MAX microseconds today (auth.rs, session.rs). C and C++ would abort on it.

Decisions made

  • A typedef rather than a bare int64_t, so the unit shows on every field, argument, and return.
  • The range check sits in the shared C++ converter, not in a C-only one. C++ users get it too, and there is one check.
  • The fork PR carried its own release commit, as kixelated/uniffi-bindgen-cpp#5 did. The flake hashes computed against the PR head therefore still match the tag: nix build --rebuild .#uniffi-bindgen-cpp.src refetched the tag and verified the same hash, and the generator builds from it.

Impact

  • Public API: none yet. moq-ffi exports no Duration, so the generated C and C++ are unchanged. The binding durations quest is the first consumer.
  • Wire: none.

Checks

  • just check fails at check flake. nix flake check builds the github-runner image, and systemd-repart cannot unshare in this sandbox. That failure is known and cancelled the other lanes.
  • I then ran every lane this diff selects, one at a time; all pass:
    • rs check and test (moq-ffi)
    • js check and test
    • py check and test
    • kt, go, dart, and cpp
    • obs compile and obs check
    • markdown and gh check and test
    • quest and drill
    • shell, large_files, toml, nix, and justfile
  • swift skipped locally because there is no Swift toolchain on Linux.
  • Fork CI passed on Linux, macOS, and Windows, including valgrind memcheck.

Follow-ups

  • The fork's C++ lowering still leaks the buffers of earlier arguments when a later argument's converter throws. That happens only under the exceptions style, so not in cpp/moq. The leak predates this change; the new duration refusal is now one more way to hit it.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Quest-Claim: edce8e1e23c5e549
kixelated and others added 2 commits October 24, 2026 12:22
Pins the fork commit that renders UniFFI's Duration in the generated C,
kixelated/uniffi-bindgen-cpp#6, until it is tagged
v0.11.0-kixelated.7+v0.32.2. Finishes quest/m1/c/duration.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Durations in generated C build: pin uniffi-bindgen-cpp with C durations Oct 24, 2026
@kixelated
kixelated marked this pull request as ready for review October 24, 2026 21:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T21:48:35.427101Z eb3fd50 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 812148f1-153e-4fd6-afaf-53e9f87de928
Commits

Reviewing files that changed from the base of the PR and between 8ee7728 and eb3fd50.

Files selected for processing: 10
  • .github/workflows/cpp.yml
  • .github/workflows/platform.yml
  • .github/workflows/release-cpp.yml
  • .github/workflows/release-shared-ffi.yml
  • cpp/moq/README.md
  • flake.nix
  • quest/m1/c/README.md
  • quest/m1/c/duration.md
  • quest/m1/ffi-durations.md
  • rs/moq-ffi/build.sh
Files with no reviewable changes: 2
  • quest/m1/c/README.md
  • quest/m1/c/duration.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

Walkthrough

The uniffi-bindgen-cpp pin changes to v0.11.0-kixelated.7+v0.32.2 across workflows, package configuration, and installation instructions. The duration planning notes now describe the generated C representation and the C and C++ nanosecond limit. The separate C-duration quest and its prerequisite reference are removed.

Priority: Low

Merge Risk: Minimal · up to eb3fd

The changes are consistent across workflows, packaging, documentation, and duration planning notes.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "build: pin uniffi-bindgen-cpp with C durations" matches the main change. The PR bumps the pinned uniffi-bindgen-cpp fork tag to v0.11.0-kixelated.7+v0.32.2 across flake, build script, READM…
Description check Passed The description matches the changeset. It states the pin to v0.11.0-kixelated.7+v0.32.2 in flake.nix, rs/moq-ffi/build.sh, cpp/moq/README.md, and the cpp, platform, release-cpp, and release-shared-ffi…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (7 skipped: 7 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "build: pin uniffi-bindgen-cpp with C durations" matches the main change. The PR bumps the pinned uniffi-bindgen-cpp fork tag to v0.11.0-kixelated.7+v0.32.2 across flake, build script, README, and workflows. That release adds C rendering for UniFFI's builtin Duration, which the title names. The title does not mention the quest deletion or the range-check behavior, but it does not need to cover every detail.

Full details: Description check

Explanation

The description matches the changeset. It states the pin to v0.11.0-kixelated.7+v0.32.2 in flake.nix, rs/moq-ffi/build.sh, cpp/moq/README.md, and the cpp, platform, release-cpp, and release-shared-ffi workflows. It also describes the C Duration mapping, the deleted quest, the updated binding durations plan, and the testing performed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (7 skipped: 7 unsupported.)

Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging eb3fd50 with the maintainer's approval. The non-Grok review of this head is clean, every finding is fixed or answered, and the pre-land quest check passes against origin/main.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 25767e9 Oct 25, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m1/c/duration branch October 25, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant