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

x/exp/inotify: go get fails on non-linux OSs #12774

Closed
karlkfi opened this issue Sep 28, 2015 · 3 comments
Closed

x/exp/inotify: go get fails on non-linux OSs #12774

karlkfi opened this issue Sep 28, 2015 · 3 comments

Comments

@karlkfi
Copy link

karlkfi commented Sep 28, 2015

This is an issue regarding golang.org/x/exp. Hopefully this is the right place to report, since https://github.com/golang/exp does not accept issues or PRs. If not, let me know.

What version of Go are you using (go version)?

This problem is independent of go version.

What operating system and processor architecture are you using?

This problem occurs on all non-linux operating systems.
Tested on go1.5.1 darwin/amd64

What did you do?

$ go get golang.org/x/exp/inotify

What did you expect to see?

Expected go get not to error.

What did you see instead?

$ go get golang.org/x/exp/inotify
golang.org/x/exp/inotify: no buildable Go source files in /Users/karl/go/src/golang.org/x/exp/inotify
$ echo $?
1

More Context

One example of the failure behavior is to try to build Kubernetes on a Mac. The Godep restore fails to checkout the required dependencies, because Godep uses go get.

This isn't normally a problem if your application is linux-only, because developers expect to only build it on linux, but if you optionally use this package (OS detection or command detection) this means go getting your project will now fail on non-linux OSs.

Proposed Solution

One fix would be to add another file to the package that builds on non-linux OSs. Either a doc.go for package docs or an inotify_other.go would work. This file would just include the package def. This way compilation would still fail, if you required the linux-only types from a non-linux go file, but go get would succeed.

@rakyll rakyll changed the title go get golang.org/x/exp/inotify fails on non-linux OSs x/exp/inotify: fails on non-linux OSs Sep 28, 2015
@rakyll rakyll changed the title x/exp/inotify: fails on non-linux OSs x/exp/inotify: go get fails on non-linux OSs Sep 28, 2015
@rakyll rakyll added this to the Unplanned milestone Sep 28, 2015
@rakyll
Copy link
Contributor

rakyll commented Sep 28, 2015

You can use go get golang.org/x/exp/inotify/... to clone the entire tree. go get will output a warning that here are no matching packages but the process will exit with a zero status code.

Specifically for the Kubernetes' build process, you must file an issue against them to see what other alternatives they can provide for those who would like to cross compile. Please reopen the issue if Kubernetes cannot find a solution.

@rakyll rakyll closed this as completed Sep 28, 2015
@karlkfi
Copy link
Author

karlkfi commented Sep 29, 2015

The Kubernetes issue is actually more of a Godep issue, if that's the suggested workaround.

However, if that workaround is put into Godep it will start vendoring significantly more code (sub-packages), which is not a very good option.

@karlkfi
Copy link
Author

karlkfi commented Sep 29, 2015

There is a related bug in godep: tools/godep#186

@golang golang locked and limited conversation to collaborators Sep 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants