This works around https://github.com/wangyoucao577/go-release-action/issues/143 by removing the downloaded Go source code before running make. The downloaded source code was triggering git status -s to report the repository as dirty. I ran a debug build that shows go-linux.tar.gz as the culprit:
Line 218 shows go-linux.tar.gz appearing in git status -s
Line 241 shows the LDFLAG reporting the undesired value of "dirty": github.com/Cray-HPE/gru/pkg/version.GitTreeState='dirty''
After resolving that and testing a bogus v0.0.5a2 tag, I observed a "clean" GitTreeState:
line 217 shows removal of the downloaded source tar
Line 241 shows the LDFLAG reporting the desired "clean" value: github.com/Cray-HPE/gru/pkg/version.GitTreeState='clean'
I've made an upstream PR, but in the meantime (or in case it never merges) we can fix this by just removing the downloaded file.
This also fixes a non-issue, where the current go.mod file needed go mod tidy ran. make invokes go mod tidy which does modify go.mod with the current HEAD, however this does NOT cause the problem. GitTreeState is resolved beforego mod tidy is invoked during make, however it's kosher/proper to clean this up regardless.
Risks and Mitigations
This will fix official release's version strings, giving more confidence that the app was built cleanly.
Summary and Scope
Issue Type
This works around https://github.com/wangyoucao577/go-release-action/issues/143 by removing the downloaded Go source code before running
make
. The downloaded source code was triggeringgit status -s
to report the repository as dirty. I ran a debug build that showsgo-linux.tar.gz
as the culprit:go-linux.tar.gz
appearing ingit status -s
LDFLAG
reporting the undesired value of "dirty":github.com/Cray-HPE/gru/pkg/version.GitTreeState='dirty''
After resolving that and testing a bogus v0.0.5a2 tag, I observed a "clean"
GitTreeState
:LDFLAG
reporting the desired "clean" value:github.com/Cray-HPE/gru/pkg/version.GitTreeState='clean'
I've made an upstream PR, but in the meantime (or in case it never merges) we can fix this by just removing the downloaded file.
This also fixes a non-issue, where the current
go.mod
file neededgo mod tidy
ran.make
invokesgo mod tidy
which does modifygo.mod
with the current HEAD, however this does NOT cause the problem.GitTreeState
is resolved beforego mod tidy
is invoked duringmake
, however it's kosher/proper to clean this up regardless.Risks and Mitigations
This will fix official release's version strings, giving more confidence that the app was built cleanly.