Skip to content
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

bindgen 0.5.0 fails to handle (transitive?) versioned imports #281

Closed
rvolosatovs opened this issue Jan 13, 2025 · 2 comments · Fixed by #287
Closed

bindgen 0.5.0 fails to handle (transitive?) versioned imports #281

rvolosatovs opened this issue Jan 13, 2025 · 2 comments · Fixed by #287
Labels
bug Something isn't working

Comments

@rvolosatovs
Copy link
Member

rvolosatovs commented Jan 13, 2025

It appears that the 0.5.0 version of the bindgen has introduced a regression

go run go.bytecodealliance.org/cmd/wit-bindgen-go generate -vv -w imports -o bindings wit

fails on e.g. wasi:http, examples:

$ git clone https://github.com/WebAssembly/wasi-http
$ cd wasi-http
$ go mod init repro
$ go get go.bytecodealliance.org/cmd/[email protected]
$ go run go.bytecodealliance.org/cmd/[email protected] generate -vv -w imports -o bindings wit

observe:

Output dir: bindings
Package root: repro/bindings
Generating Go for 9 world(s)
wasm-tools: error: failed to process feature gate for world [wasi-io-WORLD-imports-v023] in package [go:bindgen]

Caused by:
    0: package [go:bindgen] contains a feature gate with a version specifier, so it must have a version
wasm-tools: error: failed to process feature gate for world [wasi-io-WORLD-imports-INTERFACE-error-v023] in package [go:bindgen]

Caused by:
    0: package [go:bindgen] contains a feature gate with a version specifier, so it must have a version
Type:	wasi:io/[email protected]
	repro/bindings/wasi/io/error.Error
wasm-tools: error: failed to process feature gate for world [wasi-io-WORLD-imports-INTERFACE-poll-v023] in package [go:bindgen]

Caused by:
    0: package [go:bindgen] contains a feature gate with a version specifier, so it must have a version
Type:	wasi:io/[email protected]
	repro/bindings/wasi/io/poll.Pollable
wasm-tools: error: failed to process feature gate for world [wasi-io-WORLD-imports-INTERFACE-streams-v023] in package [go:bindgen]

Caused by:
    0: package [go:bindgen] contains a feature gate with a version specifier, so it must have a version
Type:	wasi:io/[email protected]
	repro/bindings/wasi/io/streams.Error
Type:	wasi:io/[email protected]
	repro/bindings/wasi/io/streams.Pollable
Type:	wasi:io/[email protected]
	repro/bindings/wasi/io/streams.StreamError
Type:	wasi:io/[email protected]
	repro/bindings/wasi/io/streams.InputStream
Type:	wasi:io/[email protected]
	repro/bindings/wasi/io/streams.OutputStream
Generated 4 Go package(s)
Generated package: repro/bindings/wasi/io/error
	bindings/wasi/io/error/empty.s
	bindings/wasi/io/error/error.wit.go
	bindings/wasi/io/error/ioerror.wasm.go
Generated package: repro/bindings/wasi/io/imports
	bindings/wasi/io/imports/imports.wit.go
Generated package: repro/bindings/wasi/io/poll
	bindings/wasi/io/poll/empty.s
	bindings/wasi/io/poll/poll.wasm.go
	bindings/wasi/io/poll/poll.wit.go
Generated package: repro/bindings/wasi/io/streams
	bindings/wasi/io/streams/empty.s
	bindings/wasi/io/streams/streams.wasm.go
	bindings/wasi/io/streams/streams.wit.go
@ydnar
Copy link
Collaborator

ydnar commented Jan 13, 2025

What version of wasm-tools are you using? What version of wasi-http?

@rvolosatovs
Copy link
Member Author

What version of wasm-tools are you using? What version of wasi-http?

$ wasm-tools --version                                                               
wasm-tools 1.221.2

I used 0.2.1 in the minimal reproducer in https://github.com/rvolosatovs/go-bindgen-repro (https://github.com/rvolosatovs/go-bindgen-repro/blob/48c48aabe231103ff3e1d610132e2cd81906fe59/wit/world.wit#L4)

wasi-http repo rev I tried is WebAssembly/wasi-http@8eb7f8a, current main

@ydnar ydnar added the bug Something isn't working label Jan 19, 2025
ydnar added a commit that referenced this issue Jan 20, 2025
ydnar added a commit that referenced this issue Jan 21, 2025
ydnar added a commit that referenced this issue Jan 21, 2025
ydnar added a commit that referenced this issue Jan 27, 2025
ydnar added a commit that referenced this issue Jan 27, 2025
ydnar added a commit that referenced this issue Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants