Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: working directory affects binaries even with -trimpath #33772
After #16860 was closed, I was hoping that I could build byte-for-byte identical builds regardless of what machine was used to build the binaries. At the present moment, building binaries are nearly identical regardless of the machine used, except for the following bytes:
There seems to be some type of build ID encoded into the binary.
Steps to reproduce:
Unfortunately, that command will take a while to run since it needs to build the C++
This need not block
Here's a shorter repro without needing to build
Running that above on different machines produces different binaries, even if both machines are the same host OS.
It seems that the current working directory has some affect on the build ID embedded in the binary:
changed the title
cmd/compile: reproducible builds from different host machines
Aug 22, 2019
I just hit the same issue -- is there somewhere this can be documented better, and/or maybe given a -reproducible flag that == "-trimpath -ldflags=-buildid="?