Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

james-rms
Copy link

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.

Copy link
Collaborator

@cpetig cpetig left a comment

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
Copy link
Collaborator

cpetig commented Jul 21, 2025

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
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
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?

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