Skip to content
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

Build error : "syscall/js: build constraints exclude all Go files" #228

Closed
ofauchon opened this issue Feb 10, 2021 · 6 comments
Closed

Build error : "syscall/js: build constraints exclude all Go files" #228

ofauchon opened this issue Feb 10, 2021 · 6 comments

Comments

@ofauchon
Copy link

Hi, I could not build the project from latest sources:

go version go1.15.6 linux/amd64
$ go install -v ./...
package github.com/g3n/engine/util/wasm
	imports syscall/js: build constraints exclude all Go files in /usr/lib/go/src/syscall/js

Any idea how to solve that ?

Thx
Olivier

@ganglio
Copy link

ganglio commented Mar 25, 2021

👍

@SamTov
Copy link

SamTov commented Jun 3, 2021

it appears that setting the GOOS and GOARCH variables resolves this problem albeit with some other arising.

GOOS=js GOARCH=wasm go install ./...

@danaugrs
Copy link
Member

danaugrs commented Jun 9, 2021

@ofauchon I added a build tag to exclude that file for non js/wasm builds - please try again with latest and let me know.

@gedw99
Copy link

gedw99 commented Jun 15, 2021

current master branch errors for me on wasm build.

g3nd git:(master) GOOS=js GOARCH=wasm go install ./...
package github.com/g3n/g3nd
        imports github.com/g3n/g3nd/app
        imports github.com/g3n/engine/audio/al: build constraints exclude all Go files in /Users/apple/workspace/go/pkg/mod/github.com/g3n/engine@v0.1.1-0.20210609173700-de78e3c4204a/audio/al
package github.com/g3n/g3nd
        imports github.com/g3n/g3nd/demos/audio: build constraints exclude all Go files in /Users/apple/workspace/go/src/github.com/gedw99/notes/_spec/hack/g3nd/demos/audio

tinygo, just for the curiosity...


g3nd git:(master) tinygo build -o wasm.wasm -target wasm ./main.go
app/app.go:9:2: package runtime/trace is not in GOROOT (/Users/apple/Library/Caches/tinygo/goroot-go1.16.5-e918ea40337b026a7236a204272e89fff505c38957c9c688ab20baccf3be8219/src/runtime/trace)
package command-line-arguments
        imports github.com/g3n/g3nd/demos/audio: build constraints exclude all Go files in /Users/apple/workspace/go/src/github.com/gedw99/notes/_spec/hack/g3nd/demos/audio

Getting the audio working for browsers is likely a large amount of work.
So, for now, could we add the compile time flag of !wasm to github.com/g3n/engine/audio/al ?

@ofauchon
Copy link
Author

Hi @danaugrs

I could compile g3n from today's master branch.

Thanks.

@danaugrs
Copy link
Member

danaugrs commented Nov 4, 2021

Great!

@danaugrs danaugrs closed this as completed Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants