From 9e3ed7b429fb5b7b23b0904c550f932fd8bc429f Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Thu, 27 Jul 2023 23:20:50 +0300 Subject: [PATCH] pkg/chrootarchive: fix Darwin build Before this commit, `doPack`, `doUnpack` and `doUnpackLayer` were not implemented for Darwin, causing build failure. This change allows all non-Linux Unixes to use FreeBSD reexec-based pack/unpack implementation See also: moby/buildkit#4059 See also: 8b843732b36541b8b8a11ecb83cf5d51837ae22f Signed-off-by: Marat Radchenko --- .../{archive_freebsd.go => archive_unix_nolinux.go} | 8 +++++--- ...chive_freebsd_test.go => archive_unix_nolinux_test.go} | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) rename pkg/chrootarchive/{archive_freebsd.go => archive_unix_nolinux.go} (96%) rename pkg/chrootarchive/{archive_freebsd_test.go => archive_unix_nolinux_test.go} (88%) diff --git a/pkg/chrootarchive/archive_freebsd.go b/pkg/chrootarchive/archive_unix_nolinux.go similarity index 96% rename from pkg/chrootarchive/archive_freebsd.go rename to pkg/chrootarchive/archive_unix_nolinux.go index 53ad899a21ee4..13e557b128305 100644 --- a/pkg/chrootarchive/archive_freebsd.go +++ b/pkg/chrootarchive/archive_unix_nolinux.go @@ -1,3 +1,5 @@ +//go:build unix && !linux + package chrootarchive // import "github.com/docker/docker/pkg/chrootarchive" import ( @@ -15,9 +17,9 @@ import ( ) const ( - packCmd = "freebsd-pack-in-chroot" - unpackCmd = "freebsd-unpack-in-chroot" - unpackLayerCmd = "freebsd-unpack-layer-in-chroot" + packCmd = "chrootarchive-pack-in-chroot" + unpackCmd = "chrootarchive-unpack-in-chroot" + unpackLayerCmd = "chrootarchive-unpack-layer-in-chroot" ) func init() { diff --git a/pkg/chrootarchive/archive_freebsd_test.go b/pkg/chrootarchive/archive_unix_nolinux_test.go similarity index 88% rename from pkg/chrootarchive/archive_freebsd_test.go rename to pkg/chrootarchive/archive_unix_nolinux_test.go index 434523fffa859..a051814845ba7 100644 --- a/pkg/chrootarchive/archive_freebsd_test.go +++ b/pkg/chrootarchive/archive_unix_nolinux_test.go @@ -1,3 +1,5 @@ +//go:build unix && !linux + package chrootarchive // import "github.com/docker/docker/pkg/chrootarchive" import (