-
Notifications
You must be signed in to change notification settings - Fork 274
Description
The README still lists "Go 1.9 or newer to build", but it's really Go 1.13, due to use in containerd modules of errors.As and errors.Is, introduced in Go 1.13.
> go1.12.17.exe install .\cmd\wclayer\... .\cmd\containerd-shim-runhcs-v1\... .\cmd\device-util\... .\cmd\runhcs\... .\cmd\shimdiag\... .\cmd\tar2ext4\...
# github.com/Microsoft/hcsshim/vendor/github.com/containerd/containerd/errdefs
vendor\github.com\containerd\containerd\errdefs\errors.go:54:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
vendor\github.com\containerd\containerd\errdefs\errors.go:59:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
vendor\github.com\containerd\containerd\errdefs\errors.go:65:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
vendor\github.com\containerd\containerd\errdefs\errors.go:71:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
vendor\github.com\containerd\containerd\errdefs\errors.go:76:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
vendor\github.com\containerd\containerd\errdefs\errors.go:81:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
vendor\github.com\containerd\containerd\errdefs\errors.go:86:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
vendor\github.com\containerd\containerd\errdefs\errors.go:92:9: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".Is
# github.com/Microsoft/hcsshim/vendor/github.com/containerd/ttrpc
vendor\github.com\containerd\ttrpc\client.go:357:6: undefined: "github.com/Microsoft/hcsshim/vendor/github.com/pkg/errors".As
Containerd claims 1.15 minimum, as seen above, but the same command with go1.13.15.exe doesn't fail to build.
Note that before #946 pulled in the newer containerd, the minimum was 1.12, due to hcsshim's use of exec.ExitError.ExitCode introduced in Go 1.12.
> go1.11.13.exe install .\cmd\wclayer\... .\cmd\containerd-shim-runhcs-v1\... .\cmd\device-util\... .\cmd\runhcs\... .\cmd\shimdiag\... .\cmd\tar2ext4\...
# github.com/Microsoft/hcsshim/internal/cmd
internal\cmd\diag.go:55:18: exiterr.ExitCode undefined (type *exec.ExitError has no field or method ExitCode)
I'd propose to bump the minimum to Go 1.13 or higher, and also as part of that, drop the vendor directories, as keeping those (particularly tests/vendor) up to date is the slowest part of rebasing and cleaning PRs for review; since Go 1.13 has modules on-by-default, there should be no ecosystem pieces that hcsshim depends on which depend on the vendor/ tree once Go 1.13 is the minimum. gometalinter is the only cause for concern in the AppVeyor script, I haven't checked how it works with without vendor/, but it's only doing gofmt anyway, so I don't expect issues there.
go.mod already claims Go 1.13 minimum, but Go 1.12 without modules enabled would have ignored that anyway.
AppVeyor CI currently uses Go 1.15, to support -gcflags=all=-d=checkptr, since #926, and Go 1.13.4 before that, so any claims for support of Go 1.12 or earlier were untested by the public CI.
containerd is 1.15 minimum since 1.4.0, and Docker Engine 19.03, 20.10 and master are all using Go 1.13 in their Dockerfile. I am unaware of what else might be vendoring hcsshim.
Microsoft go-winio may do so in future (microsoft/go-winio#187), but only for a test, not primary functionality, so this should not have a knock-on effect there. They list Go 1.12 minimum in their go.mod.
If we need to regain Go 1.12 support, we have to back out #946, and #947 which depended on it, and reconsider how to implement #901, possibly reinstating the first version of the hard-link support that didn't require #947. This would also block updating to containerd 1.4, which also includes the use of errors.Is.