From 7dbb171fe23741da899043afc4d2690d17845577 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 3 Jul 2024 16:01:35 -0700 Subject: [PATCH] Update buildkit to 0.15.0-rc1 (and update patches accordingly for upstream merges) --- buildkit/Dockerfile | 2 +- buildkit/Dockerfile.0.13 | 2 +- buildkit/Dockerfile.rc | 4 +--- buildkit/Dockerfile.template | 6 +++++- buildkit/containerd-arm64-v8-pre-0.15.patch | 18 ++++++++++++++++++ buildkit/containerd-arm64-v8.patch | 6 +++--- buildkit/gsl.sh | 2 +- buildkit/versions.json | 8 ++++---- buildkit/versions.sh | 2 +- 9 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 buildkit/containerd-arm64-v8-pre-0.15.patch diff --git a/buildkit/Dockerfile b/buildkit/Dockerfile index 39e1b78aeea..ada84a935da 100644 --- a/buildkit/Dockerfile +++ b/buildkit/Dockerfile @@ -12,7 +12,7 @@ ENV BUILDKIT_VERSION 0.14.1 COPY \ backport-5072-fetch-tags.patch \ backport-5096-fix-umask.patch \ - containerd-arm64-v8.patch \ + containerd-arm64-v8-pre-0.15.patch \ git-no-submodules.patch \ mips64le.patch \ noclip.patch \ diff --git a/buildkit/Dockerfile.0.13 b/buildkit/Dockerfile.0.13 index 34eedcbf877..75480f69f77 100644 --- a/buildkit/Dockerfile.0.13 +++ b/buildkit/Dockerfile.0.13 @@ -12,7 +12,7 @@ ENV BUILDKIT_VERSION 0.13.2 COPY \ backport-5072-fetch-tags.patch \ backport-5096-fix-umask.patch \ - containerd-arm64-v8.patch \ + containerd-arm64-v8-pre-0.15.patch \ git-no-submodules.patch \ mips64le.patch \ noclip.patch \ diff --git a/buildkit/Dockerfile.rc b/buildkit/Dockerfile.rc index 8bc0854bd6a..9e5f7b3b393 100644 --- a/buildkit/Dockerfile.rc +++ b/buildkit/Dockerfile.rc @@ -7,11 +7,9 @@ FROM --platform=$BUILDPLATFORM golang:1.21 AS build # https://github.com/moby/buildkit/releases -ENV BUILDKIT_VERSION 0.14.0-rc2 +ENV BUILDKIT_VERSION 0.15.0-rc1 COPY \ - backport-5072-fetch-tags.patch \ - backport-5096-fix-umask.patch \ containerd-arm64-v8.patch \ git-no-submodules.patch \ mips64le.patch \ diff --git a/buildkit/Dockerfile.template b/buildkit/Dockerfile.template index 39475dcf219..bcdd65e56bf 100644 --- a/buildkit/Dockerfile.template +++ b/buildkit/Dockerfile.template @@ -15,9 +15,13 @@ ENV BUILDKIT_VERSION {{ .version }} COPY \ {{ if env.variant != "dev" and (.version | startswith("0.13.") or startswith("0.14.")) then ( -}} backport-5072-fetch-tags.patch \ -{{ ) else "" end -}} backport-5096-fix-umask.patch \ +{{) else "" end -}} +{{ if .version | startswith("0.13.") or startswith("0.14.") then ( -}} + containerd-arm64-v8-pre-0.15.patch \ +{{ ) else ( -}} containerd-arm64-v8.patch \ +{{ ) end -}} git-no-submodules.patch \ mips64le.patch \ noclip.patch \ diff --git a/buildkit/containerd-arm64-v8-pre-0.15.patch b/buildkit/containerd-arm64-v8-pre-0.15.patch new file mode 100644 index 00000000000..80648c9b19e --- /dev/null +++ b/buildkit/containerd-arm64-v8-pre-0.15.patch @@ -0,0 +1,18 @@ +Description: normalize "linux/arm64" to "linux/arm64/v8" instead of the other direction +Forwarded: no; presumably, the direction this went was intentional (Tianon just disagrees, and the normalization allows him that) + +diff --git a/vendor/github.com/containerd/containerd/platforms/database.go b/vendor/github.com/containerd/containerd/platforms/database.go +index 2e26fd3b4..5ef7d74d1 100644 +--- a/vendor/github.com/containerd/containerd/platforms/database.go ++++ b/vendor/github.com/containerd/containerd/platforms/database.go +@@ -87,8 +87,8 @@ func normalizeArch(arch, variant string) (string, string) { + case "aarch64", "arm64": + arch = "arm64" + switch variant { +- case "8", "v8": +- variant = "" ++ case "", "8": ++ variant = "v8" + } + case "armhf": + arch = "arm" diff --git a/buildkit/containerd-arm64-v8.patch b/buildkit/containerd-arm64-v8.patch index 80648c9b19e..2fdfea8942f 100644 --- a/buildkit/containerd-arm64-v8.patch +++ b/buildkit/containerd-arm64-v8.patch @@ -1,10 +1,10 @@ Description: normalize "linux/arm64" to "linux/arm64/v8" instead of the other direction Forwarded: no; presumably, the direction this went was intentional (Tianon just disagrees, and the normalization allows him that) -diff --git a/vendor/github.com/containerd/containerd/platforms/database.go b/vendor/github.com/containerd/containerd/platforms/database.go +diff --git a/vendor/github.com/containerd/platforms/database.go b/vendor/github.com/containerd/platforms/database.go index 2e26fd3b4..5ef7d74d1 100644 ---- a/vendor/github.com/containerd/containerd/platforms/database.go -+++ b/vendor/github.com/containerd/containerd/platforms/database.go +--- a/vendor/github.com/containerd/platforms/database.go ++++ b/vendor/github.com/containerd/platforms/database.go @@ -87,8 +87,8 @@ func normalizeArch(arch, variant string) (string, string) { case "aarch64", "arm64": arch = "arm64" diff --git a/buildkit/gsl.sh b/buildkit/gsl.sh index 281c2e2210e..2fa51cc8ba0 100755 --- a/buildkit/gsl.sh +++ b/buildkit/gsl.sh @@ -68,7 +68,7 @@ exec jq -r ' ) ) | reduce to_entries[] as $e ({}; - .[$e.key] = $e.value - ([ .[][] ]) + .[$e.key] = $e.value - [ .[][] ] ) | to_entries[] | .key as $variant diff --git a/buildkit/versions.json b/buildkit/versions.json index 312cab14a96..98a62c5dc2d 100644 --- a/buildkit/versions.json +++ b/buildkit/versions.json @@ -12,10 +12,10 @@ "0.13" ], "rc": { - "commit": "aebcc1f0eabcbaeef4be8e948641f653140fe2bf", - "ref": "refs/tags/v0.14.0-rc2", - "tag": "v0.14.0-rc2", - "version": "0.14.0-rc2", + "commit": "8ade9b239b580ff2af97b527e2484df60d6a2b6b", + "ref": "refs/tags/v0.15.0-rc1", + "tag": "v0.15.0-rc1", + "version": "0.15.0-rc1", "go": { "version": "1.21" } diff --git a/buildkit/versions.sh b/buildkit/versions.sh index f252b8ae46b..dcab77cbbe0 100755 --- a/buildkit/versions.sh +++ b/buildkit/versions.sh @@ -60,7 +60,7 @@ for variant in "${variants[@]}"; do commit="$(jq <<<"$bk" -r '.commit // .version')" go="$(wget -qO- "https://github.com/moby/buildkit/raw/$commit/go.mod")" - go="$(awk <<<"$go" '$1 == "go" { print $2; exit }')" + go="$(awk <<<"$go" '$1 == "go" { if ($2 ~ /^[0-9]+[.][0-9]+[.][0-9]+$/) { sub(/[.][0-9]+$/, "", $2) } print $2; exit }')" echo >&2 "${variant:-stable} go: $go" json="$(jq <<<"$json" --argjson bk "$bk" --arg go "$go" '