Skip to content

wit/bindgen: improve WIT world matching, warn if ambiguous#357

Merged
ydnar merged 3 commits into
mainfrom
ydnar/issue356
May 25, 2025
Merged

wit/bindgen: improve WIT world matching, warn if ambiguous#357
ydnar merged 3 commits into
mainfrom
ydnar/issue356

Conversation

@ydnar

@ydnar ydnar commented May 25, 2025

Copy link
Copy Markdown
Collaborator

Sort WIT packages topologically by dependency before matching WIT world when generating Go bindings. Warn if there is an ambiguous match.

Fixes #356.

$ go tool go.bytecodealliance.org/cmd/wit-bindgen-go generate -v -w imports -o bindings wit
Output dir: bindings
Package root: github.com/rvolosatovs/go-bindgen-repro/bindings
WIT world: repro:repro/imports@0.1.0
Warning: ambiguous WIT world: wasi:http/imports@0.2.1
Warning: ambiguous WIT world: wasi:cli/imports@0.2.1
Warning: ambiguous WIT world: wasi:filesystem/imports@0.2.1
Warning: ambiguous WIT world: wasi:random/imports@0.2.1
Warning: ambiguous WIT world: wasi:sockets/imports@0.2.1
Warning: ambiguous WIT world: wasi:clocks/imports@0.2.1
Warning: ambiguous WIT world: wasi:io/imports@0.2.1

ydnar added 2 commits May 25, 2025 11:57
…ng WIT world

Warn if there are multiple WIT worlds that match the world option.

Fixes #356.
@ydnar ydnar self-assigned this May 25, 2025
@ydnar ydnar merged commit 6c63c12 into main May 25, 2025
13 checks passed
@ydnar ydnar deleted the ydnar/issue356 branch May 25, 2025 20:42
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.

wit-bindgen-go ignores WIT imports with name clash

1 participant