go-billy icon indicating copy to clipboard operation
go-billy copied to clipboard

Question: WebAssembly support for go-billy ?

Open capsci opened this issue 4 years ago • 2 comments

I'm unable to compile my code with go-billy dependencies.

> env GOOS=js GOARCH=wasm go build -v -o main.wasm cmd/addbranch/main/main.go 
/home/capsci/go/pkg/mod/github.com/go-git/go-billy/[email protected]/osfs/os_posix.go:8:2: build constraints exclude all Go files in /home/capsci/go/pkg/mod/golang.org/x/[email protected]/unix

capsci avatar Jan 21 '21 15:01 capsci

I have a fork of go-billy which compiles to wasm and is used in my Git Portal project (commit 56e87cf). Here is the diff with go-git/go-billy or you cold use my fork directly: https://github.com/go-git/go-billy/compare/master...happybeing:master

happybeing avatar Jan 21 '21 16:01 happybeing

Thanks @happybeing

capsci avatar Jan 21 '21 16:01 capsci

The tag js enables that: https://github.com/go-git/go-billy/blob/master/osfs/os_posix.go#L1

Please note that one of the CI workflows run tests on wasm.

pjbgf avatar May 24 '23 19:05 pjbgf

Hi, with Go v1.21. can we please add support for GOOS=wasip1 ?

HarikrishnanBalagopal avatar Oct 07 '23 09:10 HarikrishnanBalagopal

I added support for GOOS=wasip1 in the pull request https://github.com/go-git/go-billy/pull/36

tryggvil avatar Oct 12 '23 11:10 tryggvil