Skip to content

docs(quest): the generated C names follow GLib - #6793

Merged
kixelated merged 6 commits into
mainfrom
quest/m1/c/name-clash
Oct 26, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m1/c/name-clash

Conversation

@kixelated

@kixelated kixelated commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The generated C method MoqAudioEncoder::finish and record MoqAudioEncoderFinish both become moq_audio_encoder_finish, and the generator refuses moq-ffi. The naming rule that fixes it was open.

Approach

Records the maintainer's rule and its reason in the quest Plan. The rule is implemented in rust2's UniFFI fork: kixelated/rust2#66.

  • Types are CamelCase with the namespace prefix, GLib style: MoqAudioEncoder, MoqAudioEncoderFinish, MoqError, MoqTask, and callback typedefs such as MoqAudioEncoderFinishCallback.
  • Functions stay snake_case with no infix: moq_audio_encoder_finish(enc), moq_audio_encoder_new, moq_audio_encoder_free, moq_error_message.
  • A type and a function can never share an identifier, so no rename table is needed. Any clash that remains, such as two functions with one name, is refused at generation with both items named.
  • rust2's exporter (ffi/), which replaces the fork, adopts the same rule instead of path names plus a [rename] table.

The quest now waits on rust2#66 and is deleted once it merges. moq picks the rule up through the switch to rust2's UniFFI (quest/m2/uniffi-fork.md), which owns the generator pin; flake.nix stays on kixelated/uniffi-bindgen-cpp until then. The generated moq-c package (moq-dev/moq#6052) adopts these names then. quest/m1/c/README.md drops its stale "names are the uniffi names in snake case".

moq-dev/moq#6798 moves this quest to quest/m2/c/; whichever merges second carries these edits across the rename.

Decisions (maintainer, 2026-10-25)

Generated C naming rule

  • ✅ GLib/GStreamer style: CamelCase types, snake_case functions
  • Explicit method namespace (moq_audio_encoder_method_finish), chosen first and then superseded
  • Uniform type naming change while keeping short function names
  • Path names plus a [rename] table

Where the fix lands

  • ✅ rust2's UniFFI fork
  • A kixelated/uniffi-bindgen-cpp release

rust2's exporter naming

  • ✅ The same rule
  • Path names plus a [rename] table

Impact

  • Public API: none in moq. The generated C (not shipped yet) uses CamelCase types once moq builds from rust2.
  • Wire: none.

Validation

  • quest check --base origin/main and git diff --check pass.
  • rust2#66: just check, just uniffi test, and all 31 C/C++ fixture tests pass. moq-ffi generates with no clash and its moq.h compiles as C11, with Duration stubbed (see Follow-ups).

Follow-ups

  • The rust2 C backend refuses Duration, which moq-ffi now uses: generation drift the generated C line must close.
  • rust2's exporter moves to the GLib rule, recommended as a rust2 quest.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 25, 2026 09:05
Quest-Claim: 22ba9ae6cd0ef459
Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated kixelated changed the title One C name per moq-ffi item docs(quest): settle the generated C naming rule Oct 25, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decisions (2026-10-25):

  • The naming rule is an explicit method namespace.
  • The fix lands in rust2's UniFFI fork, not in a uniffi-bindgen-cpp release.
  • The generated C line moves after the cut.

moq-dev/moq#6798 records this in the quest, which moves to quest/m2/c/name-clash.md. That makes this PR's doc change redundant, so it can likely be closed once #6798 merges (left for the maintainer to confirm).

(Written by Claude Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title docs(quest): settle the generated C naming rule docs(quest): record the generated C method namespace rule Oct 25, 2026
@kixelated
kixelated marked this pull request as ready for review October 25, 2026 22:56
@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 70083114-06d6-44d5-afe0-55938bd12ac6
Commits

Reviewing files that changed from the base of the PR and between 011402e and ec66733.

Files selected for processing: 2
  • quest/m1/c/README.md
  • quest/m1/c/name-clash.md
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T23:57:20.835325Z 7c9f277 New commits
ℹ️ 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 25, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: bbe81fdc-5618-4844-b6e5-867f8a005fb6
Commits

Reviewing files that changed from the base of the PR and between 2feb88b and 7c9f277.

Files selected for processing: 2
  • quest/m1/c/README.md
  • quest/m1/c/name-clash.md
  • 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 kixelated left a comment

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.

Automated review by review (OpenAI)

Reviewed commit: ec66733

No actionable bugs found in this planning change. The explicit method namespace is a simple, consistent way to separate methods/named constructors from types without lengthening every type name; rejecting residual collisions is preferable to silently renaming symbols. The callback naming and fixed-name exceptions are stated, and the generator-pin handoff remains explicitly owned by the UniFFI-switch quest.

Verification limits: static inspection of the two changed documents and surrounding migration plans only. No builds/tests were run; the documented C11 check used a Duration stub, so this is not confirmation that the current moq-ffi header generates or builds unmodified.

@kixelated kixelated changed the title docs(quest): record the generated C method namespace rule docs(quest): the generated C names follow GLib Oct 25, 2026

@kixelated kixelated left a comment

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.

Automated review by review (OpenAI)

Reviewed commit: 7c9f277

No new actionable bugs found in the planning delta since ec66733. This substantively replaces the previously reviewed _method_ convention with CamelCase types and unchanged snake_case functions. The updated parent plan, callback/compound naming, and explicit rejection of residual same-kind collisions are consistent; aligning both exporters on one convention avoids a second planned naming migration. The generator-pin handoff remains explicit.

Verification limits: static review of the two changed documents and surrounding migration plan, accounting for the merged base changes. No builds/tests run or downstream exporter behavior verified. The recorded C11 check still uses a Duration stub and is not proof of an unmodified moq-ffi build.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Landing 7c9f277 through the merge queue.

  • Maintainer decision (2026-10-25): generated C names follow GLib, with CamelCase types (MoqAudioEncoderFinish, MoqTask, MoqAudioEncoderFinishCallback) and snake_case functions with no infix (moq_audio_encoder_finish). This supersedes the _method_ namespace, and rust2's exporter adopts the same rule.
  • The implementation is kixelated/rust2#66. This quest stays until that merges.
  • Review: the OpenAI review of this head found nothing, and Codex gave a thumbs-up. quest check --base origin/main passes.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit b839fa3 Oct 26, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m1/c/name-clash branch October 26, 2026 00:41
kixelated added a commit that referenced this pull request Oct 26, 2026
…anning-700add

Carry #6793's GLib C naming into the moved m2/c line, keep the hand-written
m1/c plan, drop links to the finished name-reuse quest (#6780), and note
that the JS publication mirror (#6795) merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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