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

go tool fix suddenly failing #1950

Closed
prestist opened this issue Oct 9, 2024 · 4 comments
Closed

go tool fix suddenly failing #1950

prestist opened this issue Oct 9, 2024 · 4 comments
Assignees
Labels
jira for syncing to jira

Comments

@prestist
Copy link
Collaborator

prestist commented Oct 9, 2024

Bug

When running the shell script for ./test which is invoked in our CI, we currently are getting

Checking for license headers...
Using version from git: v2.19.0-80-g74f68429-dirty
Building ignition...
Building ignition-validate...
Checking gofix...
invalid -go=

Ignition Version

Latest

Environment

CI build or local

Expected Behavior

No error, and it to report the expected diff from go tool fix

Actual Behavior

Reproduction Steps

  1. Clean enviornment
go clean -modcache
rm -rf vendor/
go mod tidy
go mod vendor
  1. Run ./test.sh

Other Information

The sudden failure of this is odd, it was working, golang target has not changed, the only thing I can think is maybe a dependency is not playing well with go tool fix. However, thats also odd because it would not have made it into main (since this is invoked in ci)

@prestist
Copy link
Collaborator Author

prestist commented Oct 9, 2024

Note: we are just using go tool fix -diff

usage: go tool fix [-diff] [-r fixname,...] [-force fixname,...] [path ...]
  -diff
        display diffs instead of rewriting files

Since its a no-op maybe we drop it?

prestist added a commit to prestist/ignition that referenced this issue Oct 10, 2024
Add -go flag to go tool fix to correctly set the go version.
A change external to the codebase is causing the default go version
to not populate.

fixes: coreos#1950
@guilhem
Copy link

guilhem commented Oct 11, 2024

Problem come from this commit: golang/go@7fd62ba

it can be fixed by setting version in format: -go=go1.20 🤷‍♂️

prestist added a commit to coreosbot-releng/ignition that referenced this issue Oct 11, 2024
As of 1.22.7 the go the fix tool nolonger self populates.
You can see the changes mentioned here:
golang/go@676d610#diff-a4f750f77a9e274ac048407886b3e210cdde1543878d681a6fa96b9d2ec49c23R69

fixes: coreos#1950
@prestist
Copy link
Collaborator Author

@guilhem yeah it looks like a bug fix was ported back to 1.22.7 https://go.dev/doc/devel/release#go1.22.7 which fixed an issue where some 1.22.x versions would fail even though they were valid. This broke us because the jenkins ci is using it, but the older versions were not.

The consequence is there does not seem to be any default behavior any more, seen here golang/go@676d610#diff-a4f750f77a9e274ac048407886b3e210cdde1543878d681a6fa96b9d2ec49c23R71

Setting it to a static go version would work but we want it to be what ever version is being built, so it needs to be dynamic, which consequently got us to experience the bug that change fixed you can see it in the ci in my first pr #1951, basically 1.20, and 1.21 dont have that fix so any ways due to how our ci is maintianed we had to make a pr into a diffrent repo which manages our ci which created this pr here, and I just copied the contents from my first pr into it.

Pr:1
#1951
And now subsequently
Pr:2
#1952

@prestist prestist added the jira for syncing to jira label Oct 14, 2024
@prestist
Copy link
Collaborator Author

Temp re-open to track downstream

@prestist prestist reopened this Oct 14, 2024
@prestist prestist added jira for syncing to jira and removed jira for syncing to jira labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira
Projects
None yet
2 participants