Skip to content

Commit 386636e

Browse files
committed
Add more intentional buildkit patches (with appropriate DEP3 headers)
1 parent ebba3c7 commit 386636e

File tree

5 files changed

+56
-8
lines changed

5 files changed

+56
-8
lines changed

buildkit/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ FROM --platform=$BUILDPLATFORM golang:1.21 AS build
99
# https://github.com/moby/buildkit/releases
1010
ENV BUILDKIT_VERSION 0.13.2
1111

12-
# pkg/mod/github.com/moby/[email protected]/snapshot/diffapply_unix.go:131:8: cannot use stat.Dev (variable of type uint32) as uint64 value in struct literal
13-
# pkg/mod/github.com/moby/[email protected]/snapshot/diffapply_unix.go:300:12: cannot use unix.Mkdev(0, 0) (value of type uint64) as uint32 value in struct literal
14-
COPY mips64le.patch /tmp/
12+
COPY \
13+
containerd-arm64-v8.patch \
14+
mips64le.patch \
15+
noclip.patch \
16+
/tmp/buildkit-patches/
1517

1618
WORKDIR /app
1719

1820
RUN set -eux; \
1921
git clone --branch "v$BUILDKIT_VERSION" --depth 1 --config advice.detachedHead=false 'https://github.com/moby/buildkit.git' .; \
20-
git apply /tmp/mips64le.patch
22+
git apply /tmp/buildkit-patches/*.patch; \
23+
git diff --color
2124

2225
ENV CGO_ENABLED 0
2326

buildkit/Dockerfile.template

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ FROM --platform=$BUILDPLATFORM golang:{{ .go.version }} AS build
44
# https://github.com/moby/buildkit/releases
55
ENV BUILDKIT_VERSION {{ .version }}
66

7-
# pkg/mod/github.com/moby/[email protected]/snapshot/diffapply_unix.go:131:8: cannot use stat.Dev (variable of type uint32) as uint64 value in struct literal
8-
# pkg/mod/github.com/moby/[email protected]/snapshot/diffapply_unix.go:300:12: cannot use unix.Mkdev(0, 0) (value of type uint64) as uint32 value in struct literal
9-
COPY mips64le.patch /tmp/
7+
COPY \
8+
containerd-arm64-v8.patch \
9+
mips64le.patch \
10+
noclip.patch \
11+
/tmp/buildkit-patches/
1012

1113
WORKDIR /app
1214

1315
RUN set -eux; \
1416
git clone --branch "v$BUILDKIT_VERSION" --depth 1 --config advice.detachedHead=false 'https://github.com/moby/buildkit.git' .; \
15-
git apply /tmp/mips64le.patch
17+
git apply /tmp/buildkit-patches/*.patch; \
18+
git diff --color
1619

1720
ENV CGO_ENABLED 0
1821

buildkit/containerd-arm64-v8.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Description: normalize "linux/arm64" to "linux/arm64/v8" instead of the other direction
2+
Forwarded: no; presumably, the direction this went was intentional (Tianon just disagrees, and the normalization allows him that)
3+
4+
diff --git a/vendor/github.com/containerd/containerd/platforms/database.go b/vendor/github.com/containerd/containerd/platforms/database.go
5+
index 2e26fd3b4..5ef7d74d1 100644
6+
--- a/vendor/github.com/containerd/containerd/platforms/database.go
7+
+++ b/vendor/github.com/containerd/containerd/platforms/database.go
8+
@@ -87,8 +87,8 @@ func normalizeArch(arch, variant string) (string, string) {
9+
case "aarch64", "arm64":
10+
arch = "arm64"
11+
switch variant {
12+
- case "8", "v8":
13+
- variant = ""
14+
+ case "", "8":
15+
+ variant = "v8"
16+
}
17+
case "armhf":
18+
arch = "arm"

buildkit/mips64le.patch

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Description: fix build on mips64le
2+
Forwarded: no (but probably should)
3+
4+
# pkg/mod/github.com/moby/[email protected]/snapshot/diffapply_unix.go:131:8: cannot use stat.Dev (variable of type uint32) as uint64 value in struct literal
5+
# pkg/mod/github.com/moby/[email protected]/snapshot/diffapply_unix.go:300:12: cannot use unix.Mkdev(0, 0) (value of type uint64) as uint32 value in struct literal
6+
17
diff --git a/snapshot/diffapply_unix.go b/snapshot/diffapply_unix.go
28
index c4875000e..1d9d09d8f 100644
39
--- a/snapshot/diffapply_unix.go

buildkit/noclip.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Description: disable buildkit's default log clipping
2+
Forwarded: no (upstream's defaults are intentional, Tianon just disagrees with them)
3+
4+
diff --git a/util/progress/logs/logs.go b/util/progress/logs/logs.go
5+
index bfecdda6b3..079d7e561a 100644
6+
--- a/util/progress/logs/logs.go
7+
+++ b/util/progress/logs/logs.go
8+
@@ -18,8 +18,8 @@ import (
9+
"github.com/tonistiigi/units"
10+
)
11+
12+
-var defaultMaxLogSize = 2 * 1024 * 1024
13+
-var defaultMaxLogSpeed = 200 * 1024 // per second
14+
+var defaultMaxLogSize = -1
15+
+var defaultMaxLogSpeed = -1
16+
17+
const (
18+
stdout = 1

0 commit comments

Comments
 (0)