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

Negate Golang 1.16 go mod download affecting go.sum #382

Merged
merged 1 commit into from
Jan 31, 2021

Conversation

ericvn
Copy link
Contributor

@ericvn ericvn commented Jan 31, 2021

Golang 1.16 RC 1 has a behavior change where go mod download affects the go.sum file adding additional listed modules. These additional modules in go.sum are removed with a go mod tidy. @howardjohn wrote golang/go#43994 for the change in behavior which was closed as working as designed.

Two Istio PRs were already merged to change the order of targets so that the go mod tidy happened after the go mod download during a make gen so the go.sum file doesn't highlight a change. This PR is adding a go mod tidy within the makefile target containing the go mod download so the target itself won't have an overall effect on go.sum.

Some testing shows that go mod download places about 1.55 GB of modules into the cache. In John's PR they mentioned using go list instead of go mod download as the number of modules downloaded will be less and go.sum will not be affected. go list downloads about 750 MB worth of files.

The go mod download was added into the makefiles when the license-lint related targets were added. It was a precursor to the license-lint call. The license-lint code actually does a go list -mod=readonly -deps -test ./... so doing the go mod download is not actually needed.

I did add an extra target which downloads the files using go list, just to highlight an alternative command/target. It is possible to remove the lines between the mod-download-go and list-all-go targets so both just do the go list.

@jwendell, I know you made some changes in this space, so would like your feedback as well.

@ericvn ericvn requested a review from a team as a code owner January 31, 2021 03:55
@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Jan 31, 2021
@istio-testing istio-testing added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 31, 2021
Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just remove the download depency for the license target as well?

@istio-testing istio-testing merged commit d73e164 into istio:master Jan 31, 2021
@ericvn ericvn deleted the goModDownload branch February 1, 2021 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants