Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 25, 2025

Conversation

ydnar
Copy link
Collaborator

@ydnar ydnar commented May 25, 2025

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/[email protected]
Warning: ambiguous WIT world: wasi:http/[email protected]
Warning: ambiguous WIT world: wasi:cli/[email protected]
Warning: ambiguous WIT world: wasi:filesystem/[email protected]
Warning: ambiguous WIT world: wasi:random/[email protected]
Warning: ambiguous WIT world: wasi:sockets/[email protected]
Warning: ambiguous WIT world: wasi:clocks/[email protected]
Warning: ambiguous WIT world: wasi:io/[email protected]

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