enum cases size is out of bounds
I generated a very large enum (it's the icon set https://lucide.dev/icons/) . So I have 1424 cases, but sadly it breaks with wit-bindgen with the following error:
Caused by:
enum cases size is out of bounds (at offset 0xdd)
I tried using a variant instead, but same error. So is this expected or a bug? Is there a suggested alternative for my usecase of exposing a typesafe icon set to my webassembly components?
PS: the wit works as expected on the host side.
Thanks for the report! The limit here should be fixed in https://github.com/bytecodealliance/wasm-tools/pull/1713
@alexcrichton good stuff, thanks for hopping on this so quick! I just got started with the wasmtime environment and it's been lovely!
any idea when this is making it in a release? I tried pulling in the git version of wit-bindgen, but limits are still there.
The validation error was fixed in a relatively deep portion of the stack but that was awhile ago and so the update should have percolated by now.
@MatthiasGrandl could you detail a bit more how you're seeing this error? That'll help pinpoint what missed the update and what should get updated.
It happens during compilation of a rust wasm component with cargo component build —release. It is using wit-bindgen and it uses the following enum in wit (attached as file).
Ah I think you're running into cargo component being on 215 which doesn't have this fix. In trying to update that locally that also needs a publish of wit-bindgen. I'll work on getting these updates out today.
Ok a new wit-bindgen is released and https://github.com/bytecodealliance/cargo-component/pull/335 should update cargo-component. Mind trying again with a git version of cargo-component to confirm the issue is resolved once that merges?