bytecodealliance / bytecodealliance/wasm-tools

Consider adding more type-checking to `wasm-tools component link`

Open
#2,591 0 comments 0 reactions 0 assignees View on GitHub
component-model
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
16h 57m
Merged PRs (30d)
38

Description

Inspired by [this comment](https://github.com/bytecodealliance/wasm-tools/pull/2590#discussion_r3730085482) currently the linking phase of `wasm-tools component link` does type-checks at the item level (e.g. if something is a function or global) and type-checks for globals/tables/memories, but fine-grained type-checks of functions is not yet done. For example if functions are imported with the wrong signature that'll show up as a validation error at the end instead of a linking error. Ideally the linking phase itself would perform these sorts of type-checks and provide an error "faster" to avoid delaying it to a confusing time later on.

Contributor guide

Open the contributing guide

Research direction

Start at the linking phase behind `wasm-tools component link` and trace how imported functions are currently checked versus how final validation reports signature errors. Add fine-grained function type checks so mismatches are reported during linking, then run the existing component-linking and validation tests to confirm the error occurs at the earlier stage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.