Skip to content
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

wasm: no standard output on Windows #32774

Closed
jb2martel opened this issue Jun 25, 2019 · 6 comments
Closed

wasm: no standard output on Windows #32774

jb2martel opened this issue Jun 25, 2019 · 6 comments
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@jb2martel
Copy link

jb2martel commented Jun 25, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.6 windows/amd64

Does this issue reproduce with the latest release?

NA

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\jdemartel\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\jdemartel\go
set GOPROXY=
set GORACE=
set GOROOT=c:\go
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\JDEMAR~1\AppData\Local\Temp\go-build750286854=/tmp/go-build -gno-record-gcc-switches

What did you do?

  • Write a hello world go program
Source code
package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println("standard output")
	os.Exit(0)
}
  • Compile to webassembly using GOOS=js GOARCH=wasm go build -o main.wasm main.go
  • Run the compiled code using node and the supplied wasm_exec.js:
    node wasm_exec.js main.wasm
    • On linux, this works fine
    • On windows, no output appears in terminal, whether it's git bash, command prompt or powershell

What did you expect to see?

As the node versions (v12.4.0) and input files (wasm_exec.js and main.wasm) are identical, I would expect it to work on windows.

What did you see instead?

No terminal output on windows. The command completes with no output in terminal, whether it's command prompt, git bash or powershell.

This is probably a mistake on my part rather than a bug - I guess I'm missing something but can't seem to find any related information.

Thank you for your help !

EDIT: added go source code

@jb2martel
Copy link
Author

Note: C++ code compiled to wasm using emscripten works fine in the windows environnement, so it's probably not just my windows / node setup.

@andybons andybons changed the title Webassembly - Windows - No standard Output wasm: no standard output on Windows Jun 25, 2019
@andybons andybons added arch-wasm WebAssembly issues NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 25, 2019
@andybons andybons added this to the Unplanned milestone Jun 25, 2019
@andybons
Copy link
Member

@neelance @dmitshur

@jb2martel
Copy link
Author

Is there anything I can do to help investigate and/or advance the issue ?
I really don't know where to start and would appreciate any tips.
Thanks!

@benshi001
Copy link
Member

benshi001 commented Sep 11, 2019

Please try go1.13, I can see "hello" printed with

go-1.13 for windows/amd64
node 10.16
windows server 2008 R2

open a cmd window

set GOOS=js
set GOARCH=wasm
go build a.go
node wasm_exec.js a

The a.go is

package main
import "fmt"
func main() {
	fmt.Println("hello")
}

@andybons
Copy link
Member

@jb2martel is this still an issue for you?

@andybons andybons added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 11, 2019
@benshi001
Copy link
Member

Closed. Since,

  1. it is not reproducible
  2. it should not be a go issue (go wasm use console.log for fmt.Println)

@golang golang locked and limited conversation to collaborators Sep 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants