You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add wasip1 tests to my codebase however doing so is non trivial because the dumb GOOS=wasip1 GOARCH=wasm yields:
fork/exec /tmp/go-build85289293/b854/internal.test: exec format error
Instead I need to manually run go test -c -o tests and do wasmtime tests (or some other wasip1 runtime) on packages that go list tell me I should test which is a non trivial line of bash to write.
Proposal
Add a new GOINVOKE option to go env, this will specify a binary that will be used to invoke targets, the target will be the first argument passed to this binary. If empty this does nothing. Defaults to nothing.
This would affect go test, go run and go generate.
How it would work
That means I should be able to do:
GOOS=wasip1 GOARCH=wasm GOINVOKE=wastime go test ./...
And go would invoke wasmtime with /tmp/go-build85289293/b854/internal.test in argv[1].
This would also allows to do:
GOARCH=arm64 GOINVOKE=a-userland-emulator-that-supports-the-syscalls-required-by-the-runtime go test ./...
on an amd64 system and it would compile my tests for arm64 and use userland qemu (if this works one day) to emulate arm64 on the amd64 system.
The text was updated successfully, but these errors were encountered:
I overlooked go test -exec thx, there can be value in supplying a default config through ENV (no need to specify it everywhere) but I don't think this is worth spending time on.
Simpler still is to ensure that $GOROOT/misc/wasm/go_wasip1_wasm_exec can be resolved from your $PATH, in which case it will be used automatically.
The installation docs are quite incomplete on that front, I had to tell numerous peoples that they should also add $GOBIN or most likely $GOPATH/bin to their PATH already.
Now I need to know $GOROOT/misc/wasm/go_wasip1_wasm_exec too (which cool that this works, but that feels like important info to tell peoples).
Is this you will get it wrong once and learn about it when you need approach intentional or just a hole that should be patched ?
Alternatively I do not have $GOROOT/pkg/tool/linux_amd64/ in my path yet the toolchain works correctly, could it do the same thing for $GOROOT/misc/wasm/go_wasip1_wasm_exec ?
Usecase
I want to add wasip1 tests to my codebase however doing so is non trivial because the dumb
GOOS=wasip1 GOARCH=wasm
yields:Instead I need to manually run
go test -c -o tests
and dowasmtime tests
(or some other wasip1 runtime) on packages thatgo list
tell me I should test which is a non trivial line of bash to write.Proposal
Add a new
GOINVOKE
option togo env
, this will specify a binary that will be used to invoke targets, the target will be the first argument passed to this binary. If empty this does nothing. Defaults to nothing.This would affect
go test
,go run
andgo generate
.How it would work
That means I should be able to do:
And go would invoke
wasmtime
with/tmp/go-build85289293/b854/internal.test
inargv[1]
.This would also allows to do:
on an
amd64
system and it would compile my tests forarm64
and use userland qemu (if this works one day) to emulatearm64
on theamd64
system.The text was updated successfully, but these errors were encountered: