containerd is FTBFS with Go 1.18

Bug #1965157 reported by William Wilson
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
containerd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

There is a redirect in go.mod and in vendor/modules.txt to redirect containerd to an empty module. This is not compatible with Go 1.18 and should therefore be removed. Removal has not caused any problems with Go 1.17.

Tags: patch
Revision history for this message
William Wilson (jawn-smith) wrote :
Revision history for this message
William Wilson (jawn-smith) wrote :
tags: added: patch
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Hi William,

Thanks for working on it. I took a look at what upstream is doing regarding that and I believe it is OK to remove the empty module, but I'll suggest an extra change based on the upstream discussions. We should replace "go 1.16" in go.mod to "go 1.17" to have this feature which should avoid any circular dependency issue:

https://go.dev/ref/mod#graph-pruning

Could you please test it and make sure it is working with Go 1.18? If this is not ask too much, could you also submit your changes via a PR here https://github.com/tianon/debian-containerd (targeting the ubuntu branch)? We have been maintaining this package there.

Some references:

https://github.com/golang/go/issues/51285
https://github.com/containerd/containerd/issues/6586
https://github.com/containerd/containerd/pull/6605

Changed in containerd (Ubuntu):
status: New → Triaged
Revision history for this message
William Wilson (jawn-smith) wrote :

Lucas,

Changing go.mod to rely on Go 1.17 does actually cause it to FTBFS. The errors are related to vendored modules not being explicitly required in go.mod. Is this something we should tackle now?

Here is a full failed build log: https://launchpadlibrarian.net/592301054/buildlog_ubuntu-jammy-amd64.containerd_1.5.9-0ubuntu3ppa1_BUILDING.txt.gz

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Yep, the structure of go.mod and some other files need to be changed to support Go 1.17. I updated the needed files running the following commands:

$ go mod tidy -go=1.17
$ go mod vendor

With that, I created the attached debdiff which fixes the FTBFS. Could you confirm if everything is fine with the debdiff?

Revision history for this message
William Wilson (jawn-smith) wrote :

Lucas, this is working great! golang-defaults has now migrated. Would you like me to sponsor this or would you rather do the upload?

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for confirming that William. I already uploaded the fix.

Changed in containerd (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package containerd - 1.5.9-0ubuntu3

---------------
containerd (1.5.9-0ubuntu3) jammy; urgency=medium

  * d/p/build-with-go1.18.patch: fix FTBFS with Go 1.18 (LP: #1965157).
    In Go 1.17 the module graph has been changed to enable pruning and lazy
    loading, some changes to go.{mod,sum} files are needed. We were delaying
    the fix of this issue but now is the time.

 -- Lucas Kanashiro <email address hidden> Wed, 23 Mar 2022 19:41:42 +0000

Changed in containerd (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.