Skip to content

Implement canonical interface names in wit-component - #2622

Open
chenyan2002 wants to merge 4 commits into
bytecodealliance:mainfrom
chenyan2002:canon-ver-3
Open

Implement canonical interface names in wit-component#2622
chenyan2002 wants to merge 4 commits into
bytecodealliance:mainfrom
chenyan2002:canon-ver-3

Conversation

@chenyan2002

@chenyan2002 chenyan2002 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2556 and replaces #2602.

  • Add config flag emit_canonical_names in ComponentEncoder to emit canonical version.
  • When both implement and versionsuffix are present, the versionsuffix should refer to the version from implement, instead of the main package name.
  • Update merge_world_imports_based_on_semver from Resolve to support merging based on semver or canonical version, depending on a flag. Also fixed a bug that implements version is not updated during the merge.
  • Add CLI flag merge-imports-based-on-canonical-version to wasm-tools component new and component wit

During the transition period, upstream libraries, e.g., wac, can decode the original binary and re-encode with the emit_canonical_names flag enabled, so that we convert all binaries into their canonical encoding as a preprocessing step. Then wac can merge the interface via string matching directly.

@chenyan2002
chenyan2002 requested a review from a team as a code owner August 25, 2026 00:26
@chenyan2002
chenyan2002 requested review from dicej and removed request for a team August 25, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant