Skip to content

wasm_exec.js: out-of-sync with runtime.walltime changes #52900

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

Closed
flyn-org opened this issue May 13, 2022 · 3 comments
Closed

wasm_exec.js: out-of-sync with runtime.walltime changes #52900

flyn-org opened this issue May 13, 2022 · 3 comments
Labels
arch-wasm WebAssembly issues FrozenDueToAge OS-JS WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@flyn-org
Copy link

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

$ go version
go version go1.18 linux/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE=".../.cache/go-build"
GOENV=".../.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE=".../go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH=".../go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=".../go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4127447452=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I maintain a number of applications that use Go's WebAssembly support. A recent compiler update broke things. I am using the wasm_exec.js file that was shipped with my updated compiler, but my browser prints the following error to its console:

Uncaught (in promise) LinkError: import object field 'runtime.walltime' is not a Function 

Might this be related to https://groups.google.com/g/golang-checkins/c/Mhnkp2QrdBo? I did see walltime mentioned in src/runtime/sys_wasm.s.

@flyn-org
Copy link
Author

Everything works when I revert to Go 1.16.8 and recompile my application.

@dmitshur
Copy link
Member

To clarify, are you running into this when using a .wasm module built with Go 1.18 together with the wasm_exec.js file from Go 1.18? Are you able to reproduce it with a simple hello-world program, or does it not reproduce on such a small program?

@dmitshur dmitshur added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. arch-wasm WebAssembly issues OS-JS labels May 14, 2022
@flyn-org
Copy link
Author

Oddly, things fixed when I returned to 1.18 for further testing. I expect I overlooked something obvious, but I had tested Go 1.18 with the Go 1.18 wasm_exec.js file. What was broken now works again.

I will close this for now. I will be updating some of my other applications in the next few days, and I will reopen this if I find it necessary. For now, it looks like I made a mistake somewhere.

@golang golang locked and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly issues FrozenDueToAge OS-JS WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants