All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN via buildroot" <buildroot@buildroot.org>
To: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/distribution-registry: fix build on i386
Date: Mon, 17 Nov 2025 20:19:34 +0100	[thread overview]
Message-ID: <aRt1RqKmwVREhyar@landeda> (raw)
In-Reply-To: <20251117191814.2160335-1-yann.morin.1998@free.fr>

All,

On 2025-11-17 20:18 +0100, Yann E. MORIN spake thusly:
> The S3 storage drivers defines the maximum size of a chunk to a value
> thqt does not fit in the native integer on 32-bit architectures. This
> causes build failures:
> 
>     registry/storage/driver/s3-aws/s3.go:312:99: cannot use maxChunkSize
>     (untyped int constant 5368709120) as int value in argument to
>     getParameterAsInteger (overflows)
> 
> Ideally, we'd like to use a build tag that refers to whether the
> architecture is 32- or 64-bit, but there is no such flag. Sigh...
> 
> Instead, backport a patch from upstream that papers over the issue, by
> usig the i386 build tag (of course, that still misses other 32-bit
> archs, but are they really relevant in this case?).

Damned, I forgot to mention:

Fixes: https://autobuild.buildroot.org/results/8fa9c5f63f690b27336051be5178f0516e0c54d4/

Regards,
Yann E. MORIN.

> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> ---
>  .../0001-s3-aws-fix-build-for-386.patch       | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 package/distribution-registry/0001-s3-aws-fix-build-for-386.patch
> 
> diff --git a/package/distribution-registry/0001-s3-aws-fix-build-for-386.patch b/package/distribution-registry/0001-s3-aws-fix-build-for-386.patch
> new file mode 100644
> index 0000000000..a725ab8e92
> --- /dev/null
> +++ b/package/distribution-registry/0001-s3-aws-fix-build-for-386.patch
> @@ -0,0 +1,45 @@
> +From 6970080b10a53d858dd444a643a2bd911de12940 Mon Sep 17 00:00:00 2001
> +From: Chen Qi <Qi.Chen@windriver.com>
> +Date: Thu, 29 May 2025 11:28:38 +0800
> +Subject: [PATCH] s3-aws: fix build for 386
> +
> +When building for 386, we got the following build error:
> +
> +  registry/storage/driver/s3-aws/s3.go:312:99: cannot use
> +  maxChunkSize (untyped int constant 5368709120) as int value
> +  in argument to getParameterAsInteger (overflows)
> +
> +This is because the s3_64bit.go is used. Adjust the build tag matching
> +in s3_32bit.go and s3_64bit.go to fix this issue.
> +
> +Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> +Upstream: https://github.com/distribution/distribution/commit/6970080b10a53d858dd444a643a2bd911de12940
> +Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> +---
> + registry/storage/driver/s3-aws/s3_32bit.go | 2 +-
> + registry/storage/driver/s3-aws/s3_64bit.go | 2 +-
> + 2 files changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/registry/storage/driver/s3-aws/s3_32bit.go b/registry/storage/driver/s3-aws/s3_32bit.go
> +index 218e3eab..84161fcb 100644
> +--- a/registry/storage/driver/s3-aws/s3_32bit.go
> ++++ b/registry/storage/driver/s3-aws/s3_32bit.go
> +@@ -1,4 +1,4 @@
> +-//go:build arm
> ++//go:build arm || 386
> + 
> + package s3
> + 
> +diff --git a/registry/storage/driver/s3-aws/s3_64bit.go b/registry/storage/driver/s3-aws/s3_64bit.go
> +index 55254e49..2ed1f92f 100644
> +--- a/registry/storage/driver/s3-aws/s3_64bit.go
> ++++ b/registry/storage/driver/s3-aws/s3_64bit.go
> +@@ -1,4 +1,4 @@
> +-//go:build !arm
> ++//go:build !arm && !386
> + 
> + package s3
> + 
> +-- 
> +2.51.1
> +
> -- 
> 2.51.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2025-11-17 19:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 19:18 [Buildroot] [PATCH] package/distribution-registry: fix build on i386 Yann E. MORIN via buildroot
2025-11-17 19:19 ` Yann E. MORIN via buildroot [this message]
2025-11-17 21:31   ` Julien Olivain via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aRt1RqKmwVREhyar@landeda \
    --to=buildroot@buildroot.org \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.