Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
os: invalid tmp dir for GOARCH=wasm, GOOS=js when GOHOSTOS=windows #27306
Please answer these questions before submitting your issue. Thanks!
What did you do?
What did you expect to see?
What did you see instead?
--- FAIL: TestTmpFileGOARCH_wasm_GOHOSTOS_windows (0.00s)
Does this issue reproduce with the latest release (go1.11)?
Does this only affect running tests?
If so, one answer is that we're fine with the Linux-based builders only.
As long as Windows users can still generate working *.wasm files that run in browsers, we might be fine without tests.
But then again, the fix might also be simple enough. It might not be okay for the os package to depend on syscall/js, though.
Let me give you some context:
I'm currently working on a "bridge" between go http handlers and nodejs request listeners.
This allow us to use regular http Handlers as node requestListener,
yes, this is probably a bad idea but is fun and powerful
@thesyncim If you need any help with the setup for sending a CL, feel free to talk to me on the Gophers slack. Alternatively you could use the pull request integration: https://golang.org/doc/contribute.html#sending_a_change_github
os.TempDir() did not return a proper directory on Windows with js/wasm, because js/wasm only uses the Unix variant of TempDir. This commit passes the temporary directory provided by Node.js to the Go runtime by adding it as a default value for the TMPDIR environment variable. It makes TempDir compatible with all platforms. Fixes #27306. Change-Id: I8b17e44cfb2ca41939ab2a4f918698fe330cb8bc Reviewed-on: https://go-review.googlesource.com/c/150437 Run-TryBot: Richard Musiol <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Brad Fitzpatrick <email@example.com>