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

Figure out why GoReleaser builds needs -buildid= added to ldflags for reproducible builds on GitHub Actions #4124

Open
tjanez opened this issue Jul 7, 2021 · 0 comments
Labels
c:build Category: build environment c:ops Category: operations golang

Comments

@tjanez
Copy link
Member

tjanez commented Jul 7, 2021

NOTE: Originally reported on Jan 23, 2020 in https://github.com/oasislabs/goreleaser/issues/1.

The fix for golang/go#33772, i.e. to no longer require to run go build with -ldflags=-buildid= set, has been backported to Go 1.13 (golang/go#34326) and is included in the Go 1.13.4 release.

However, when building the oasis-node binary in Oasis Core using GoReleaser via GitHub Actions returns different results depending on the path where the Oasis Core git repository is checked out, unless -buildid= is added to ldflags.

On the other hand, building the oasis-node binary directly via Make's go build invocation works regardless of the path where the Oasis Core git repository is checked out (and without needing -buildid= added to ldflags).

Here is an example GitHub Actions workflow run that demonstrates this issue:

Screenshot from 2020-01-23 17-40-54

The GoReleaser binaries built from different git paths only differ in:

  • .note.go.buildid
  • .note.gnu.build-id

as was discovered in #2571 (comment).

@tjanez tjanez added c:build Category: build environment c:ops Category: operations golang labels Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:build Category: build environment c:ops Category: operations golang
Projects
None yet
Development

No branches or pull requests

1 participant