-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement the 2023_10_18 version of web serving. #95
base: main
Are you sure you want to change the base?
Conversation
const ModuleName = "streams" | ||
const ( | ||
ModuleName = "streams" | ||
ModuleName_2023_10_18 = "wasi:io/streams@0.2.0-rc-2023-10-18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been trying to get this PR working with https://github.com/dev-wasm/dev-wasm-go/tree/main/http without success. The first issue is that module name should be wasi:io/streams
instead that dev-wasm-go client will work with that. However, still after that there is error
panic: wasm: error instantiating guest: "read" is not exported in module "wasi:io/streams"
perhaps some mismatch between versions in dev-wasm-go and wasi-go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just thinking, could it make sense to make one working combination with wasi-go wasi_http and dev-wasm-go client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zetaab dev-wasm-go
unfortunately hasn't been updated (I will do that soon) there is an example here that will work:
https://github.com/brendandburns/hello-wasi-http-go
I'll try to get dev-wasm-go
updated soon.
msg := fmt.Sprintf("Failed to get request: %v\n", request) | ||
log.Printf(msg) | ||
doError(mod, ptr, msg) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this condition expected to ever happen? Or would it be better suited to panic if we hit it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition will happen if someone loads a WASM binary that doesn't export the right function.
In such a situation, it feels like the right thing to do is have the server return a 500 error, as opposed to crashing via panic()
Brings this implementation up to date with the 2023_10_18 version of the Wasi-http spec.