Skip to content

[27.x] update go:build tags to use go1.22, fix missing go:build tags#48885

Merged
thaJeztah merged 4 commits intomoby:27.xfrom
thaJeztah:27.x_backport_more_build_tags
Nov 15, 2024
Merged

[27.x] update go:build tags to use go1.22, fix missing go:build tags#48885
thaJeztah merged 4 commits intomoby:27.xfrom
thaJeztah:27.x_backport_more_build_tags

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

(partial) backports:

[27.x] daemon/containerd: add missing go:build tag

relates to:

This was introduced in c902e1a;

make BIND_DIR=. shell
make -C ./internal/gocompat/
GO111MODULE=on go test -v
# github.com/docker/docker/daemon/containerd
../../daemon/containerd/image.go:113:17: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../../daemon/containerd/image.go:113:32: "github.com/distribution/reference".Named to satisfy comparable requires go1.20 or later (-lang was set to go1.16; check go.mod)
../../daemon/containerd/image_list.go:505:16: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)

…g to go1.16

commit 2847c4b switched networkdb to use
go-immutable-radix v2, which uses generics, but failed to add the go:build
directives.

    # github.com/docker/docker/libnetwork/networkdb
    ../../libnetwork/networkdb/networkdb.go:47:19: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    ../../libnetwork/networkdb/networkdb.go:259:33: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    ../../libnetwork/networkdb/networkdb.go:269:25: function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    ../../libnetwork/networkdb/networkdb.go:270:27: function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5403e3f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
…rading to go1.16

commit 77f2d90 introduced the slices import,
which uses generics, but failed to add the go:build directives.

    # github.com/docker/docker/daemon/logger/loggerutils
    ../../daemon/logger/loggerutils/logfile.go:770:2: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fb6da4f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
commit a0807e7 configured golangci-lint
to use go1.23 semantics, which alowed linters like `copyloopvar` to lint
using thee correct semantics.

go1.22 now creates a copy of variables when assigned in a loop; make sure we
don't have files that may downgrade semantics to go1.21 in case that also means
disabling that feature; https://go.dev/ref/spec#Go_1.22

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b453aa6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This was introduced in c902e1a;

    make BIND_DIR=. shell
    make -C ./internal/gocompat/
    GO111MODULE=on go test -v
    # github.com/docker/docker/daemon/containerd
    ../../daemon/containerd/image.go:113:17: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    ../../daemon/containerd/image.go:113:32: "github.com/distribution/reference".Named to satisfy comparable requires go1.20 or later (-lang was set to go1.16; check go.mod)
    ../../daemon/containerd/image_list.go:505:16: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

Failure is unrelated;

=== Failed
=== FAIL: github.com/docker/docker/integration-cli TestDockerAPISuite/TestContainersAPICreateMountsCreate/2_config:_{volume_test1_c:\foo_false__<nil>_<nil>_<nil>_<nil>} (11.95s)
    docker_api_containers_test.go:1953: timeout hit after 10s: container 9836a9aec714989deddd934497ec7afd5a105d22ff5b5c1a74c677624111591a is running, waiting for exit

=== FAIL: github.com/docker/docker/integration-cli TestDockerAPISuite/TestContainersAPICreateMountsCreate (38.32s)

=== FAIL: github.com/docker/docker/integration-cli TestDockerAPISuite (404.73s)

@thaJeztah thaJeztah merged commit 1ef4219 into moby:27.x Nov 15, 2024
@thaJeztah thaJeztah deleted the 27.x_backport_more_build_tags branch November 15, 2024 14:00
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.

2 participants