Skip to content

c/lib.rs: dtor symbols should use name, not snake - #1341

Closed
james-rms wants to merge 1 commit into
bytecodealliance:mainfrom
james-rms:jrms/cpp-dtor-no-snake
Closed

c/lib.rs: dtor symbols should use name, not snake#1341
james-rms wants to merge 1 commit into
bytecodealliance:mainfrom
james-rms:jrms/cpp-dtor-no-snake

Conversation

@james-rms

Copy link
Copy Markdown

I noticed this discrepancy between the symbols generated by the rust and C binding generators - this change should (hopefully) make it so that rust and C/C++ implementers can build components that are compatible with eachother.

@cpetig cpetig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like an obvious correction to me.
(Snake case is never used in webassembly, will probably have worked for easy cases (names without minus))

@cpetig

cpetig commented Jul 21, 2025

Copy link
Copy Markdown
Collaborator

I guess it would be possible to extend the runtime tests to cover this error (fail before, pass after) by implementing a resource in C which has a more complex name.

@james-rms

Copy link
Copy Markdown
Author

I'm not really familiar enough with the test framework to make that change. Note that this bug case only comes up when we generate bindings using C, and try to consume the resulting component with bindings generated in some other language.

@alexcrichton

Copy link
Copy Markdown
Member

Tests are located here with a basic readme located here and you can find some C-specific tests here. With those bits would you be up for adding a test?

@james-rms

Copy link
Copy Markdown
Author

I took a look at that for a few hours and couldn't figure out how to add a test that compares the output of two different generators. I'm not going to put more work into this patch, feel free to close or merge as needed.

@james-rms james-rms closed this Dec 1, 2025
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.

3 participants