bytecodealliance / bytecodealliance/wasm-tools

wit: Comments in deps don't round-trip through binary encoding

Open
#2,571 1 comment 0 reactions 0 assignees View on GitHub
wit wit-parser
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
16h 57m
Merged PRs (30d)
38

Description

```console
$ find . -type f
./root.wit
./deps/dep.wit
```

```console
$ wasm-tools component wit .
package pkg:root;

/// Root comment
world w {
import pkg:dep/iface;
}
package pkg:dep {
interface iface {
/// Dep comment
f: func();
}
}
```

```console
$ wasm-tools component wit . --wasm | wasm-tools component wit
package pkg:root;

/// Root comment
world w {
import pkg:dep/iface;
}
package pkg:dep {
interface iface {
f: func();
}
}
```

Note `/// Dep comment` present in the WIT is missing when round-tripped with `--wasm`.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with root.wit and deps/dep.wit using `wasm-tools component wit . --wasm | wasm-tools component wit`. Trace the binary round-trip for the dependency interface and compare its output with the original WIT; done means `/// Dep comment` is preserved alongside the root comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.