canvas icon indicating copy to clipboard operation
canvas copied to clipboard

Problem with building for WASM/WASI target

Open orzel7 opened this issue 1 year ago • 1 comments

I've tried to build this code to web assembly, and it fails: ` GOOS=wasip1 GOARCH=wasm tinygo build -o main.wasm main.go go: downloading github.com/tdewolff/minify/v2 v2.20.5 go: downloading github.com/tdewolff/font v0.0.0-20240728193914-9dc6e3441d03 go: downloading golang.org/x/text v0.16.0 go: downloading github.com/go-text/typesetting v0.0.0-20231013144250-6cc35dbfae7d go: downloading github.com/go-fonts/latin-modern v0.3.1 go: downloading github.com/tdewolff/parse/v2 v2.7.15 go: downloading golang.org/x/net v0.24.0 go: downloading golang.org/x/image v0.18.0 go: downloading github.com/andybalholm/brotli v1.1.0

star-tex.org/x/tex/internal/xtex

../../../../go/pkg/mod/star-tex.org/x/[email protected]/internal/xtex/ctx.go:33:11: undefined: os.Chdir ../../../../go/pkg/mod/star-tex.org/x/[email protected]/internal/xtex/ctx.go:35:11: undefined: os.Chdir ` I realize tinygo is not 100% compatible with go, but if this project claims to be WASM compatible, it would be nice to take a closer look at the problem

orzel7 avatar Sep 08 '24 19:09 orzel7

Maybe try with the latex build tag, that would use the system's LaTeX implementation. Does that work?

tdewolff avatar Oct 24 '24 18:10 tdewolff

Current version compiles just fine for js and wasip1 targets using go 1.25

orzel7 avatar Sep 22 '25 15:09 orzel7

Good to hear, thanks for the feedback!

tdewolff avatar Sep 23 '25 07:09 tdewolff