-
Notifications
You must be signed in to change notification settings - Fork 89
Is importname'
rule has a typo?
#391
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
Comments
Could you clarify what binary you're using and what you're seeing? Locally I see:
where the import starts at 0x12. That has an 00 leading prefix, |
#[allow(warnings)]
mod bindings;
use bindings::Guest;
struct Component;
impl Guest for Component {
fn add(x: i32, y: i32) -> i32 {
x + y
}
}
bindings::export!(Component with_types_in bindings);
package component:add;
/// An example world for the component to target.
world example {
export add: func(x: s32, y: s32) -> s32;
} In [dependencies]
wit-bindgen-rt = { version = "0.30.0", features = ["bitflags"] } Use
|
Starting in WebAssembly/component-model#263 the component model binary specification was updated in a technically breaking way to encode binaries differently. This was intended to be rolled out in a manner that minimized breakage however so bytecodealliance#1262 implemented validation where the prefix byte which changed was actually ignored if it was 0 or 1. The encoder at the time still emitted 1 as the prefix byte, however. The intention was that once the validator had percolated enough the encoder would switch to using 0. Unfortunately this change was basically forgotten about until now with WebAssembly/component-model#391, but now's probably "enough time passed" so the encoder is updated to emit a 0x00 leading byte in this situation instead of the historical 0x01 byte. This will start the transition period to eventually removing the validator's acceptance of the 0x01 byte.
Starting in WebAssembly/component-model#263 the component model binary specification was updated in a technically breaking way to encode binaries differently. This was intended to be rolled out in a manner that minimized breakage however so bytecodealliance#1262 implemented validation where the prefix byte which changed was actually ignored if it was 0 or 1. The encoder at the time still emitted 1 as the prefix byte, however. The intention was that once the validator had percolated enough the encoder would switch to using 0. Unfortunately this change was basically forgotten about until now with WebAssembly/component-model#391, but now's probably "enough time passed" so the encoder is updated to emit a 0x00 leading byte in this situation instead of the historical 0x01 byte. This will start the transition period to eventually removing the validator's acceptance of the 0x01 byte.
Ah thanks for clarifying! You've discovered a situation where wasm-tools was in a "halfway state" in transitioning from one format to another. I've opened bytecodealliance/wasm-tools#1753 to fix this to always emit the 0x00 prefix byte. In that sense this bug is in wasm-tools, not the spec itself, and the spec as-written is correct. |
I see, thanks for clarifying. |
* Proceed to the next step in the "remove `interface`" transition Starting in WebAssembly/component-model#263 the component model binary specification was updated in a technically breaking way to encode binaries differently. This was intended to be rolled out in a manner that minimized breakage however so #1262 implemented validation where the prefix byte which changed was actually ignored if it was 0 or 1. The encoder at the time still emitted 1 as the prefix byte, however. The intention was that once the validator had percolated enough the encoder would switch to using 0. Unfortunately this change was basically forgotten about until now with WebAssembly/component-model#391, but now's probably "enough time passed" so the encoder is updated to emit a 0x00 leading byte in this situation instead of the historical 0x01 byte. This will start the transition period to eventually removing the validator's acceptance of the 0x01 byte. * Update test expectation
In the binary format
however, when I dump the binary I got
0x01
, is this a typo or version problem?Tools version
The text was updated successfully, but these errors were encountered: