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

Support go build -o flag #10

Open
robert-zaremba opened this issue Jan 8, 2017 · 3 comments
Open

Support go build -o flag #10

robert-zaremba opened this issue Jan 8, 2017 · 3 comments

Comments

@robert-zaremba
Copy link

It's is beneficial to build only the requested package / main program (eg by explicitly pointing to the package we want to build using full name or .) and decide where to place the binary.
This is especially useful in projects with lot of binaries.

@joshuarubin
Copy link
Owner

Wow, sorry for the slow response. Not getting notifications. I'll look into it.

Anyway, you can always use zb -p build . to build just the one package. Also, zb (without -p) will only rebuild the binaries that need to be rebuilt based on file modification times (like make). So if you change one binary source, it will be the only binary rebuilt. If, however, you change a library that multiple binaries depend on, each of those binaries will be rebuilt.

zb is not intended to be a full replacement for the go command. You can mix and match your use of zb and go as needed. The only downside I can think of is that zb will provide linker arguments of the git commit and buildTime that go will not. This is a completely optional use and should never impede building with either tool.

Is this a satisfactory answer, or do you still think there is a case for implicit support of the -o flag?

@robert-zaremba
Copy link
Author

Hello @joshuarubin ,
Thank you for response, and sorry for being late.

My need is to have an option to specify the zb build output directory. So I can say zb to put the binaries in another directory rather than the project root. I'm thinking about something like zb build -o bin

@joshuarubin
Copy link
Owner

joshuarubin commented Aug 23, 2017

That does sound like a useful option.

I'm going to be doing some refactoring of zb to better handle vendored dependencies with the somewhat different way that golang/dep stores things, so I'll see if I can add this at the same time.

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

2 participants