Index | Thread | Search

From:
Lucas Gabriel Vuotto <lucas@sexy.is>
Subject:
Re: sysutils/docker-cli: update to 25.0.3
To:
"Kirill A. Korinsky" <kirill@korins.ky>
Cc:
Omar Polo <op@omarpolo.com>, ports@openbsd.org
Date:
Mon, 12 Feb 2024 17:53:26 +0000

Download raw body.

Thread
Hi Kyrill, Omar,

Got around to test all the ports and they work great. Thanks for taking
the time for porting docker-compose too. I wanted to do that for some
time already.

Based on the deprecation, I believe it makes a lot of sense to make
docker-buildx a RDEP of docker-cli.

The versions aren't being reported properly:

	darjeeling$ docker buildx version
	github.com/docker/buildx v0.0.0+unknown 
	darjeeling$ docker compose version
	Docker Compose version dev

After the patch:

	darjeeling$ docker buildx version
	github.com/docker/buildx v0.12.1 
	darjeeling$ docker compose version
	Docker Compose version v2.24.5

The following patch is on top of your latest docker-cli diff + your
docker-compose tarball + Omar's docker-buildx tarball. I'm also
attaching the full diff from master + the two tarballs, to ease testing.
I reused GO_PKGNAME in a bunch of places where it made sense. I had to
add a /v2 to compose's GO_PKGNAME to make it pick up the version var
in MODGO_LDFLAGS. Also I synced the new patches to the merge PR, and
added a comment referencing it, to make it easier to drop them after
release 26.

Kyrill, it seems that your email editor is mangling the diffs by
removing the dangling whitespaces from the diff sections, which are
significant. Had to your email for the patches to apply.

Question: given that Docker names buildx and compose as plugins in their
docs, like `docker-{buildx,compose}-plugin`, would it make sense to also
name our packages like that?

Again, thanks a lot Kyrill.

	Lucas


diff a1fb6ae15ae11fe8e2a81efd5dcd8004a9d1790f 66ce938ebaa602aed50c9ed8f7db88b7b1755fe2
commit - a1fb6ae15ae11fe8e2a81efd5dcd8004a9d1790f
commit + 66ce938ebaa602aed50c9ed8f7db88b7b1755fe2
blob - 32b8236b3f6f4f6f485096cd4187ed44d95666b3
blob + 5a6d65b620cb0b200c5bea36560f3f8235fd7f4b
--- sysutils/docker-buildx/Makefile
+++ sysutils/docker-buildx/Makefile
@@ -14,11 +14,12 @@ PERMIT_PACKAGE =	Yes
 WANTLIB += 		c pthread
 
 MODULES =		lang/go
-MODGO_GOPATH =		${MODGO_WORKSPACE}
-
 GO_PKGNAME =		github.com/docker/buildx
+MODGO_GOPATH =		${MODGO_WORKSPACE}
+MODGO_LDFLAGS =		-X ${GO_PKGNAME}/version.Version=v${V}
+
 WRKSRC =		${MODGO_WORKSPACE}/src/${GO_PKGNAME}
-ALL_TARGET =		github.com/docker/buildx/cmd/buildx
+ALL_TARGET =		${GO_PKGNAME}/cmd/buildx
 
 do-install:
 	${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/docker/cli-plugins
blob - 31a3c19b77c73cfe651363928e45e40074f3adaf
blob + cc9fc7a65e6a88b303d359fb397c74379c176d13
--- sysutils/docker-cli/Makefile
+++ sysutils/docker-cli/Makefile
@@ -15,10 +15,12 @@ PERMIT_PACKAGE =	Yes
 WANTLIB += 		c pthread
 
 MODULES =		lang/go
-MODGO_LDFLAGS =		-X github.com/docker/cli/cli/version.Version=${V}
-
 GO_PKGNAME =		github.com/docker/cli
+MODGO_LDFLAGS =		-X ${GO_PKGNAME}/cli/version.Version=${V}
+
+RUN_DEPENDS =		sysutils/docker-buildx
+
 WRKSRC =		${MODGO_WORKSPACE}/src/${GO_PKGNAME}
-ALL_TARGET =		github.com/docker/cli/cmd/docker
+ALL_TARGET =		${GO_PKGNAME}/cmd/docker
 
 .include <bsd.port.mk>
blob - fea591aa4c776bea61b82c027f98be16da7357e1
blob + 2adc78d29643bc58c8f93f0aa0872c9dad635e7b
--- sysutils/docker-cli/patches/patch-cli-plugins_socket_socket_nodarwin_go
+++ sysutils/docker-cli/patches/patch-cli-plugins_socket_socket_nodarwin_go
@@ -1,9 +1,20 @@
+Avoid keeping @docker_cli_[UUID] files
+https://github.com/docker/cli/pull/4862
+
 Index: cli-plugins/socket/socket_nodarwin.go
 --- cli-plugins/socket/socket_nodarwin.go.orig
 +++ cli-plugins/socket/socket_nodarwin.go
 @@ -1,4 +1,4 @@
 -//go:build !darwin
 +//go:build !darwin && !openbsd
-
+ 
  package socket
-
+ 
+@@ -15,5 +15,6 @@ func listen(socketname string) (*net.UnixListener, err
+ 
+ func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
+ 	// do nothing
+-	// while on darwin we would unlink here; on non-darwin the socket is abstract and not present on the filesystem
++	// while on darwin and OpenBSD we would unlink here;
++	// on non-darwin the socket is abstract and not present on the filesystem
+ }
blob - 91132289909ced7ecd733e9162bfd452401eab72
blob + c6229f2c218cd497de722b11b11c786c23c5d983
--- sysutils/docker-cli/patches/patch-cli-plugins_socket_socket_openbsd_go
+++ sysutils/docker-cli/patches/patch-cli-plugins_socket_socket_openbsd_go
@@ -1,3 +1,6 @@
+Avoid keeping @docker_cli_[UUID] files
+https://github.com/docker/cli/pull/4862
+
 Index: cli-plugins/socket/socket_openbsd.go
 --- cli-plugins/socket/socket_openbsd.go.orig
 +++ cli-plugins/socket/socket_openbsd.go
blob - a131cbf3c7aafe96f6386f7d9e0364c254f2737f
blob + f9b66effe39f7ef59a267a9925a396b7df0f184d
--- sysutils/docker-compose/Makefile
+++ sysutils/docker-compose/Makefile
@@ -18,12 +18,12 @@ PERMIT_PACKAGE =	Yes
 WANTLIB += 		c pthread
 
 MODULES =		lang/go
+GO_PKGNAME =		github.com/docker/compose/v2
 MODGO_GOPATH =		${MODGO_WORKSPACE}
-MODGO_LDFLAGS =		-X github.com/docker/compose/v2/internal.Version=v${V}
+MODGO_LDFLAGS =		-X ${GO_PKGNAME}/internal.Version=v${V}
 
-GO_PKGNAME =		github.com/docker/compose
 WRKSRC =		${MODGO_WORKSPACE}/src/${GO_PKGNAME}
-ALL_TARGET =		github.com/docker/compose/cmd
+ALL_TARGET =		${GO_PKGNAME}/cmd
 
 do-install:
 	ln -s ${TRUEPREFIX}/libexec/docker/cli-plugins/docker-compose \
diff 66558c8aa9d546289d58e8d8fc876f4ab52fa9a4 66ce938ebaa602aed50c9ed8f7db88b7b1755fe2
commit - 66558c8aa9d546289d58e8d8fc876f4ab52fa9a4
commit + 66ce938ebaa602aed50c9ed8f7db88b7b1755fe2
blob - c4725a9ecd19f3cc5192e1e9b814278f053891f5
blob + cc9fc7a65e6a88b303d359fb397c74379c176d13
--- sysutils/docker-cli/Makefile
+++ sysutils/docker-cli/Makefile
@@ -1,10 +1,8 @@
 COMMENT =		command-line tool for controlling Docker
 
-V =			20.10.21
+V =			25.0.3
 
-GH_ACCOUNT =		docker
-GH_PROJECT =		cli
-GH_TAGNAME =		v${V}
+DIST_TUPLE =		github docker cli v${V} .
 PKGNAME =		docker-${DISTNAME}
 
 CATEGORIES =		sysutils
@@ -17,10 +15,12 @@ PERMIT_PACKAGE =	Yes
 WANTLIB += 		c pthread
 
 MODULES =		lang/go
-MODGO_LDFLAGS =		-X github.com/docker/cli/cli/version.Version=${V}
-
 GO_PKGNAME =		github.com/docker/cli
+MODGO_LDFLAGS =		-X ${GO_PKGNAME}/cli/version.Version=${V}
+
+RUN_DEPENDS =		sysutils/docker-buildx
+
 WRKSRC =		${MODGO_WORKSPACE}/src/${GO_PKGNAME}
-ALL_TARGET =		github.com/docker/cli/cmd/docker
+ALL_TARGET =		${GO_PKGNAME}/cmd/docker
 
 .include <bsd.port.mk>
blob - 9c835ffc12989e7a07bfa7538b36290da8ad0ea2
blob + 9f519bbd3d439d882290ebd8ac8b708d5ff29a32
--- sysutils/docker-cli/distinfo
+++ sysutils/docker-cli/distinfo
@@ -1,2 +1,2 @@
-SHA256 (cli-20.10.21.tar.gz) = 8PYsocgOj9W54UDKZO8+ddx896KAQLPRCyYDBxKJRug=
-SIZE (cli-20.10.21.tar.gz) = 7633967
+SHA256 (docker-cli-v25.0.3.tar.gz) = BK0M6pkqZdsgyxsNv20c4yxwXOh53lGyIJX+jSgDCBU=
+SIZE (docker-cli-v25.0.3.tar.gz) = 6864551
blob - cbca5bf1121d9bb4edf7d9d22f05fa80131a3045 (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_containerd_containerd_content_local_store_unix_go
+++ /dev/null
@@ -1,9 +0,0 @@
-Index: vendor/github.com/containerd/containerd/content/local/store_unix.go
---- vendor/github.com/containerd/containerd/content/local/store_unix.go.orig
-+++ vendor/github.com/containerd/containerd/content/local/store_unix.go
-@@ -1,4 +1,4 @@
--// +build linux solaris darwin freebsd netbsd
-+// +build linux solaris darwin freebsd netbsd openbsd
- 
- /*
-    Copyright The containerd Authors.
blob - /dev/null
blob + 2adc78d29643bc58c8f93f0aa0872c9dad635e7b (mode 644)
--- /dev/null
+++ sysutils/docker-cli/patches/patch-cli-plugins_socket_socket_nodarwin_go
@@ -0,0 +1,20 @@
+Avoid keeping @docker_cli_[UUID] files
+https://github.com/docker/cli/pull/4862
+
+Index: cli-plugins/socket/socket_nodarwin.go
+--- cli-plugins/socket/socket_nodarwin.go.orig
++++ cli-plugins/socket/socket_nodarwin.go
+@@ -1,4 +1,4 @@
+-//go:build !darwin
++//go:build !darwin && !openbsd
+ 
+ package socket
+ 
+@@ -15,5 +15,6 @@ func listen(socketname string) (*net.UnixListener, err
+ 
+ func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
+ 	// do nothing
+-	// while on darwin we would unlink here; on non-darwin the socket is abstract and not present on the filesystem
++	// while on darwin and OpenBSD we would unlink here;
++	// on non-darwin the socket is abstract and not present on the filesystem
+ }
blob - b66550e0750eefcb59425df2e32bfdd7f50d3030 (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_containerd_continuity_fs_stat_openbsd_go
+++ /dev/null
@@ -1,48 +0,0 @@
-Index: vendor/github.com/containerd/containerd/sys/stat_openbsd.go
---- vendor/github.com/containerd/containerd/sys/stat_openbsd.go.orig
-+++ vendor/github.com/containerd/containerd/sys/stat_openbsd.go
-@@ -0,0 +1,44 @@
-+// +build openbsd
-+/*
-+   Copyright The containerd Authors.
-+
-+   Licensed under the Apache License, Version 2.0 (the "License");
-+   you may not use this file except in compliance with the License.
-+   You may obtain a copy of the License at
-+
-+       http://www.apache.org/licenses/LICENSE-2.0
-+
-+   Unless required by applicable law or agreed to in writing, software
-+   distributed under the License is distributed on an "AS IS" BASIS,
-+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+   See the License for the specific language governing permissions and
-+   limitations under the License.
-+*/
-+
-+package sys
-+
-+import (
-+	"syscall"
-+	"time"
-+)
-+
-+// StatAtime returns the Atim
-+func StatAtime(st *syscall.Stat_t) syscall.Timespec {
-+	return st.Atim
-+}
-+
-+// StatCtime returns the Ctim
-+func StatCtime(st *syscall.Stat_t) syscall.Timespec {
-+	return st.Ctim
-+}
-+
-+// StatMtime returns the Mtim
-+func StatMtime(st *syscall.Stat_t) syscall.Timespec {
-+	return st.Mtim
-+}
-+
-+// StatATimeAsTime returns st.Atim as a time.Time
-+func StatATimeAsTime(st *syscall.Stat_t) time.Time {
-+	// The int64 conversions ensure the line compiles for 32-bit systems as well.
-+	return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) // nolint: unconvert
-+}
blob - /dev/null
blob + c6229f2c218cd497de722b11b11c786c23c5d983 (mode 644)
--- /dev/null
+++ sysutils/docker-cli/patches/patch-cli-plugins_socket_socket_openbsd_go
@@ -0,0 +1,26 @@
+Avoid keeping @docker_cli_[UUID] files
+https://github.com/docker/cli/pull/4862
+
+Index: cli-plugins/socket/socket_openbsd.go
+--- cli-plugins/socket/socket_openbsd.go.orig
++++ cli-plugins/socket/socket_openbsd.go
+@@ -0,0 +1,19 @@
++package socket
++
++import (
++	"net"
++	"os"
++	"path/filepath"
++	"syscall"
++)
++
++func listen(socketname string) (*net.UnixListener, error) {
++	return net.ListenUnix("unix", &net.UnixAddr{
++		Name: filepath.Join(os.TempDir(), socketname),
++		Net:  "unix",
++	})
++}
++
++func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
++	syscall.Unlink(listener.Addr().String())
++}
blob - ddd15e262e8a6eb75518e8cddc9cfafd0189023b (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_moby_sys_mount_mounter_bsd_go
+++ /dev/null
@@ -1,9 +0,0 @@
-Index: vendor/github.com/moby/sys/mount/mounter_bsd.go
---- vendor/github.com/moby/sys/mount/mounter_bsd.go.orig
-+++ vendor/github.com/moby/sys/mount/mounter_bsd.go
-@@ -1,4 +1,4 @@
--// +build freebsd,cgo openbsd,cgo
-+// +build freebsd,cgo
- 
- package mount
- 
blob - b7b0b9f0a671dea9d18378bb5cee5ffc1492cbfb (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_moby_sys_mount_mounter_openbsd_go
+++ /dev/null
@@ -1,69 +0,0 @@
-Index: vendor/github.com/moby/sys/mount/mounter_openbsd.go
---- vendor/github.com/moby/sys/mount/mounter_openbsd.go.orig
-+++ vendor/github.com/moby/sys/mount/mounter_openbsd.go
-@@ -0,0 +1,65 @@
-+// +build openbsd,cgo
-+
-+package mount
-+
-+/*
-+#include <sys/types.h>
-+#include <sys/mount.h>
-+*/
-+import "C"
-+
-+import (
-+	"fmt"
-+	"syscall"
-+	"unsafe"
-+)
-+
-+func createExportInfo(readOnly bool) C.struct_export_args {
-+	exportFlags := C.int(0)
-+	if readOnly {
-+		exportFlags = C.MNT_EXRDONLY
-+	}
-+	out := C.struct_export_args{
-+		ex_root:  0,
-+		ex_flags: exportFlags,
-+	}
-+	return out
-+}
-+
-+func createUfsArgs(device string, readOnly bool) unsafe.Pointer {
-+	out := &C.struct_ufs_args{
-+		fspec:       C.CString(device),
-+		export_info: createExportInfo(readOnly),
-+	}
-+	return unsafe.Pointer(out)
-+}
-+
-+func mount(device, target, mType string, flag uintptr, data string) error {
-+	readOnly := flag&RDONLY == 1
-+
-+	var fsArgs unsafe.Pointer
-+
-+	if mType == "ffs" {
-+		fsArgs = createUfsArgs(device, readOnly)
-+	} else {
-+		return &mountError{
-+			op:     "mount",
-+			source: device,
-+			target: target,
-+			flags:  flag,
-+			err:    fmt.Errorf("unsupported type"),
-+		}
-+	}
-+
-+	if errno := C.mount(C.CString(mType), C.CString(target), C.int(flag), fsArgs); errno != 0 {
-+		return &mountError{
-+			op:     "mount",
-+			source: device,
-+			target: target,
-+			flags:  flag,
-+			err:    syscall.Errno(errno),
-+		}
-+	}
-+
-+	return nil
-+}
blob - 3981d4e86c3d52842d226b649f54dcfdfdc45417 (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_tonistiigi_fsutil_diskwriter_go
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: vendor/github.com/tonistiigi/fsutil/diskwriter.go
---- vendor/github.com/tonistiigi/fsutil/diskwriter.go.orig
-+++ vendor/github.com/tonistiigi/fsutil/diskwriter.go
-@@ -104,7 +104,7 @@ func (dw *DiskWriter) HandleChange(kind ChangeKind, p 
- 
- 	stat, ok := fi.Sys().(*types.Stat)
- 	if !ok {
--		return errors.WithStack(&os.PathError{Path: p, Err: syscall.EBADMSG, Op: "change without stat info"})
-+		return errors.WithStack(&os.PathError{Path: p, Err: syscall.Errno(0x5c), Op: "change without stat info"})
- 	}
- 
- 	statCopy := *stat
blob - 32238f447f33786430ecd2a3bcc190a2fb8c36e6 (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_tonistiigi_fsutil_fs_go
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: vendor/github.com/tonistiigi/fsutil/fs.go
---- vendor/github.com/tonistiigi/fsutil/fs.go.orig
-+++ vendor/github.com/tonistiigi/fsutil/fs.go
-@@ -80,7 +80,7 @@ func (fs *subDirFS) Walk(ctx context.Context, fn filep
- 		if err := d.FS.Walk(ctx, func(p string, fi os.FileInfo, err error) error {
- 			stat, ok := fi.Sys().(*types.Stat)
- 			if !ok {
--				return errors.WithStack(&os.PathError{Path: d.Stat.Path, Err: syscall.EBADMSG, Op: "fileinfo without stat info"})
-+				return errors.WithStack(&os.PathError{Path: d.Stat.Path, Err: syscall.Errno(0x5c), Op: "fileinfo without stat info"})
- 			}
- 			stat.Path = path.Join(d.Stat.Path, stat.Path)
- 			if stat.Linkname != "" {
blob - 75a984172631d8c6f93745db9b941d9407a7aa3a (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_tonistiigi_fsutil_hardlinks_go
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: vendor/github.com/tonistiigi/fsutil/hardlinks.go
---- vendor/github.com/tonistiigi/fsutil/hardlinks.go.orig
-+++ vendor/github.com/tonistiigi/fsutil/hardlinks.go
-@@ -29,7 +29,7 @@ func (v *Hardlinks) HandleChange(kind ChangeKind, p st
- 
- 	stat, ok := fi.Sys().(*types.Stat)
- 	if !ok {
--		return errors.WithStack(&os.PathError{Path: p, Err: syscall.EBADMSG, Op: "change without stat info"})
-+		return errors.WithStack(&os.PathError{Path: p, Err: syscall.Errno(0x5c), Op: "change without stat info"})
- 	}
- 
- 	if fi.IsDir() || fi.Mode()&os.ModeSymlink != 0 {
blob - 38f6bad6800578c73cb2b1ff922688ed5d16160d (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_tonistiigi_fsutil_send_go
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: vendor/github.com/tonistiigi/fsutil/send.go
---- vendor/github.com/tonistiigi/fsutil/send.go.orig
-+++ vendor/github.com/tonistiigi/fsutil/send.go
-@@ -150,7 +150,7 @@ func (s *sender) walk(ctx context.Context) error {
- 		}
- 		stat, ok := fi.Sys().(*types.Stat)
- 		if !ok {
--			return errors.WithStack(&os.PathError{Path: path, Err: syscall.EBADMSG, Op: "fileinfo without stat info"})
-+			return errors.WithStack(&os.PathError{Path: path, Err: syscall.Errno(0x5c), Op: "fileinfo without stat info"})
- 		}
- 
- 		p := &types.Packet{
blob - 795cbf6d7906432cc17578ee41707836b1f63d91 (mode 644)
blob + /dev/null
--- sysutils/docker-cli/patches/patch-vendor_github_com_tonistiigi_fsutil_tarwriter_go
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: vendor/github.com/tonistiigi/fsutil/tarwriter.go
---- vendor/github.com/tonistiigi/fsutil/tarwriter.go.orig
-+++ vendor/github.com/tonistiigi/fsutil/tarwriter.go
-@@ -21,7 +21,7 @@ func WriteTar(ctx context.Context, fs FS, w io.Writer)
- 		}
- 		stat, ok := fi.Sys().(*types.Stat)
- 		if !ok {
--			return errors.WithStack(&os.PathError{Path: path, Err: syscall.EBADMSG, Op: "fileinfo without stat info"})
-+			return errors.WithStack(&os.PathError{Path: path, Err: syscall.Errno(0x5c), Op: "fileinfo without stat info"})
- 		}
- 		hdr, err := tar.FileInfoHeader(fi, stat.Linkname)
- 		if err != nil {