Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I have a CLI built using cobra: dropbox/dbxcli. If I try to cross-compile it (using gox, but other methods fail similarly), I get failures like:
You can see more details here: https://travis-ci.org/dropbox/dbxcli/builds/115377102
Explicitly installing mousetrap does fix the issue, but filing this because it violates principle of least surprise.
@diwakergupta mousetrap is a required dependency for Windows builds. Cross compilation, or even just compiling on Windows will fail if this library isn't present.
In your build osx and linux built fine. If your command was
Perhaps I'm missing something, but I everything I see here is working as expected.
@spf13 I'm confused by your response. You're saying that mousetrap is a required depenency for windows builds. Okay I get that.
Then you say linux and osx build fine if you just build those. Yes, I agree with that, what does that have to do with the windows compile issue?
Are you saying that I personally need to include mouse trap as a dependency of my project if I want to both use cobra as a depency and compile against windows? If so, how do I do that? When and where in my project do i reference that dependency? Wouldn't it throw an error since it's not explicitly used?
The only solution i see is to clone mousetrap to $GOPATH prior to building against windows. Why would we manually install dependencies? If cobra requires this library, why doesn't it install when I run