Skip to content

fix(nim-bindings): add all-endpoints test and fix installation_name ABI#66

Merged
osmaczko merged 1 commit intomainfrom
fix/nim-bindings-installation-name
Feb 28, 2026
Merged

fix(nim-bindings): add all-endpoints test and fix installation_name ABI#66
osmaczko merged 1 commit intomainfrom
fix/nim-bindings-installation-name

Conversation

@osmaczko
Copy link
Contributor

@osmaczko osmaczko commented Feb 25, 2026

Add nim-bindings/tests/test_all_endpoints.nim which imports bindings directly and calls every FFI proc, forcing the linker to include all symbols. This catches link-time and runtime issues that the pingpong example missed because unused symbols were optimised out.

Running the new test revealed an ABI mismatch in installation_name: the Rust function used an explicit out-parameter but ReprCString has only flat fields, so Nim emits it as a C return value.

CI now runs nimble test next to nimble pingpong.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens the Nim FFI coverage by adding an “all endpoints” test that forces the linker to pull in every exported symbol, and fixes an ABI mismatch for installation_name by changing it to return repr_c::String by value.

Changes:

  • Add test_all_endpoints.nim to call every Nim importc proc at least once (linker/symbol coverage + basic runtime sanity).
  • Fix installation_name ABI by switching from an explicit out-parameter to a return value on the Rust side.
  • Update Nimble/CI to run the new comprehensive test via nimble test.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
nim-bindings/tests/test_all_endpoints.nim New comprehensive endpoint/linker coverage test for Nim bindings.
nim-bindings/src/bindings.nim Updates doc comment around installation_name (ownership/freeing note removed).
nim-bindings/conversations_example.nimble Adds task test to compile/run the new all-endpoints test.
conversations/src/api.rs Changes installation_name to return repr_c::String directly (ABI fix).
.github/workflows/ci.yml Runs nimble test instead of nimble pingpong.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@osmaczko osmaczko force-pushed the fix/nim-bindings-installation-name branch from d6909d5 to 7988091 Compare February 26, 2026 09:27
@osmaczko osmaczko requested a review from kaichaosun February 26, 2026 09:27
@osmaczko osmaczko force-pushed the fix/nim-bindings-installation-name branch from 7988091 to 681c17c Compare February 26, 2026 10:40
@osmaczko osmaczko force-pushed the fix/nim-bindings-installation-name branch 2 times, most recently from a058472 to 73a598e Compare February 28, 2026 12:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add nim-bindings/tests/test_all_endpoints.nim which imports bindings
directly and calls every FFI proc, forcing the linker to include all
symbols. This catches link-time and runtime issues that the pingpong
example missed because unused symbols were optimised out.

Running the new test revealed an ABI mismatch in installation_name:
the Rust function used an explicit out-parameter but ReprCString has
only flat fields, so Nim emits it as a C return value.

CI now runs nimble test next to nimble pingpong.
@osmaczko osmaczko force-pushed the fix/nim-bindings-installation-name branch from 73a598e to 974d06d Compare February 28, 2026 12:17
@osmaczko osmaczko merged commit d006f20 into main Feb 28, 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.

4 participants