Problem with building for WASM/WASI target
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
Maybe try with the latex build tag, that would use the system's LaTeX implementation. Does that work?
Current version compiles just fine for js and wasip1 targets using go 1.25
Good to hear, thanks for the feedback!