Stream: git-wasmtime

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


view this post on Zulip Wasmtime GitHub notifications bot (Jun 25 2020 at 16:46):

pchickey opened 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: Dec 23 2024 at 12:05 UTC