Skip to content

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

Open

Description

@lann
$ find . -type f
./root.wit
./deps/dep.wit
$ wasm-tools component wit .
package pkg:root;

/// Root comment
world w {
  import pkg:dep/iface;
}
package pkg:dep {
  interface iface {
    /// Dep comment
    f: func();
  }
}
$ 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.

Activity

  1. alexcrichton commented on Jul 17, 2026

    @alexcrichton
    Member

    This came up as well in the discussion of #2532 -- this is a limitation of the current format of doc comments where it's per-package and there's nowhere currently to put documentation for different packages. I wrote up some more here but it'll be a bit difficult to transition the current format to preserving this.

  2. added
    witrelated to the `*.wit` text format
    wit-parserIssues for the `wit-parser` crate
    on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    witrelated to the `*.wit` text formatwit-parserIssues for the `wit-parser` crate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions