Skip to content

Conversation

@tianon
Copy link
Member

@tianon tianon commented May 9, 2025

Changes:

Changes:

- docker-library/python@4c3ad300: Merge pull request docker-library/python#1038 from mmoll/no_lto_on_riscv
- docker-library/python@90aa4272: disable LTO in RISC-V to speed up build
@tianon tianon requested review from a team and LaurentGoderre as code owners May 9, 2025 20:47
@github-actions
Copy link

github-actions bot commented May 9, 2025

Diff for f61fe7c:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 0467cef..69587f8 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -35,95 +35,95 @@ Directory: 3.9/slim-bullseye
 
 Tags: 3.10.17-alpine3.20, 3.10-alpine3.20
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.10/alpine3.20
 
 Tags: 3.10.17-alpine3.21, 3.10-alpine3.21, 3.10.17-alpine, 3.10-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.10/alpine3.21
 
 Tags: 3.10.17-bookworm, 3.10-bookworm
 SharedTags: 3.10.17, 3.10
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.10/bookworm
 
 Tags: 3.10.17-bullseye, 3.10-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.10/bullseye
 
 Tags: 3.10.17-slim-bookworm, 3.10-slim-bookworm, 3.10.17-slim, 3.10-slim
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.10/slim-bookworm
 
 Tags: 3.10.17-slim-bullseye, 3.10-slim-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.10/slim-bullseye
 
 Tags: 3.11.12-alpine3.20, 3.11-alpine3.20
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.11/alpine3.20
 
 Tags: 3.11.12-alpine3.21, 3.11-alpine3.21, 3.11.12-alpine, 3.11-alpine
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.11/alpine3.21
 
 Tags: 3.11.12-bookworm, 3.11-bookworm
 SharedTags: 3.11.12, 3.11
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.11/bookworm
 
 Tags: 3.11.12-bullseye, 3.11-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.11/bullseye
 
 Tags: 3.11.12-slim-bookworm, 3.11-slim-bookworm, 3.11.12-slim, 3.11-slim
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.11/slim-bookworm
 
 Tags: 3.11.12-slim-bullseye, 3.11-slim-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 5f041dab48cbaa33eef235fb94ddf07c61a53ad7
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.11/slim-bullseye
 
 Tags: 3.12.10-alpine3.20, 3.12-alpine3.20
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.12/alpine3.20
 
 Tags: 3.12.10-alpine3.21, 3.12-alpine3.21, 3.12.10-alpine, 3.12-alpine
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.12/alpine3.21
 
 Tags: 3.12.10-bookworm, 3.12-bookworm
 SharedTags: 3.12.10, 3.12
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.12/bookworm
 
 Tags: 3.12.10-bullseye, 3.12-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.12/bullseye
 
 Tags: 3.12.10-slim-bookworm, 3.12-slim-bookworm, 3.12.10-slim, 3.12-slim
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.12/slim-bookworm
 
 Tags: 3.12.10-slim-bullseye, 3.12-slim-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.12/slim-bullseye
 
 Tags: 3.12.10-windowsservercore-1809, 3.12-windowsservercore-1809
@@ -151,34 +151,34 @@ Builder: classic
 Constraints: windowsservercore-ltsc2025
 
 Tags: 3.13.3-alpine3.20, 3.13-alpine3.20, 3-alpine3.20, alpine3.20
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.13/alpine3.20
 
 Tags: 3.13.3-alpine3.21, 3.13-alpine3.21, 3-alpine3.21, alpine3.21, 3.13.3-alpine, 3.13-alpine, 3-alpine, alpine
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.13/alpine3.21
 
 Tags: 3.13.3-bookworm, 3.13-bookworm, 3-bookworm, bookworm
 SharedTags: 3.13.3, 3.13, 3, latest
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.13/bookworm
 
 Tags: 3.13.3-bullseye, 3.13-bullseye, 3-bullseye, bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.13/bullseye
 
 Tags: 3.13.3-slim-bookworm, 3.13-slim-bookworm, 3-slim-bookworm, slim-bookworm, 3.13.3-slim, 3.13-slim, 3-slim, slim
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.13/slim-bookworm
 
 Tags: 3.13.3-slim-bullseye, 3.13-slim-bullseye, 3-slim-bullseye, slim-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 70fc099be48e4a130afd949a4dd3c6afe6935b8a
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.13/slim-bullseye
 
 Tags: 3.13.3-windowsservercore-1809, 3.13-windowsservercore-1809, 3-windowsservercore-1809, windowsservercore-1809
@@ -206,34 +206,34 @@ Builder: classic
 Constraints: windowsservercore-ltsc2025
 
 Tags: 3.14.0b1-alpine3.20, 3.14-rc-alpine3.20
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le
-GitCommit: 4cf0116a7bbe300e199a0565ebf6656af61352c6
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.14-rc/alpine3.20
 
 Tags: 3.14.0b1-alpine3.21, 3.14-rc-alpine3.21, 3.14.0b1-alpine, 3.14-rc-alpine
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le
-GitCommit: 4cf0116a7bbe300e199a0565ebf6656af61352c6
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.14-rc/alpine3.21
 
 Tags: 3.14.0b1-bookworm, 3.14-rc-bookworm
 SharedTags: 3.14.0b1, 3.14-rc
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 4cf0116a7bbe300e199a0565ebf6656af61352c6
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.14-rc/bookworm
 
 Tags: 3.14.0b1-bullseye, 3.14-rc-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 4cf0116a7bbe300e199a0565ebf6656af61352c6
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.14-rc/bullseye
 
 Tags: 3.14.0b1-slim-bookworm, 3.14-rc-slim-bookworm, 3.14.0b1-slim, 3.14-rc-slim
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 4cf0116a7bbe300e199a0565ebf6656af61352c6
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.14-rc/slim-bookworm
 
 Tags: 3.14.0b1-slim-bullseye, 3.14-rc-slim-bullseye
 Architectures: amd64, arm32v7, arm64v8, i386
-GitCommit: 4cf0116a7bbe300e199a0565ebf6656af61352c6
+GitCommit: 90aa427282f3f8283652c97011a511a77ea699b8
 Directory: 3.14-rc/slim-bullseye
 
 Tags: 3.14.0b1-windowsservercore-1809, 3.14-rc-windowsservercore-1809
diff --git a/python_3.10-alpine/Dockerfile b/python_3.10-alpine/Dockerfile
index 3c03960..bde84e6 100644
--- a/python_3.10-alpine/Dockerfile
+++ b/python_3.10-alpine/Dockerfile
@@ -76,7 +76,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.10-alpine3.20/Dockerfile b/python_3.10-alpine3.20/Dockerfile
index b46a12d..0fed3b8 100644
--- a/python_3.10-alpine3.20/Dockerfile
+++ b/python_3.10-alpine3.20/Dockerfile
@@ -76,7 +76,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.10-bookworm/Dockerfile b/python_3.10-bookworm/Dockerfile
index ddc2cfe..365c28e 100644
--- a/python_3.10-bookworm/Dockerfile
+++ b/python_3.10-bookworm/Dockerfile
@@ -50,7 +50,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.10-bullseye/Dockerfile b/python_3.10-bullseye/Dockerfile
index ef1ad67..df9e905 100644
--- a/python_3.10-bullseye/Dockerfile
+++ b/python_3.10-bullseye/Dockerfile
@@ -50,7 +50,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.10-slim-bullseye/Dockerfile b/python_3.10-slim-bullseye/Dockerfile
index eee7425..a8758f7 100644
--- a/python_3.10-slim-bullseye/Dockerfile
+++ b/python_3.10-slim-bullseye/Dockerfile
@@ -75,7 +75,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.10-slim/Dockerfile b/python_3.10-slim/Dockerfile
index 8c3a84d..28ea166 100644
--- a/python_3.10-slim/Dockerfile
+++ b/python_3.10-slim/Dockerfile
@@ -75,7 +75,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.11-alpine/Dockerfile b/python_3.11-alpine/Dockerfile
index 858ce02..78e40d4 100644
--- a/python_3.11-alpine/Dockerfile
+++ b/python_3.11-alpine/Dockerfile
@@ -76,7 +76,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.11-alpine3.20/Dockerfile b/python_3.11-alpine3.20/Dockerfile
index 6bfbfc5..5d5a0be 100644
--- a/python_3.11-alpine3.20/Dockerfile
+++ b/python_3.11-alpine3.20/Dockerfile
@@ -76,7 +76,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.11-bookworm/Dockerfile b/python_3.11-bookworm/Dockerfile
index 943aa01..f6a7a9a 100644
--- a/python_3.11-bookworm/Dockerfile
+++ b/python_3.11-bookworm/Dockerfile
@@ -50,7 +50,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.11-bullseye/Dockerfile b/python_3.11-bullseye/Dockerfile
index cad17e3..4b7d3f2 100644
--- a/python_3.11-bullseye/Dockerfile
+++ b/python_3.11-bullseye/Dockerfile
@@ -50,7 +50,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.11-slim-bullseye/Dockerfile b/python_3.11-slim-bullseye/Dockerfile
index 250c1c0..e89207c 100644
--- a/python_3.11-slim-bullseye/Dockerfile
+++ b/python_3.11-slim-bullseye/Dockerfile
@@ -75,7 +75,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.11-slim/Dockerfile b/python_3.11-slim/Dockerfile
index 1d77b85..3634bae 100644
--- a/python_3.11-slim/Dockerfile
+++ b/python_3.11-slim/Dockerfile
@@ -75,7 +75,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.12-alpine/Dockerfile b/python_3.12-alpine/Dockerfile
index 38dfd36..9b2b2fe 100644
--- a/python_3.12-alpine/Dockerfile
+++ b/python_3.12-alpine/Dockerfile
@@ -76,7 +76,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.12-alpine3.20/Dockerfile b/python_3.12-alpine3.20/Dockerfile
index a7c1b0d..9519e47 100644
--- a/python_3.12-alpine3.20/Dockerfile
+++ b/python_3.12-alpine3.20/Dockerfile
@@ -76,7 +76,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.12-bookworm/Dockerfile b/python_3.12-bookworm/Dockerfile
index c85c9bf..3c5dadd 100644
--- a/python_3.12-bookworm/Dockerfile
+++ b/python_3.12-bookworm/Dockerfile
@@ -50,7 +50,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.12-bullseye/Dockerfile b/python_3.12-bullseye/Dockerfile
index af9f71f..db27cbb 100644
--- a/python_3.12-bullseye/Dockerfile
+++ b/python_3.12-bullseye/Dockerfile
@@ -50,7 +50,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.12-slim-bullseye/Dockerfile b/python_3.12-slim-bullseye/Dockerfile
index 960607d..1e5f18c 100644
--- a/python_3.12-slim-bullseye/Dockerfile
+++ b/python_3.12-slim-bullseye/Dockerfile
@@ -75,7 +75,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.12-slim/Dockerfile b/python_3.12-slim/Dockerfile
index 426f71f..f476f73 100644
--- a/python_3.12-slim/Dockerfile
+++ b/python_3.12-slim/Dockerfile
@@ -75,7 +75,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.14-rc-alpine/Dockerfile b/python_3.14-rc-alpine/Dockerfile
index a84256a..39b392e 100644
--- a/python_3.14-rc-alpine/Dockerfile
+++ b/python_3.14-rc-alpine/Dockerfile
@@ -64,7 +64,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.14-rc-alpine3.20/Dockerfile b/python_3.14-rc-alpine3.20/Dockerfile
index a6bbb3c..832c5e5 100644
--- a/python_3.14-rc-alpine3.20/Dockerfile
+++ b/python_3.14-rc-alpine3.20/Dockerfile
@@ -64,7 +64,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.14-rc-bookworm/Dockerfile b/python_3.14-rc-bookworm/Dockerfile
index 3770ba0..b6b9938 100644
--- a/python_3.14-rc-bookworm/Dockerfile
+++ b/python_3.14-rc-bookworm/Dockerfile
@@ -38,7 +38,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.14-rc-bullseye/Dockerfile b/python_3.14-rc-bullseye/Dockerfile
index 28cb40b..34d0fc2 100644
--- a/python_3.14-rc-bullseye/Dockerfile
+++ b/python_3.14-rc-bullseye/Dockerfile
@@ -38,7 +38,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.14-rc-slim-bullseye/Dockerfile b/python_3.14-rc-slim-bullseye/Dockerfile
index 0803096..9cd8ab9 100644
--- a/python_3.14-rc-slim-bullseye/Dockerfile
+++ b/python_3.14-rc-slim-bullseye/Dockerfile
@@ -63,7 +63,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_3.14-rc-slim/Dockerfile b/python_3.14-rc-slim/Dockerfile
index deae80d..ff44902 100644
--- a/python_3.14-rc-slim/Dockerfile
+++ b/python_3.14-rc-slim/Dockerfile
@@ -63,7 +63,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_alpine/Dockerfile b/python_alpine/Dockerfile
index 4283782..c289fda 100644
--- a/python_alpine/Dockerfile
+++ b/python_alpine/Dockerfile
@@ -71,7 +71,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_alpine3.20/Dockerfile b/python_alpine3.20/Dockerfile
index 5b2fe3f..c3b9eb3 100644
--- a/python_alpine3.20/Dockerfile
+++ b/python_alpine3.20/Dockerfile
@@ -71,7 +71,7 @@ RUN set -eux; \
 		--enable-loadable-sqlite-extensions \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_bookworm/Dockerfile b/python_bookworm/Dockerfile
index 21bfb23..4a3f8a2 100644
--- a/python_bookworm/Dockerfile
+++ b/python_bookworm/Dockerfile
@@ -45,7 +45,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_bullseye/Dockerfile b/python_bullseye/Dockerfile
index 17a2df6..1267fa3 100644
--- a/python_bullseye/Dockerfile
+++ b/python_bullseye/Dockerfile
@@ -45,7 +45,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_slim-bullseye/Dockerfile b/python_slim-bullseye/Dockerfile
index 1a1fd9b..09ba3b8 100644
--- a/python_slim-bullseye/Dockerfile
+++ b/python_slim-bullseye/Dockerfile
@@ -70,7 +70,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \
diff --git a/python_slim/Dockerfile b/python_slim/Dockerfile
index 2e20f91..15a408a 100644
--- a/python_slim/Dockerfile
+++ b/python_slim/Dockerfile
@@ -70,7 +70,7 @@ RUN set -eux; \
 		--enable-optimizations \
 		--enable-option-checking=fatal \
 		--enable-shared \
-		--with-lto \
+		$(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \
 		--with-ensurepip \
 	; \
 	nproc="$(nproc)"; \

Relevant Maintainers:

@yosifkit yosifkit merged commit b1a6faf into docker-library:master May 9, 2025
50 checks passed
@yosifkit yosifkit deleted the python branch May 9, 2025 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants