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

Implement the 2023_10_18 version of web serving. #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brendandburns
Copy link
Contributor

Brings this implementation up to date with the 2023_10_18 version of the Wasi-http spec.

const ModuleName = "streams"
const (
ModuleName = "streams"
ModuleName_2023_10_18 = "wasi:io/streams@0.2.0-rc-2023-10-18"
Copy link

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

Copy link

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?

Copy link
Contributor Author

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.

Comment on lines +57 to +60
msg := fmt.Sprintf("Failed to get request: %v\n", request)
log.Printf(msg)
doError(mod, ptr, msg)
return
Copy link
Contributor

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?

Copy link
Contributor Author

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()

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.

3 participants