goscript
goscript copied to clipboard
Don't call canonicalize when building for wasm32-wasi
After building for the wasm32-wasi target, running the engine failed and I narrowed it down to calls to canonicalize() and printing the errors give the following message:
Error { kind: Unsupported, message: "operation not supported on this platform" }
It appears that wasi doesn't support canonicalize.
The changes I made simply skip invoking canonicalize() if the build target is wasm-wasi, and I don't think it's too much to just require that wasm users of the library provide an absolute path if they wish to run goscripts.