Skip to content

Conversation

@BooleanCat
Copy link
Contributor

By taking advantage of smarter traversal of dependencies, a
go mod tidy using Go 1.18 remove some items from go.sum.

Signed-off-by: Tom Godkin [email protected]

By taking advantage of smarter traversal of dependencies, a
`go mod tidy` using Go 1.18 remove some items from go.sum.

Signed-off-by: Tom Godkin <[email protected]>
@k8s-ci-robot
Copy link

Hi @BooleanCat. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Mar 21, 2022

Build succeeded.

Copy link
Member

@kzys kzys left a comment

Choose a reason for hiding this comment

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

LGTM. Sorry I should change that when I was working on #6605.

/ok-to-test

@AkihiroSuda
Copy link
Member

We still support Go 1.17, so probably it's better to keep go.mod version to be 1.17 too

@BooleanCat
Copy link
Contributor Author

BooleanCat commented Mar 22, 2022

We still support Go 1.17, so probably it's better to keep go.mod version to be 1.17 too

The Go directive does not impose a minimum Go version. If containerd is compiled with an earlier version of Go, it will point out the mismatch only if a compile error occurs. Compatibility with Go 1.17 is still supported and can be guaranteed with Ci.

https://go.dev/ref/mod#go-mod-file-go

module github.com/containerd/containerd

go 1.17
go 1.18
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong. In here there should be a minimally supported version, so unless you do want to drop go 1.17 support right now (which is probably not the right thing to do, since go 1.17 is fully supported and is probably most used version at the moment), I would advise against this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

OTOH maybe I'm wrong #6709 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

A go directive indicates that a module was written assuming the semantics of a given version of Go

I am not sure exactly what this means, but I guess that unless the code starts using Go 1.18 features, it should not say "go 1.18" in go.mod.

Copy link
Member

Choose a reason for hiding this comment

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

The Go team has been very ambiguous wishy-washy on this; the version does indicate the minimum version that's expected to be compatible, but they were not enforcing that (yet??), and started doing things like this in their own repositories (e.g. golang/sys@0981d60) - effectively disregarding their own recommendations to at least support latest+previous (even if the version in go mod is not enforced yet).

Changing the version does affect what versions can be used to manage modules though; i.e., running go mod tidy with go 1.17 will no longer produce the same result (which means that anyone working on this project must use go1.18).

For this one, I'm a bit on the fence; is there anything we gain from the removed lines in go.sum? (the change from <1.17 to 1.17 did bring the improved "indirect" dependencies, so was clearer on benefits)

If we do decide to change, we should also update the go.mod in the integration client (which still looks to be on 1.15);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One small benefit I can see (which is what led me to to make this change) is that it results in a less complicated go mod graph which brings two benefits:

  1. Fewer false positives on security scanning tools
  2. For downstream tools using the containerd library, a potentially smaller go mod vendor output

Copy link
Member

Choose a reason for hiding this comment

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

I think we can change this to go 1.18 as long as we build containerd against 1.17 on our CI. This will guaranty compatibility.

@kzys
Copy link
Member

kzys commented Apr 1, 2022

@AkihiroSuda @mxpv Please take a look. The directive doesn't block Go 1.17.

@kzys kzys merged commit 999cbc4 into containerd:main Apr 1, 2022
@lengrongfu lengrongfu mentioned this pull request Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants