Build Hooks

663 views
Skip to first unread message

Joshua Marsh

unread,
May 11, 2014, 5:03:36 PM5/11/14
to golan...@googlegroups.com
I did a bit of searching, but couldn't find anything like a build hook. How are other people doing this, or is it just through Makefiles?

If there isn't anything like this, what would be the interest in allowing for them. They could work a bit like the test files where *_hook.go would contain functions like PreBuild*, PostBuild*, etc. would be called before and after certain points in the build process.

Brad Fitzpatrick

unread,
May 11, 2014, 5:09:39 PM5/11/14
to Joshua Marsh, golang-nuts
They're actually intentionally absent, for a number of reasons.

Yes, you can use a fancier build system if you need something fancy. But the design is such that "go get/install/build" are predictable.

There's talk of adding a "go gen" subcommand to build auto-generated deps in Go 1.4, but it would be an explicit action for package maintainers only, and the generated code would be submitted. It would never run upon go get/install/build.

There's also talk of adding resource embedding as a built-in concept in Go 1.4, as well.




On Sun, May 11, 2014 at 2:03 PM, Joshua Marsh <jos...@themarshians.com> wrote:
I did a bit of searching, but couldn't find anything like a build hook. How are other people doing this, or is it just through Makefiles?

If there isn't anything like this, what would be the interest in allowing for them. They could work a bit like the test files where *_hook.go would contain functions like PreBuild*, PostBuild*, etc. would be called before and after certain points in the build process.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Donovan Hide

unread,
May 11, 2014, 9:29:20 PM5/11/14
to Brad Fitzpatrick, Joshua Marsh, golang-nuts
+1 for resource embedding. Combined with a vfs implementation, would be perfect for deploying static files embedded in a single binary!

Robert Johnstone

unread,
May 12, 2014, 8:53:13 AM5/12/14
to golan...@googlegroups.com, Joshua Marsh
Does this mean that there will be a blessed tool for resource embedding as well?  I'm thinking of projects where we are using Makefiles, but would still like to use the standard approach for resource embedding.

Vincent Batts

unread,
May 12, 2014, 12:57:27 PM5/12/14
to Brad Fitzpatrick, Joshua Marsh, golang-nuts
"go gen ..." sounds handy. I could image a nice template ui on a go/build Package. It could go nicely with generating or checking rpm spec files. Since we have put go libraries in the meta golang() syntax, where the import path inside the parens, then something like `go gen -f "Requires: golang({{.ImportPath}})\n" ...` would spit out that section of the spec file.

vb
Reply all
Reply to author
Forward
0 new messages