diff --git a/3.13/alpine3.21/Dockerfile b/3.13/alpine3.21/Dockerfile index 33846a35d..10acc22fd 100644 --- a/3.13/alpine3.21/Dockerfile +++ b/3.13/alpine3.21/Dockerfile @@ -50,6 +50,10 @@ RUN set -eux; \ util-linux-dev \ xz-dev \ zlib-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang18 \ + llvm18 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -73,6 +77,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() diff --git a/3.13/alpine3.22/Dockerfile b/3.13/alpine3.22/Dockerfile index f32cbed2e..541c7528a 100644 --- a/3.13/alpine3.22/Dockerfile +++ b/3.13/alpine3.22/Dockerfile @@ -50,6 +50,10 @@ RUN set -eux; \ util-linux-dev \ xz-dev \ zlib-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang18 \ + llvm18 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -73,6 +77,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() diff --git a/3.13/bookworm/Dockerfile b/3.13/bookworm/Dockerfile index 8b970193f..c8227b99c 100644 --- a/3.13/bookworm/Dockerfile +++ b/3.13/bookworm/Dockerfile @@ -47,6 +47,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.13/slim-bookworm/Dockerfile b/3.13/slim-bookworm/Dockerfile index c1ae13ef5..310d46332 100644 --- a/3.13/slim-bookworm/Dockerfile +++ b/3.13/slim-bookworm/Dockerfile @@ -48,6 +48,10 @@ RUN set -eux; \ wget \ xz-utils \ zlib1g-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang-18 \ + llvm-18 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -72,6 +76,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.13/slim-trixie/Dockerfile b/3.13/slim-trixie/Dockerfile index 4a1525f2b..995da141c 100644 --- a/3.13/slim-trixie/Dockerfile +++ b/3.13/slim-trixie/Dockerfile @@ -48,6 +48,10 @@ RUN set -eux; \ wget \ xz-utils \ zlib1g-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang-18 \ + llvm-18 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -72,6 +76,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.13/trixie/Dockerfile b/3.13/trixie/Dockerfile index 943231b87..9d7216acd 100644 --- a/3.13/trixie/Dockerfile +++ b/3.13/trixie/Dockerfile @@ -47,6 +47,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.14/alpine3.21/Dockerfile b/3.14/alpine3.21/Dockerfile index 7c333923f..654fbd73d 100644 --- a/3.14/alpine3.21/Dockerfile +++ b/3.14/alpine3.21/Dockerfile @@ -49,6 +49,10 @@ RUN set -eux; \ util-linux-dev \ xz-dev \ zlib-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang19 \ + llvm19 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -66,6 +70,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() diff --git a/3.14/alpine3.22/Dockerfile b/3.14/alpine3.22/Dockerfile index 7b757165e..752ab8945 100644 --- a/3.14/alpine3.22/Dockerfile +++ b/3.14/alpine3.22/Dockerfile @@ -49,6 +49,10 @@ RUN set -eux; \ util-linux-dev \ xz-dev \ zlib-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang19 \ + llvm19 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -66,6 +70,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() diff --git a/3.14/bookworm/Dockerfile b/3.14/bookworm/Dockerfile index fc40a1d23..e1ffaa7d9 100644 --- a/3.14/bookworm/Dockerfile +++ b/3.14/bookworm/Dockerfile @@ -40,6 +40,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.14/slim-bookworm/Dockerfile b/3.14/slim-bookworm/Dockerfile index 5208bfd3b..c52cd0ac5 100644 --- a/3.14/slim-bookworm/Dockerfile +++ b/3.14/slim-bookworm/Dockerfile @@ -47,6 +47,10 @@ RUN set -eux; \ wget \ xz-utils \ zlib1g-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang-19 \ + llvm-19 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -65,6 +69,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.14/slim-trixie/Dockerfile b/3.14/slim-trixie/Dockerfile index 6b35ef69f..8450ea113 100644 --- a/3.14/slim-trixie/Dockerfile +++ b/3.14/slim-trixie/Dockerfile @@ -47,6 +47,10 @@ RUN set -eux; \ wget \ xz-utils \ zlib1g-dev \ +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang-19 \ + llvm-19 \ + python3 \ ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ @@ -65,6 +69,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.14/trixie/Dockerfile b/3.14/trixie/Dockerfile index 6193c5ab5..f5511e220 100644 --- a/3.14/trixie/Dockerfile +++ b/3.14/trixie/Dockerfile @@ -40,6 +40,9 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index b0ee03d7f..35270f4a3 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -96,6 +96,8 @@ ENV PYTHON_SHA256 {{ .checksums.source.sha256 }} RUN set -eux; \ \ +{{ # https://github.com/python/cpython/blob/3.13/Tools/jit/README.md -}} +{{ def llvmVersion: if rcVersion == "3.13" then "18" else "19" end -}} {{ if is_alpine then ( -}} apk add --no-cache --virtual .build-deps \ gnupg \ @@ -125,6 +127,12 @@ RUN set -eux; \ util-linux-dev \ xz-dev \ zlib-dev \ +{{ if IN(rcVersion; "3.9", "3.10", "3.11", "3.12") then "" else ( -}} +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md + clang{{ llvmVersion }} \ + llvm{{ llvmVersion }} \ + python3 \ +{{ ) end -}} ; \ \ {{ ) elif is_slim then ( -}} @@ -151,6 +159,13 @@ RUN set -eux; \ wget \ xz-utils \ zlib1g-dev \ +{{ if IN(rcVersion; "3.9", "3.10", "3.11", "3.12") then "" else ( -}} +# hack hack hack: https://github.com/python/cpython/blob/3.13/Tools/jit/README.md +{{ def llvmVersion: if rcVersion == "3.13" then "18" else "19" end -}} + clang-{{ llvmVersion }} \ + llvm-{{ llvmVersion }} \ + python3 \ +{{ ) end -}} ; \ \ {{ ) else "" end -}} @@ -192,6 +207,11 @@ RUN set -eux; \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ {{ ) end -}} --with-ensurepip \ +{{ if IN(rcVersion; "3.9", "3.10", "3.11", "3.12") then "" else ( -}} +# https://github.com/docker-library/python/issues/947 + --disable-gil \ + --enable-experimental-jit=yes \ +{{ ) end -}} ; \ nproc="$(nproc)"; \ {{ if is_alpine then ( -}}