Make GOOS=js GOARCH=wasm a possible build target#573
Make GOOS=js GOARCH=wasm a possible build target#573
Conversation
|
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
|
Incidentally, I believe this closes issue #186 |
|
@Jorropo when you take a look at this, then feel free to suggest actual writing to in-memory files. I just don't see any reason, but if there is then just holler. |
|
I would like to support WASM too but I want to you know that you havn't added anything to the test suite. |
Jorropo
left a comment
There was a problem hiding this comment.
I don't think a new filewriter_wasm file is correct.
The STD emulates a unix filesystem on top of JS:
https://cs.opensource.google/go/go/+/master:src/os/file_unix.go;l=5?q=openFileNolog&ss=go%2Fgo
| @@ -1,4 +1,6 @@ | |||
| //go:build darwin || linux || netbsd || openbsd || freebsd || dragonfly || js || wasip1 | |||
| //go:build darwin || linux || netbsd || openbsd || freebsd || dragonfly || (js && !wasm) || wasip1 | |||
| // +build darwin linux netbsd openbsd freebsd dragonfly js,!wasm wasip1 | |||
There was a problem hiding this comment.
Btw, it's been since 1.18 that +build isn't used anymore.
I think you should upgrade your version of go. 😉 🙂
|
Hepp! Good feedback. A little busy here, but I'll follow up. |
As writing files is not really applicable in WebAssembly create a noop filewriter to make compilation possible.