-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: hub+kubernetes has random cgo_gotypes build path #63851
Comments
|
I made a more simplified reproducer with for i in 1 2 ; do
rm -rf ~/.cache/go-build
go build -mod=vendor -gcflags 'all=-trimpath' -o bin/hub
md5sum bin/hub
done Both the |
Why are you using |
also kubernetes/kubernetes@bf27cad has some insight. |
I did a quick re-test and both
and
would produce bit-identical results. What does the |
@bmwiedemann, the Those flags necessarily do not affect the output of the C compiler or linker or the In general the |
For me, this does not yet explain, why this helps for reproducibility: - -gcflags 'all=-trimpath'
+ -gcflags '-trimpath' We are still only passing it to the go-compiler, so this issue should not be from the C compiler or linker? If we assume, only |
per golang/go#63851 this is the recommended way to achieve reproducible builds. This patch was done while working on reproducible builds for openSUSE.
Another observation: just by dropping the |
closing as not an issue in the go toolchain |
@bmwiedemann, the At any rate, the conclusion here is the same either way: if you want reproducible binaries, you need to pass the |
I started digging here, and it seems like
Is there a simple way to convert a module path to a file path ? It looks like |
@thockin, binaries built with Instead, You can get the file path for a give package import path using |
It's unfortunate - we vendor everything, so we COULD resolve to file paths. It works the way we want (mostly) with So right now I am hunting down the places where we get filenames which (after this change) are not actual paths, and seeing if/how to fix those. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I did a double-build of
hub
andkubernetes1.27
in openSUSE.What did you expect to see?
two identical results
What did you see instead?
strings
of the producedhub
binary varied thusly:This was initially reported in kubernetes/kubernetes#110928
The text was updated successfully, but these errors were encountered: