Skip to content

Strip a function prefix (v0.11.0-kixelated.6+v0.32.2) - #5

Merged
kixelated merged 3 commits into
kixelated/uniffi-0.32from
kixelated/strip-function-prefix
Oct 23, 2026
Merged

kixelated merged 3 commits into
kixelated/uniffi-0.32from
kixelated/strip-function-prefix

Conversation

@kixelated

@kixelated kixelated commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

One generator change for moq's C++ package, shipped as v0.11.0-kixelated.6+v0.32.2 and pinned by moq-dev/moq#6476.

strip_function_prefix

[bindings.cpp] strip_function_prefix = "foo_" names a top-level function foo_connect as connect, the way strip_type_prefix does for types. moq-ffi prefixes every free function with moq_ for languages without namespaces; with this, cpp/moq drops its pass-through wrappers and each function has one name.

  • Renames go through uniffi's own rename, so FFI symbols and checksums are untouched.
  • Only a remainder starting with a lowercase letter is renamed, and methods keep their names.
  • Generation fails if a stripped name is already a function or a C++ keyword, since fn_name does not escape keywords.
  • Function renames stay out of the type oracle's rename map, which only covers types.

Tests

  • expected-test adds strip_function_prefix = "capi_" and calls capi::checksum, capi::fail, and async capi::sum.
  • strip-function-prefix-collision-test: async_maybe_ collides async_maybe_new_megaphone with new_megaphone. --config applies to every crate in the fixtures library, in a platform-dependent order, so each refusal test uses a prefix that hits only one crate.
  • strip-function-prefix-keyword-test: oops_ on error-types turns oops_enum into enum.

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 22, 2026 21:40
strip_function_prefix drops a prefix from top-level function names, the way strip_type_prefix does for types, refusing a rename onto an existing function or a C++ keyword.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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 🔄 Running since 2026-10-23T16:49:38.503069Z 353597a PR opened
🔒 Security Review ✅ Completed 2026-10-23T16:52:28.131242Z 353597a PR opened
ℹ️ 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.

--config applies to every crate in the fixtures library, and their order varies by platform, so async_ hit coverall's async_bool first on Windows. async_maybe_ collides only in async-calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated merged commit 4cce88c into kixelated/uniffi-0.32 Oct 23, 2026
5 checks passed
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.

1 participant