Stream: git-wasmtime

Topic: wasmtime / issue #1920 wasmtime-wiggle: test witx equival...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2021 at 16:15):

pchickey commented on issue #1920:

Merging wasmtime support into wiggle fixed this

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2021 at 16:15):

pchickey closed issue #1920:

Feature

The wasmtime-wiggle crate assumes the user has provided a path to the same witx file as the wiggle generator used. If the witx documents used are different, it will probably mean that the generated code will fail to type-check. This mismatch will probably be puzzling to the user and tricky track down.

Determine some way to check equivalence of the wasmtime-wiggle's witx document and the target witx document at proc macro time. This may or may not be possible.

Benefit

Better assurance of correctness, and it will be more comprehensible when something goes wrong.

Implementation

My first thought was that the wasmtime-wiggle macro should emit a #[test] that checks the equivalence between the two witx documents (available via the wiggle_metadata feature) at runtime. However, this approach won't work if the code the macro emits fails to type-check.

I'm not sure how to actually do this.

Alternatives


Last updated: Nov 22 2024 at 16:03 UTC