Skip to content
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

build: set buildid once more #30342

Merged
merged 1 commit into from
Aug 23, 2024
Merged

build: set buildid once more #30342

merged 1 commit into from
Aug 23, 2024

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Aug 23, 2024

The previous clearing of buildid did fully work, turns out we need to set it in ldflags

The go buildid is the only remaining hurdle for reproducible builds, see #28987 (comment)

This PR changes the go build id application note to say literally none

golang/go#33772 (comment):

This difference is due to the .note.go.buildid section added by the linker. It can be set to something static e.g. -ldflags=-buildid= (empty string) to gain reproducibility.

@holiman
Copy link
Contributor Author

holiman commented Aug 23, 2024

root@51f7eacb67ee:/go-ethereum# /usr/local/go/bin/go build -ldflags "-buildid=none -X github.com/ethereum/go-ethereum/internal/version.gitCommit=30824faf90bf5d1f5e4a1cf0b50de80f10d16490 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20240821 -extldflags '-Wl,-z,stack-size=0x800000,--strip-all'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o /go-ethereum/build/bin/geth ./cmd/geth/
root@51f7eacb67ee:/go-ethereum# /usr/local/go/bin/go tool buildid ./build/bin/geth  
none
root@51f7eacb67ee:/go-ethereum# /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=30824faf90bf5d1f5e4a1cf0b50de80f10d16490 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20240821 -extldflags '-Wl,-z,stack-size=0x800000,--strip-all'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o /go-ethereum/build/bin/geth ./cmd/geth/
root@51f7eacb67ee:/go-ethereum# /usr/local/go/bin/go tool buildid ./build/bin/geth  
S960XgfR35iiFDtSn4pY/RS3iznJWmgl0qd_gKEYS/a1eh6QOr0GbndRDtt2ue/Yvt8QqtezyVg5hnAyA7M

@holiman holiman added this to the 1.14.9 milestone Aug 23, 2024
@holiman holiman merged commit ada20c0 into ethereum:master Aug 23, 2024
2 of 3 checks passed
@fjl
Copy link
Contributor

fjl commented Aug 23, 2024

Maybe we could put some useful information in there?

mask-pp pushed a commit to mask-pp/go-ethereum that referenced this pull request Aug 30, 2024
The previous clearing of buildid did fully work, turns out we need to
set it in `ldflags`

The go buildid is the only remaining hurdle for reproducible builds, see
ethereum#28987 (comment)

This PR changes the go build id application note to say literally `none`

golang/go#33772 (comment):

> This difference is due to the .note.go.buildid section added by the
linker. It can be set to something static e.g. -ldflags=-buildid= (empty
string) to gain reproducibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants