-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: invalid tmp dir for GOARCH=wasm, GOOS=js when GOHOSTOS=windows #27306
Comments
also the os path separator should reflect GOHOSTOS value |
/cc @bradfitz |
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. |
no, 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 What about modifying |
sure! i will try to submit the CL this week. |
@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 |
Change https://golang.org/cl/150437 mentions this issue: |
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 <neelance@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Please answer these questions before submitting your issue. Thanks!
What did you do?
https://play.golang.org/p/e5sTf5-QdnM
//steps to reproduce (GOHOSTOS= windows)
set GOOS=js
set GOARCH=wasm
set CGO_ENABLED=0
go test -c -o test.wasm
node wasm_exec.js test.wasm
What did you expect to see?
test succeed
What did you see instead?
--- FAIL: TestTmpFileGOARCH_wasm_GOHOSTOS_windows (0.00s)
issue_test.go:27: open /tmp/wasm514931654: No such file or directory
Does this issue reproduce with the latest release (go1.11)?
yes
System details
possible solution
The text was updated successfully, but these errors were encountered: