Closed StevenACoffman closed 2 days ago
Could you try with 0.9.7? It has a newer wasmtime, it's possible there may be some interaction there.
This still happens with viceroy 0.9.7.
A much smaller reproducer is:
package main
import (
"fmt"
"os"
)
func main() {
fmt.Println(os.Args[0])
}
Would it be reasonable to supply at least one WASI arg to the guest? Either with some default value like wasm
, or the name of the service?
@ydnar Yes. The baseame of the wasm file I believe is accessible; worst case we just lie.
@ydnar Do you have a pointer for where this could be plumbed through? I'm not much of a rustacean.
When I try to run
fastly compute serve
with webassembly code that I build withGOARCH=wasm GOOS=wasip1 go build ./...
if I have code that even indirectly includesflag
then theflag
package importshttptest ( _ "net/http/httptest")
which will panic when it gets to: https://github.com/golang/go/blob/3ed007d754b685cd8f6011a8e96a3c9303c785db/src/flag/flag.go#L1199An example piece of code
and run
fastly compute serve
with thisfastly.toml
file:I can reproduce this problem with tinygo, but wasmtime doesn't seem to have the problem directly, so I assume it is a viceroy problem.
I mentioned this in the gophers slack and @dgryski said he passed it on to a colleague, but I didn't want others to duplicate bug reports, so I thought I'd record it here for others to track.