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

proposal: cmd/go: support build customization with a build.go file #20177

docbrown opened this issue Apr 29, 2017 · 3 comments

proposal: cmd/go: support build customization with a build.go file #20177

docbrown opened this issue Apr 29, 2017 · 3 comments


Copy link

@docbrown docbrown commented Apr 29, 2017

Having used Rust and Cargo for a bit before coming back to Go for a new project, one thing I really miss is scripted builds. Cargo supports a file that is compiled and then run to do things like locate native dependencies and generate source files. The output of the build "script" specifies library search paths, compiler options, features (build tags), etc. It would be really great if something similar could be accomplished with Go projects fetched with go get and/or dep. I haven't really thought about the overall design or impact of such a feature, but Cargo's would be a good model to consider.

Copy link

@mvdan mvdan commented Apr 29, 2017

Similar ideas have been suggested before. I was not successful at finding the ones I remember seeing, but #19849 is a recent example.

The general idea is that go get should not run arbitrary code. See Brad's reply in the thread above.

I also don't think this proposal is detailed enough. What exactly would you do in such a build.go file that you can't currently do with regular Go files and go generate?

Also note that some projects already use custom build systems like make. You only have to stick to go get (or install, etc) if you want your package to be easily and quickly installable.

I don't think I have the authority to decline proposals, so I'll let someone else decide. But I'm fairly sure this was ruled out in the Go design on purpose.

@mvdan mvdan added the Proposal label Apr 29, 2017
@mvdan mvdan added this to the Proposal milestone Apr 29, 2017
Copy link

@ghost ghost commented Apr 30, 2017

it is related with golang/dep#269
and it reflects golang/dep#269 (comment)

Copy link

@rsc rsc commented May 15, 2017

Blocked on dependency management.

@rsc rsc added the Proposal-Hold label May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.