Skip to content

chore: bump mopro-ffi/cli to 0.3.6, pin template to fix Kotlin CI#706

Merged
moven0831 merged 1 commit into
mainfrom
chore/bump-mopro-ffi-0.3.6
May 27, 2026
Merged

chore: bump mopro-ffi/cli to 0.3.6, pin template to fix Kotlin CI#706
moven0831 merged 1 commit into
mainfrom
chore/bump-mopro-ffi-0.3.6

Conversation

@moven0831
Copy link
Copy Markdown
Collaborator

Summary

  • Bumps mopro-ffi and mopro-cli from 0.3.40.3.6 (skipping the poisoned 0.3.5 slot on crates.io).
  • Pins the mopro init template (cli/src/init/write_toml.rs) to mopro-ffi = "=0.3.6" (exact-version pin) so a future bad release in the 0.3.x range cannot silently break the template again.

Why

Every cli_template_tests matrix job on main has been red since 2026-03-16 with:

…/uniffi/mopro_example_*/mopro_example_*.kt:83:46: warning: redundant call of conversion method.
this.data?.getByteBuffer(0, this.len.toLong())?.also {
error: warnings found and -Werror specified
test uniffi_foreign_language_testcase_test_ffi_hello_world_kts ... FAILED

Root cause:

  1. The workspace already pins uniffi = "=0.31.0" (PR chore: update dependencies and refactor uniffi integration #658). UniFFI 0.31 fixed the redundant .toLong() in RustBufferTemplate.kt:50 (0.29 emits this.len.toLong(), 0.31 emits this.len).
  2. The template generated by mopro init depends on mopro-ffi = "0.3.4" (cli/src/init/write_toml.rs:19,35,43). Cargo resolves that to the latest published 0.3.x on crates.io, which is mopro-ffi 0.3.5 — released on 2026-03-08 from the origin/v0.3.5 branch (based on a pre-chore: update dependencies and refactor uniffi integration #658 main), still locked to uniffi =0.29.0. Verified via the crates.io dependency API.
  3. UniFFI's bindgen-tests feature runs kotlinc -Werror. A recent GitHub Actions runner-image refresh bumped kotlinc to a release that flags the redundant .toLong() as a warning — which becomes a fatal error under -Werror.

Regression bisect confirms the break is environmental, not source: last green run was ef60c27 (2026-03-03), first red run was 6e59bac (2026-03-16), and the only intermediate commit on main is a docs-only blog post (#702).

cli_build_android (gradle) is unaffected; only the Kotlin UniFFI foreign-language test in cli_template_tests fails. The Swift sibling test (…_test_ffi_hello_world_swift) passes.

Publishing (post-merge)

There's no release workflow in this repo; previous releases were manual. After merge:

git checkout main && git pull
cargo publish -p mopro-ffi
cargo publish -p mopro-cli
git tag v0.3.6 && git push --tags

Then verify on crates.io that mopro-ffi 0.3.6 lists uniffi 0.31.x under Dependencies.

⚠️ Until mopro-ffi 0.3.6 is on crates.io, this PR's own CI will fail to resolve the new =0.3.6 pin in the template. The fix only goes green on main once the publish step above completes and CI is re-run there.

Out of scope

cli/src/bindgen.rs:166-167 still references a stale mopro-ffi = { version = "0.3.2", features = ["uniffi"] } literal that no longer matches what write_toml.rs emits — this silently breaks the witnesscalc-adapter path. Unrelated to the Kotlin CI failure; flagging here so it doesn't get lost.

Test plan

  • CI: cli_template_tests (5 adapters × 2 OSes) goes green on main after mopro-ffi 0.3.6 is published.
  • Manual: on a clean machine, cargo install --path cli && mopro init testproj && cd testproj && cargo test --all --all-features succeeds end-to-end.
  • Crates.io: curl -s https://crates.io/api/v1/crates/mopro-ffi/0.3.6/dependencies shows uniffi 0.31.x, not =0.29.0.

🤖 Generated with Claude Code

Crates.io's `mopro-ffi 0.3.5` was published from the `v0.3.5` side-branch,
which is based on a pre-PR-#658 main and still depends on `uniffi =0.29.0`.
The `mopro init` template (cli/src/init/write_toml.rs) depends on
`mopro-ffi = "0.3.4"`, which Cargo resolves to that broken 0.3.5 release.
uniffi 0.29's Kotlin generator emits `this.len.toLong()` on a value that
is already `Long` (fixed upstream in 0.31's RustBufferTemplate.kt:50). A
recent GitHub Actions runner-image refresh bumped kotlinc to a version
that flags this as a "redundant call of conversion method" warning, and
uniffi's `bindgen-tests` feature runs `kotlinc -Werror`, so every
`cli_template_tests` job has been red on main since 2026-03-16.

Workspace main is already on `uniffi =0.31.0`. Bumping mopro-ffi and
mopro-cli to 0.3.6 (skipping the poisoned 0.3.5 slot), publishing to
crates.io, and pinning the template to `=0.3.6` fixes CI and prevents
the same class of breakage from a future poisoned release.

Note: cli/src/bindgen.rs:166-167 still references a stale `0.3.2` /
`features = ["uniffi"]` literal that no longer matches what the template
emits — that's an unrelated witnesscalc-adapter bug to address separately.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mopro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 20f5eff
Status: ✅  Deploy successful!
Preview URL: https://0d461d53.mopro.pages.dev
Branch Preview URL: https://chore-bump-mopro-ffi-0-3-6.mopro.pages.dev

View logs

@moven0831 moven0831 merged commit b70b6b8 into main May 27, 2026
30 of 53 checks passed
@moven0831 moven0831 deleted the chore/bump-mopro-ffi-0.3.6 branch May 27, 2026 04:20
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