Skip to content

unable to build due to sys/unix (but sys/unix not used) #425

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

Closed
tobowers opened this issue Jun 27, 2019 · 6 comments
Closed

unable to build due to sys/unix (but sys/unix not used) #425

tobowers opened this issue Jun 27, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@tobowers
Copy link

I'm sorry I don't have an easy reproduction for this (it's a private repo and a complicated build path). However I can show it happens below.

The meat of it is that it believes one of my repos has a dependency on x/sys/unix but it doesn't (as proven by the go mod graph | grep unix below).

The only thing I can think of is that the master branch of that repo does have a dependency on x/sys/unix . I tried to vendor everything as well, but produced the same errors.

tinygo version
tinygo version 0.6.0 darwin/amd64
14:16 ~/code/tupelo-go-sdk/wasm (play/wasm) $ tinygo build -o wasm.wasm -target wasm ./main.go
error: no buildable Go source files in /Users/tobowers/code/go/src/github.com/quorumcontrol/chaintree/vendor/golang.org/x/sys/unix
14:16 ~/code/tupelo-go-sdk/wasm (play/wasm) $ tinygo clean
14:16 ~/code/tupelo-go-sdk/wasm (play/wasm) $ tinygo build -o wasm.wasm -target wasm ./main.go
error: no buildable Go source files in /Users/tobowers/code/go/src/github.com/quorumcontrol/chaintree/vendor/golang.org/x/sys/unix
14:16 ~/code/tupelo-go-sdk/wasm (play/wasm) $ go mod graph | grep unix
14:16 ~/code/tupelo-go-sdk/wasm (play/wasm) $  GOOS=js GOARCH=wasm go run .
we did all the things
@tobowers
Copy link
Author

The last line there is showing (non-tiny) go is able to compile and execute the wasm and get the output ('we did all the things')

@aykevl
Copy link
Member

aykevl commented Jun 27, 2019

There probably still is a dependency somewhere. TinyGo won't add a random dependency for no reason.

Note that we do not support Go modules yet, everything is GOPATH based (and not even $GOPATH/pkg/mod). This may confuse things.

Better diagnostics are definitely a priority (goal: better diagnostics than the go tool) but we're not there yet, unfortunately.

@tobowers
Copy link
Author

Oh... well just looking at GOPATH is probably the problem, right? Because the master branch does have the sys/unix dependency. How should I version the dependencies for tinygo?

@aykevl
Copy link
Member

aykevl commented Jun 27, 2019

Versioning dependencies in TinyGo is the same as versioning dependencies in Go before go mod (that is, basically unsupported). I'm not sure whether TinyGo supports a vendor directory but if it does, you can try dep.

Of course, we will want to support versioning eventually as it is very important. But it requires some major refactoring that is not yet completed, see #285.

@tobowers
Copy link
Author

tobowers commented Jun 27, 2019 via email

@deadprogram deadprogram added the enhancement New feature or request label Jun 28, 2019
@deadprogram
Copy link
Member

Closing due to age. Thanks to everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants