diff --git a/3.10/alpine3.20/Dockerfile b/3.10/alpine3.20/Dockerfile index b46a12d48..0fed3b855 100644 --- a/3.10/alpine3.20/Dockerfile +++ b/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/3.10/alpine3.21/Dockerfile b/3.10/alpine3.21/Dockerfile index 3c03960a8..bde84e689 100644 --- a/3.10/alpine3.21/Dockerfile +++ b/3.10/alpine3.21/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/3.10/bookworm/Dockerfile b/3.10/bookworm/Dockerfile index ddc2cfe13..365c28eb3 100644 --- a/3.10/bookworm/Dockerfile +++ b/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/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile index ef1ad6771..df9e90582 100644 --- a/3.10/bullseye/Dockerfile +++ b/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/3.10/slim-bookworm/Dockerfile b/3.10/slim-bookworm/Dockerfile index 8c3a84d47..28ea16618 100644 --- a/3.10/slim-bookworm/Dockerfile +++ b/3.10/slim-bookworm/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/3.10/slim-bullseye/Dockerfile b/3.10/slim-bullseye/Dockerfile index eee742510..a8758f729 100644 --- a/3.10/slim-bullseye/Dockerfile +++ b/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/3.11/alpine3.20/Dockerfile b/3.11/alpine3.20/Dockerfile index 6bfbfc584..5d5a0be1a 100644 --- a/3.11/alpine3.20/Dockerfile +++ b/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/3.11/alpine3.21/Dockerfile b/3.11/alpine3.21/Dockerfile index 858ce0232..78e40d489 100644 --- a/3.11/alpine3.21/Dockerfile +++ b/3.11/alpine3.21/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/3.11/bookworm/Dockerfile b/3.11/bookworm/Dockerfile index 943aa0150..f6a7a9a40 100644 --- a/3.11/bookworm/Dockerfile +++ b/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/3.11/bullseye/Dockerfile b/3.11/bullseye/Dockerfile index cad17e31e..4b7d3f217 100644 --- a/3.11/bullseye/Dockerfile +++ b/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/3.11/slim-bookworm/Dockerfile b/3.11/slim-bookworm/Dockerfile index 1d77b85f6..3634bae14 100644 --- a/3.11/slim-bookworm/Dockerfile +++ b/3.11/slim-bookworm/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/3.11/slim-bullseye/Dockerfile b/3.11/slim-bullseye/Dockerfile index 250c1c031..e89207c9d 100644 --- a/3.11/slim-bullseye/Dockerfile +++ b/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/3.12/alpine3.20/Dockerfile b/3.12/alpine3.20/Dockerfile index a7c1b0de9..9519e47a9 100644 --- a/3.12/alpine3.20/Dockerfile +++ b/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/3.12/alpine3.21/Dockerfile b/3.12/alpine3.21/Dockerfile index 38dfd364a..9b2b2fe71 100644 --- a/3.12/alpine3.21/Dockerfile +++ b/3.12/alpine3.21/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/3.12/bookworm/Dockerfile b/3.12/bookworm/Dockerfile index c85c9bf80..3c5dadda8 100644 --- a/3.12/bookworm/Dockerfile +++ b/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/3.12/bullseye/Dockerfile b/3.12/bullseye/Dockerfile index af9f71f1a..db27cbbe8 100644 --- a/3.12/bullseye/Dockerfile +++ b/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/3.12/slim-bookworm/Dockerfile b/3.12/slim-bookworm/Dockerfile index 426f71f4d..f476f736a 100644 --- a/3.12/slim-bookworm/Dockerfile +++ b/3.12/slim-bookworm/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/3.12/slim-bullseye/Dockerfile b/3.12/slim-bullseye/Dockerfile index 960607d0f..1e5f18c20 100644 --- a/3.12/slim-bullseye/Dockerfile +++ b/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/3.13/alpine3.20/Dockerfile b/3.13/alpine3.20/Dockerfile index 5b2fe3f23..c3b9eb310 100644 --- a/3.13/alpine3.20/Dockerfile +++ b/3.13/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/3.13/alpine3.21/Dockerfile b/3.13/alpine3.21/Dockerfile index 42837829e..c289fda11 100644 --- a/3.13/alpine3.21/Dockerfile +++ b/3.13/alpine3.21/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/3.13/bookworm/Dockerfile b/3.13/bookworm/Dockerfile index 21bfb2371..4a3f8a2b1 100644 --- a/3.13/bookworm/Dockerfile +++ b/3.13/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/3.13/bullseye/Dockerfile b/3.13/bullseye/Dockerfile index 17a2df6f7..1267fa3e6 100644 --- a/3.13/bullseye/Dockerfile +++ b/3.13/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/3.13/slim-bookworm/Dockerfile b/3.13/slim-bookworm/Dockerfile index 2e20f91d3..15a408ab7 100644 --- a/3.13/slim-bookworm/Dockerfile +++ b/3.13/slim-bookworm/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/3.13/slim-bullseye/Dockerfile b/3.13/slim-bullseye/Dockerfile index 1a1fd9b87..09ba3b8c2 100644 --- a/3.13/slim-bullseye/Dockerfile +++ b/3.13/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/3.14-rc/alpine3.20/Dockerfile b/3.14-rc/alpine3.20/Dockerfile index a6bbb3c13..832c5e59b 100644 --- a/3.14-rc/alpine3.20/Dockerfile +++ b/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/3.14-rc/alpine3.21/Dockerfile b/3.14-rc/alpine3.21/Dockerfile index a84256a6a..39b392e95 100644 --- a/3.14-rc/alpine3.21/Dockerfile +++ b/3.14-rc/alpine3.21/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/3.14-rc/bookworm/Dockerfile b/3.14-rc/bookworm/Dockerfile index 3770ba0e7..b6b99382a 100644 --- a/3.14-rc/bookworm/Dockerfile +++ b/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/3.14-rc/bullseye/Dockerfile b/3.14-rc/bullseye/Dockerfile index 28cb40b2d..34d0fc2a7 100644 --- a/3.14-rc/bullseye/Dockerfile +++ b/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/3.14-rc/slim-bookworm/Dockerfile b/3.14-rc/slim-bookworm/Dockerfile index deae80dd1..ff44902a3 100644 --- a/3.14-rc/slim-bookworm/Dockerfile +++ b/3.14-rc/slim-bookworm/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/3.14-rc/slim-bullseye/Dockerfile b/3.14-rc/slim-bullseye/Dockerfile index 0803096ab..9cd8ab9de 100644 --- a/3.14-rc/slim-bullseye/Dockerfile +++ b/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/Dockerfile-linux.template b/Dockerfile-linux.template index 7c62579cf..8b3b8c824 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -180,9 +180,10 @@ RUN set -eux; \ --enable-shared \ {{ # <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance + # skip LTO on alpine on riscv64: https://github.com/docker-library/python/pull/935, https://github.com/docker-library/python/pull/1038 if rcVersion == "3.9" then "" else ( -}} - --with-lto \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ {{ ) end -}} --with-ensurepip \ ; \ diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index f6f64ca36..a1ef13fe7 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -136,12 +136,6 @@ for version; do ;; esac - # https://github.com/docker-library/python/pull/931 (riscv64 builds on 3.11+ take way too long 😞) - case "$version" in - 3.9 | 3.10) ;; - *) variantArches="$(sed <<<" $variantArches " -e 's/ riscv64 / /g')" ;; - esac - # https://github.com/python/cpython/issues/93619 (Linking error when building 3.11 beta on mips64le) + https://peps.python.org/pep-0011/ (mips is not even tier 3) case "$version" in 3.9) ;;