Skip to content

cmd/go: go test for GOOS=js GOARCH=wasm looks for wasm_exec.js in the old misc/wasm/ path instead of lib/wasm/ #71767

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
maxence-charriere opened this issue Feb 15, 2025 · 5 comments
Labels
arch-wasm WebAssembly issues BugReport Issues describing a possible bug in the Go implementation. OS-JS

Comments

@maxence-charriere
Copy link

Go version

go version go1.24.0 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/maxence/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/maxence/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/g6/n3gnkjq13yl_dcp6qd69fs940000gn/T/go-build787758416=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/maxence/Dev/src/github.com/maxence-charriere/murlok/go.mod'
GOMODCACHE='/Users/maxence/dev/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/maxence/dev'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.24.0/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/maxence/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.24.0/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Ran:

GOARCH=wasm GOOS=js go test

What did you see happen?

GOARCH=wasm GOOS=js go test
open /opt/homebrew/Cellar/go/1.24.0/libexec/misc/wasm/wasm_exec.js: no such file or directory
exit status 1

What did you expect to see?

Tests run successfully with wasm_exec.js located in the new path.

@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Feb 15, 2025
@Zxilly Zxilly added arch-wasm WebAssembly issues OS-JS labels Feb 15, 2025
@Zxilly
Copy link
Member

Zxilly commented Feb 15, 2025

The go test implicitly looks for go_js_wasm_exec in path to execute the built unit test binary, can you check where go_js_wasm_exec is located in the environment? like which go_js_wasm_exec

@seankhliao
Copy link
Member

I don't think cmd/go ever automatically added the wasm execution wrappers to PATH?
this looks more likely to be that you have kept around stale references in your shell environment, see https://go.dev/blog/wasi#running-go-tests-with-wasip1

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2025
@maxence-charriere
Copy link
Author

@Zxilly

▶ where go_js_wasm_exec
/Users/maxence/dev/bin/go_js_wasm_exec
/opt/homebrew/Cellar/go/1.24.0/libexec/lib/wasm/go_js_wasm_exec

Look like there there is 2 locations for it.

@Zxilly
Copy link
Member

Zxilly commented Feb 16, 2025

You should remove outdated binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly issues BugReport Issues describing a possible bug in the Go implementation. OS-JS
Projects
None yet
Development

No branches or pull requests

4 participants