diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2025-05-29 11:51:10 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2025-07-07 11:42:27 -0400 |
commit | 962471bc708b9bd4223db910630235855ef06011 (patch) | |
tree | a42dc62ebf4fc87986e55489b60d584c9b24fe57 | |
parent | 51e50ba710c83f8c9a5e5ccd5f868748a180125a (diff) | |
download | meta-virtualization-962471bc708b9bd4223db910630235855ef06011.tar.gz |
docker-distribution: fix build for 386
The build error could be reproduced by using qemux86 as the MACHINE
or using qemux86-64 as the MACHINE and then running 'bitbake
lib32-docker-distribution'.
The root cause is the wrong file (s3_64bit.go) is imported. Fix the
tag matching to ensure s3_32bit.go is imported in case of 386.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/docker-distribution/docker-distribution_git.bb | 1 | ||||
-rw-r--r-- | recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/recipes-containers/docker-distribution/docker-distribution_git.bb b/recipes-containers/docker-distribution/docker-distribution_git.bb index d1ac1a8a..d831ce5f 100644 --- a/recipes-containers/docker-distribution/docker-distribution_git.bb +++ b/recipes-containers/docker-distribution/docker-distribution_git.bb | |||
@@ -7,6 +7,7 @@ SRCREV_distribution = "da404778edd3faa665e48ca3bb791b6144f3355e" | |||
7 | SRC_URI = "git://github.com/docker/distribution.git;branch=main;name=distribution;destsuffix=git/src/github.com/distribution/distribution/v3;protocol=https \ | 7 | SRC_URI = "git://github.com/docker/distribution.git;branch=main;name=distribution;destsuffix=git/src/github.com/distribution/distribution/v3;protocol=https \ |
8 | file://docker-registry.service \ | 8 | file://docker-registry.service \ |
9 | file://0001-build-use-to-use-cross-go-compiler.patch \ | 9 | file://0001-build-use-to-use-cross-go-compiler.patch \ |
10 | file://0001-s3-aws-fix-build-for-386.patch \ | ||
10 | " | 11 | " |
11 | 12 | ||
12 | PACKAGES =+ "docker-registry" | 13 | PACKAGES =+ "docker-registry" |
diff --git a/recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch b/recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch new file mode 100644 index 00000000..4fbae6e4 --- /dev/null +++ b/recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 6970080b10a53d858dd444a643a2bd911de12940 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
3 | Date: Thu, 29 May 2025 11:28:38 +0800 | ||
4 | Subject: [PATCH] s3-aws: fix build for 386 | ||
5 | |||
6 | When building for 386, we got the following build error: | ||
7 | |||
8 | registry/storage/driver/s3-aws/s3.go:312:99: cannot use | ||
9 | maxChunkSize (untyped int constant 5368709120) as int value | ||
10 | in argument to getParameterAsInteger (overflows) | ||
11 | |||
12 | This is because the s3_64bit.go is used. Adjust the build tag matching | ||
13 | in s3_32bit.go and s3_64bit.go to fix this issue. | ||
14 | |||
15 | Upstream-Status: Submitted [https://github.com/distribution/distribution/pull/4642] | ||
16 | |||
17 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
18 | --- | ||
19 | registry/storage/driver/s3-aws/s3_32bit.go | 2 +- | ||
20 | registry/storage/driver/s3-aws/s3_64bit.go | 2 +- | ||
21 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/registry/storage/driver/s3-aws/s3_32bit.go b/registry/storage/driver/s3-aws/s3_32bit.go | ||
24 | index 218e3eab..84161fcb 100644 | ||
25 | --- a/registry/storage/driver/s3-aws/s3_32bit.go | ||
26 | +++ b/registry/storage/driver/s3-aws/s3_32bit.go | ||
27 | @@ -1,4 +1,4 @@ | ||
28 | -//go:build arm | ||
29 | +//go:build arm || 386 | ||
30 | |||
31 | package s3 | ||
32 | |||
33 | diff --git a/registry/storage/driver/s3-aws/s3_64bit.go b/registry/storage/driver/s3-aws/s3_64bit.go | ||
34 | index 55254e49..2ed1f92f 100644 | ||
35 | --- a/registry/storage/driver/s3-aws/s3_64bit.go | ||
36 | +++ b/registry/storage/driver/s3-aws/s3_64bit.go | ||
37 | @@ -1,4 +1,4 @@ | ||
38 | -//go:build !arm | ||
39 | +//go:build !arm && !386 | ||
40 | |||
41 | package s3 | ||
42 | |||
43 | -- | ||
44 | 2.34.1 | ||
45 | |||