-
Notifications
You must be signed in to change notification settings - Fork 203
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
C: handling of @deprecated
items results in breaking changes
#1156
Comments
@deprecated
items results in breaking changes@deprecated
items results in breaking changes
@brendanburns what version of wit-bindgen are you using? What is the command? Are you using the I am not seeing |
Looking closer at the change in https://github.com/WebAssembly/wasi-http/pull/127/files#diff-a8f42ac7cc164b46639a30d22f97ca796bd47991da55edc0022578930424be06 It seems the tuple that was defined as
This is a super subtle change to the wit that the binding generator no longer needs that tuple type |
by changing that function signature, at least the way the c bindings generated works it was a breaking change. In C# the tuple is only typed as a string and so wouldn't change. I don't know enough about the c binding generator to know if tuples need to be typed strongly like that... |
Thank you for tracking this down further @jsturtevant! |
The change @jsturtevant highlighted makes sense to me and I agree that's probably what caused the breakage here. In general without actual tuple types in C we're left to do the "next best thing". Currently it's a correct assessment that non-breaking changes in WIT can result in breaking changes in the bindings for C, and I'm not sure what to do about that. |
In WebAssembly/wasi-http#133 @brendanburns reported that upgrading from
wasi/[email protected]
towasi/[email protected]
resulted in breaking changes inwit-bindgen
's C output, causing the following error:This seems to point at an issue handling
@deprecated
in WIT. Specifically WebAssembly/wasi-http#127 which markedfield-key
as deprecated:+ @deprecated(version = 0.2.2) type field-key = string;
The intent of the
@deprecated
tag is to enable both tooling and host runtimes to alert users an API should no longer be used. But crucially: the API is still considered a required part of the WIT document and is part of the public contract.@deprecated
types not being generated by wit-bindgen targeting C strikes me as a bug we should fix.The text was updated successfully, but these errors were encountered: