rune icon indicating copy to clipboard operation
rune copied to clipboard

Check a Rune is compatible with the current runtime when it is loaded

Open Michael-F-Bryan opened this issue 3 years ago • 0 comments

At the moment, it's hard to make changes to the Rune-runtime interface because the Rune will fail to load due to obscure errors (e.g. an import function's signature is different or it wasn't provided).

The rune build command already embeds the rune CLI's version number in each Rune under the .rune_version custom section.

$ wasm-objdump --full-contents --section=.rune_version examples/sine/sine.rune

sine.rune:	file format wasm 0x1

Contents of section Custom:
00113bf: 0d2e 7275 6e65 5f76 6572 7369 6f6e 7b22  ..rune_version{"
00113cf: 7665 7273 696f 6e22 3a22 302e 372e 312d  version":"0.7.1-
00113df: 6465 7622 7d                             dev"}

Now we just need to emit checks and emit a warning if the Rune's version isn't semver compatible with the runtime:

  • [ ] Rust runtime
  • [ ] Web runtime

To make evolving things easier, I'd also like to not provide any backwards/forwards compatibility guarantee (cc @kthakore). At the moment, the C++ runtime forces us to be de facto backwards compatible, and it sucks.

Michael-F-Bryan avatar Oct 04 '21 06:10 Michael-F-Bryan