repeatable builds

232 views
Skip to first unread message

Conrad Wood

unread,
Oct 17, 2017, 8:42:32 AM10/17/17
to golang-nuts
Hi,

We're considering Go for new services in our software architecture. Generally it seems like a good fit. There are a few things I'm not sure about though, so I wonder what others do:

1. How does one ensure repeatable builds? (go get obviously pulls from the internet by default.to get repeatable and versioned builds, does one keep the packages itself in a git repository?) 

2. Our repositories have a lot of files (documentation, tools, tests, and whatnot, a java client), and only a fairly small part of actual Go code. However, the go code needs to remain within the GOPATH. The java classes on the other hand need to reside in the CLASSPATH. To make matters worse, go doesn't like symlinks in the gopath. (https://github.com/golang/go/issues/14054). What I really want, is a self contained repository to has all the bits and bobs that we need to this particular service and is compilable and executable from it's own directory. 

I am thinking of the workflow for developers, and I'm trying to achieve (and did with C and Java) a simple "git clone [repo]" ; cd repo ; ./build.sh" to get started quickly and easily. Ideally the server would execute the same steps and produce the binaries required and use the same dependencies as the compiler on the developer workstation.

How do others set this up with Go?

Thanks,

Conrad 

roger peppe

unread,
Oct 17, 2017, 2:46:57 PM10/17/17
to Conrad Wood, golang-nuts
Have you looked at the dep tool (github.com/golang/dep) ?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Conrad Wood

unread,
Oct 18, 2017, 4:08:57 AM10/18/17
to roger peppe, golang-nuts
I did (admittedly found it only after I send the email). I give that a
try and see how it goes - thank you!

And advice on point #2 by any chance?

Jack Christensen

unread,
Oct 18, 2017, 10:30:12 AM10/18/17
to golan...@googlegroups.com


On 10/18/2017 03:08 AM, Conrad Wood wrote:
> I did (admittedly found it only after I send the email). I give that a
> try and see how it goes - thank you!
>
> And advice on point #2 by any chance?
When I have a mixed language repo I tend to include an entire GOPATH in
the the repo. Something like direnv (https://direnv.net/) can be used to
automatically set the GOPATH environment variable as needed.

Nathan Kerr

unread,
Oct 20, 2017, 12:33:17 AM10/20/17
to golang-nuts

Conrad Wood

unread,
Oct 23, 2017, 11:14:16 AM10/23/17
to golang-nuts
Hi,

Thanks for that.
Right now, checking in an entire GOPATH makes the most sense to me.
That seems to eliminate the need for godep, hellogopher etc... altogether.

presumably, when you update the packages, you just use -u flag for "go get", right?

Conrad
Reply all
Reply to author
Forward
0 new messages