Friday, May 31, 2024

Re: Update: docker-compose to 2.27.1

On Fri, 31 May 2024 17:18:40 +0100,
Theo Buehler <tb@theobuehler.org> wrote:
>
> On Fri, May 24, 2024 at 06:37:26PM +0100, Kirill A. Korinsky wrote:
> > ports@,
> >
> > Here an update for docker-compose to the last version which was released a
> > few hours ago.
> >
> > The good news that this release includes our patches that allows to drop it
> > from ports tree.
> >
> > The only patch that left was also merged to upstream of buildkit and the
> > next release of buildkit will include that.
> >
> > After that this port can be rewritten to usual go port and vendor artifact
> > can be avoided.
> >
> > Thus, it is future, but todays diff which was tested on -current/amd64 here:
>
>
> This doesn't build here:
>
> # github.com/docker/compose/v2/vendor/github.com/tonistiigi/fsutil
> vendor/github.com/tonistiigi/fsutil/hardlinks.go:83:67: undefined: syscall.EBADMSG
>
> Did the commit miss a patch or did you build this with the related
> patches for lang/go that you sent to the list recently?

Indeed I do have updated lang/go with patches which I sent recently to
remove patches which enforce value of syscall.EBADMSG.

Well, I've reinstalled lang/go to have reproduce the failure, and here the
diff which should fix the build. I've re-checked docker-cli, docker-buildx
and docker-compose.

So, this diff required until lang/go is updated. I think that move with
patch for lang/go is the rigth move, but anyway, here the fix:

diff --git sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_diskwriter_go sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_diskwriter_go
index 8ee8cf660ad..215c660a58c 100644
--- sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_diskwriter_go
+++ sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_diskwriter_go
@@ -1,7 +1,7 @@
Index: vendor/github.com/tonistiigi/fsutil/diskwriter.go
--- vendor/github.com/tonistiigi/fsutil/diskwriter.go.orig
+++ vendor/github.com/tonistiigi/fsutil/diskwriter.go
-@@ -121,7 +121,7 @@ func (dw *DiskWriter) HandleChange(kind ChangeKind, p
+@@ -123,7 +123,7 @@ func (dw *DiskWriter) HandleChange(kind ChangeKind, p

stat, ok := fi.Sys().(*types.Stat)
if !ok {
diff --git sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_hardlinks_go sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_hardlinks_go
index 75a98417263..6653ec01bd6 100644
--- sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_hardlinks_go
+++ sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_hardlinks_go
@@ -1,7 +1,7 @@
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
+@@ -32,7 +32,7 @@ func (v *Hardlinks) HandleChange(kind ChangeKind, p st

stat, ok := fi.Sys().(*types.Stat)
if !ok {
@@ -10,3 +10,12 @@ Index: vendor/github.com/tonistiigi/fsutil/hardlinks.go
}

if fi.IsDir() || fi.Mode()&os.ModeSymlink != 0 {
+@@ -80,7 +80,7 @@ func (r *hardlinkFilter) Walk(ctx context.Context, tar
+
+ 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"})
+ }
+
+ if stat.Linkname != "" {
diff --git sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_send_go sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_send_go
index f9950f1f938..3050cac538d 100644
--- sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_send_go
+++ sysutils/docker-compose/patches/patch-vendor_github_com_tonistiigi_fsutil_send_go
@@ -9,4 +9,4 @@ Index: vendor/github.com/tonistiigi/fsutil/send.go
+ return errors.WithStack(&os.PathError{Path: path, Err: syscall.Errno(0x5c), Op: "fileinfo without stat info"})
}
stat.Path = filepath.ToSlash(stat.Path)
- p := &types.Packet{
+ stat.Linkname = filepath.ToSlash(stat.Linkname)


--
wbr, Kirill

No comments:

Post a Comment