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
zero out the build id for reproducible builds #89136
zero out the build id for reproducible builds #89136
Conversation
We have been having issues with making builds reproducible, especially with the `.note.go.buildid` ELF section. One tip from a golang issue was to set `-ldflags=-buildid=` which seems to work well. You can confirm that the buildid is set to empty by inspecting the binaries with the go command example `go tool buildid _output/local/go/bin/kubectl` Signed-off-by: Davanum Srinivas <davanum@gmail.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/priority important-soon cc @bmwiedemann Bernhard, can you please try this? |
|
/assign @cblecker @BenTheElder |
|
Seems reasonable to me. /cc @justaugustus |
|
is it reproducible after this? |
|
starting points:
Here we can see more about how it is used, in short it appears to be part of how It seems like we may only want to set this to zero when we produce release binaries, otherwise we may be unnecessarily defeating the cache. Some of the binaries we build probably don't need to be reproducible anyhow (code generators? linters?). |
|
@BenTheElder if you see the issue, we are chipping away at the reproducibility bit by bit. please see latest runs from @bmwiedemann here: There's a few more things to take care of after that: Also note that |
|
/retest |
|
cc @Katharine FYI WRT caching I would suggest that reproducible builds be performed in a container (e.g. like our official releases...) which should ensure fixed paths. KIND has had reproducible release artifacts for some time by simply doing this... |
|
@Katharine will you have some time to dig into this? i'd like to get this in early to see if this breaks something .. |
|
/lgtm |
We have been having issues with making builds reproducible, especially
with the
.note.go.buildidELF section. One tip from a golang issue wasto set
-ldflags=-buildid=which seems to work well. You can confirmthat the buildid is set to empty by inspecting the binaries with the go
command example
go tool buildid _output/local/go/bin/kubectlSigned-off-by: Davanum Srinivas davanum@gmail.com
What type of PR is this?
/kind bug
What this PR does / why we need it:
Tip is from here : golang/go#34186 (comment)
Struggles with reproducible builds are documented here : #70131
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: