~eliasnaur/gio#513: 
x/explorer: compilation failure with (upcoming) Go-1.21

trying to compile x/explorer@v0.1.0 with the upcoming Go-1.21 version (and its new wasip1/wasm target), leads to:

$> gogio -x -target js  -o _wasm ./my-app
go list -f {{.ImportPath}} ./cmd/varda
go list -f {{.Dir}} ./cmd/varda
go build -ldflags=-X gioui.org/app/internal/log.appID=org.example.myapp -tags= -o _wasm/main.wasm ./cmd/varda
gogio: go build -ldflags=-X gioui.org/app/internal/log.appID=org.example.myapp -tags= -o _wasm/main.wasm ./cmd/varda failed: # gioui.org/x/explorer
../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s:6: unrecognized instruction "CallImport"
../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s:10: unrecognized instruction "CallImport"
../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s:14: unrecognized instruction "CallImport"
asm: assembly of ../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s failed

(the same code does compile successfully with Go-1.19.x and Go-1.20.x)

Status
RESOLVED FIXED
Submitter
~sbinet
Assigned to
No-one
Submitted
1 year, 6 months ago
Updated
1 year, 6 months ago
Labels
No labels applied.

~inkeliz 1 year, 6 months ago

RIP CallImport.

That is caused because the undocumented CallImport was replaced by //go:wasmimport. Since keeping both is quite unmaintainable, it's easier to move everything to syscall/js (which is also not stable, and slower).

The issue caused by using syscall/js is one additional copy each time. I will send one PR to replace it, maybe at the end of this week.

-- Lucas Rodrigues inkeliz@inkeliz.com

On Mon, Jul 10, 2023, at 4:37 PM, ~sbinet wrote:

trying to compile x/explorer@v0.1.0 with the upcoming Go-1.21 version (and its new wasip1/wasm target), leads to:

$> gogio -x -target js  -o _wasm ./my-app
go list -f {{.ImportPath}} ./cmd/varda
go list -f {{.Dir}} ./cmd/varda
go build -ldflags=-X gioui.org/app/internal/log.appID=org.example.myapp 
-tags= -o _wasm/main.wasm ./cmd/varda
gogio: go build -ldflags=-X 
gioui.org/app/internal/log.appID=org.example.myapp -tags= -o 
_wasm/main.wasm ./cmd/varda failed: # gioui.org/x/explorer
../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s:6: 
unrecognized instruction "CallImport"
../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s:10: 
unrecognized instruction "CallImport"
../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s:14: 
unrecognized instruction "CallImport"
asm: assembly of 
../../gocode/pkg/mod/gioui.org/x@v0.1.0/explorer/explorer_js.s failed

(the same code does compile successfully with Go-1.19.x and Go-1.20.x)

-- View on the web: https://todo.sr.ht/~eliasnaur/gio/513

~inkeliz referenced this from #513 1 year, 6 months ago

~gedw99 1 year, 6 months ago

I also hit this with the new wasip1/wasm target.

I am using gotip mostly.

so would be good if this gets fixed...

Register here or Log in to comment, or comment via email.