In other words, given the same source files and same compiling flags and environment variables (GOOS, GOARCH and friends), is the binary produced by `go build` (of same version) the same on different machines?
--
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.
I think, but I really have never looked to check, go binaries support
something called the build-id, which is something redhat/fedora use
(apologies if I have mischaracterised this) to do something like this,
or at least tie a final binary back to a set of debug symbols.
Sorry, that's a pretty vague hint. Hopefully someone else can do better.
I was hoping to establish some kind of correspondence between the
source and the binaries, so I could say if you have a particular
binary, you can compare its SHA1 hash against a known list and be
certain that the binary is compiled from a particular version of
source code.
On Wed, Dec 3, 2014 at 11:10 PM, Riobard Zhan <m...@riobard.com> wrote:I was hoping to establish some kind of correspondence between the
source and the binaries, so I could say if you have a particular
binary, you can compare its SHA1 hash against a known list and be
certain that the binary is compiled from a particular version of
source code.I think pure Go build (i.e. no cgo, not even from the standard packages, net and os/user)with the same GOROOT should produce identical binaries (at least on Unix, as brainmanhas said, windows binaries have timestamp in the header.)
--
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.
Binary equivalence for repeated builds would be very useful... it would let you know for sure that when you're testing an old build of your product, that it definitely is the same as the one in production (or, conversely, that the one the customer is using is definitely the same as the released version).
It seems like it should be trivial to make this possible (ideally without requiring the same GOPATH, but even if it does require that, that's easily worked around).
And why do we need timestamps in the windows build? That seems like something easy enough to discard (but I don't know the details obviously).
It seems like it should be trivial to make this possible (ideally without requiring the same GOPATH, but even if it does require that, that's easily worked around).I don't think GOPATH or GOROOT could be eliminated, due to the need for debugging information andaccurate stack traces.
--