-
Notifications
You must be signed in to change notification settings - Fork 128
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
[bug] The git status is dirty for releases #652
Comments
Is it because we run |
Yeah I was wondering that too, but slsa-github-generator/.gitignore Line 15 in 98d91d1
I can't think of an obvious reason why this is happening. |
@naveensrinivasan BTW you can print the build info without writing a program like follows $ go mod vendor
$ go build -mod=vendor -o generic ./internal/builders/generic/
$ go version -m generic
generic: go1.18
...
build vcs=git
build vcs.revision=98d91d15f44c7d0d34ab643356cc5adcdf4f64e2
build vcs.time=2022-08-02T07:58:33Z
build vcs.modified=false |
Thanks! Good to know! |
This is also an issue for the generic generator $ go version -m slsa-generator-generic-linux-amd64 | grep vcs
build vcs=git
build vcs.revision=bdd89e60dc5387d8f819bebc702987956bcd4913
build vcs.time=2022-07-19T18:02:42Z
build vcs.modified=true |
BTW, this also affects user repos since we run |
Describe the bug
With
go 1.18
the build info https://pkg.go.dev/debug/buildinfo@master is embedded within the binary.I used this example source code to investigate the buildinfo
I downloaded the binaries from GitHub releases and passed them to the above example code. This is version
v1.2.0
Here is the output
go run main.go ~/Downloads/slsa-builder-go-linux-amd64 {-compiler gc} {-ldflags -s -w} {-tags netgo} {CGO_ENABLED 0} {GOARCH amd64} {GOOS linux} {GOAMD64 v1} {vcs git} {vcs.revision bdd89e60dc5387d8f819bebc702987956bcd4913} {vcs.time 2022-07-19T18:02:42Z} {vcs.modified true}
go run main.go ~/Downloads/slsa-generator-generic-linux-amd64 {-compiler gc} {-tags netgo} {CGO_ENABLED 0} {GOARCH amd64} {GOOS linux} {GOAMD64 v1} {vcs git} {vcs.revision bdd89e60dc5387d8f819bebc702987956bcd4913} {vcs.time 2022-07-19T18:02:42Z} {vcs.modified true}
I thought this was probably an issue with the latest build. So I tried with the previous release and realized it is the same.This is version
v1.1.1
go run main.go ~/Downloads/slsa-builder-go-linux-amd64-2 {-compiler gc} {-tags netgo} {CGO_ENABLED 0} {GOARCH amd64} {GOOS linux} {GOAMD64 v1} {vcs git} {vcs.revision d995948e8d53cc639c0d3ef69db31dbc243519c4} {vcs.time 2022-06-20T21:41:41Z} {vcs.modified true}
Actual output is
{vcs.modified true}
Expected output to be
This
{vcs.modified false}
should be false.The text was updated successfully, but these errors were encountered: