From 43fe04f2c209221da5ecabce1253120744282509 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 18 Dec 2019 14:59:58 -0800 Subject: [PATCH] Add "--enable-optimizations" on Python 2.7 Also, add "--enable-option-checking=fatal" on all versions to ensure all our requested options actually take effect. --- 2.7/alpine3.10/Dockerfile | 38 ++++++++++++++++++++++++++++++ 2.7/alpine3.9/Dockerfile | 38 ++++++++++++++++++++++++++++++ 2.7/buster/Dockerfile | 38 ++++++++++++++++++++++++++++++ 2.7/buster/slim/Dockerfile | 38 ++++++++++++++++++++++++++++++ 2.7/stretch/Dockerfile | 38 ++++++++++++++++++++++++++++++ 2.7/stretch/slim/Dockerfile | 38 ++++++++++++++++++++++++++++++ 3.5/alpine3.10/Dockerfile | 1 + 3.5/alpine3.9/Dockerfile | 1 + 3.5/buster/Dockerfile | 1 + 3.5/buster/slim/Dockerfile | 1 + 3.5/stretch/Dockerfile | 1 + 3.5/stretch/slim/Dockerfile | 1 + 3.6/alpine3.10/Dockerfile | 1 + 3.6/alpine3.9/Dockerfile | 1 + 3.6/buster/Dockerfile | 1 + 3.6/buster/slim/Dockerfile | 1 + 3.6/stretch/Dockerfile | 1 + 3.6/stretch/slim/Dockerfile | 1 + 3.7/alpine3.10/Dockerfile | 1 + 3.7/alpine3.9/Dockerfile | 1 + 3.7/buster/Dockerfile | 1 + 3.7/buster/slim/Dockerfile | 1 + 3.7/stretch/Dockerfile | 1 + 3.7/stretch/slim/Dockerfile | 1 + 3.8/alpine3.10/Dockerfile | 1 + 3.8/buster/Dockerfile | 1 + 3.8/buster/slim/Dockerfile | 1 + 3.9-rc/alpine3.10/Dockerfile | 1 + 3.9-rc/buster/Dockerfile | 1 + Dockerfile-alpine.template | 1 + Dockerfile-caveman-alpine.template | 38 ++++++++++++++++++++++++++++++ Dockerfile-caveman-debian.template | 38 ++++++++++++++++++++++++++++++ Dockerfile-caveman-slim.template | 38 ++++++++++++++++++++++++++++++ Dockerfile-debian.template | 1 + Dockerfile-slim.template | 1 + 35 files changed, 368 insertions(+) diff --git a/2.7/alpine3.10/Dockerfile b/2.7/alpine3.10/Dockerfile index 3cb421840..4163de391 100644 --- a/2.7/alpine3.10/Dockerfile +++ b/2.7/alpine3.10/Dockerfile @@ -69,6 +69,8 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ --with-system-expat \ @@ -77,6 +79,42 @@ RUN set -ex \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ \ && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ diff --git a/2.7/alpine3.9/Dockerfile b/2.7/alpine3.9/Dockerfile index 7fa7bd22d..3ef903090 100644 --- a/2.7/alpine3.9/Dockerfile +++ b/2.7/alpine3.9/Dockerfile @@ -69,6 +69,8 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ --with-system-expat \ @@ -77,6 +79,42 @@ RUN set -ex \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ \ && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ diff --git a/2.7/buster/Dockerfile b/2.7/buster/Dockerfile index bf29bcb98..0fb0342fd 100644 --- a/2.7/buster/Dockerfile +++ b/2.7/buster/Dockerfile @@ -40,9 +40,47 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ && make -j "$(nproc)" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ && ldconfig \ \ diff --git a/2.7/buster/slim/Dockerfile b/2.7/buster/slim/Dockerfile index 4f55cd319..c835053e4 100644 --- a/2.7/buster/slim/Dockerfile +++ b/2.7/buster/slim/Dockerfile @@ -61,9 +61,47 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ && make -j "$(nproc)" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ && ldconfig \ \ diff --git a/2.7/stretch/Dockerfile b/2.7/stretch/Dockerfile index 497b3e269..c208e6291 100644 --- a/2.7/stretch/Dockerfile +++ b/2.7/stretch/Dockerfile @@ -40,9 +40,47 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ && make -j "$(nproc)" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ && ldconfig \ \ diff --git a/2.7/stretch/slim/Dockerfile b/2.7/stretch/slim/Dockerfile index 87eec2eea..e71ad4bec 100644 --- a/2.7/stretch/slim/Dockerfile +++ b/2.7/stretch/slim/Dockerfile @@ -61,9 +61,47 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ && make -j "$(nproc)" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ && ldconfig \ \ diff --git a/3.5/alpine3.10/Dockerfile b/3.5/alpine3.10/Dockerfile index 82b514c59..3a44151b4 100644 --- a/3.5/alpine3.10/Dockerfile +++ b/3.5/alpine3.10/Dockerfile @@ -68,6 +68,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.5/alpine3.9/Dockerfile b/3.5/alpine3.9/Dockerfile index d0f66544a..e70b028b2 100644 --- a/3.5/alpine3.9/Dockerfile +++ b/3.5/alpine3.9/Dockerfile @@ -68,6 +68,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.5/buster/Dockerfile b/3.5/buster/Dockerfile index 4bd6c4f1e..59663bb7f 100644 --- a/3.5/buster/Dockerfile +++ b/3.5/buster/Dockerfile @@ -40,6 +40,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.5/buster/slim/Dockerfile b/3.5/buster/slim/Dockerfile index a61b5a1d4..0bbc634ae 100644 --- a/3.5/buster/slim/Dockerfile +++ b/3.5/buster/slim/Dockerfile @@ -63,6 +63,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.5/stretch/Dockerfile b/3.5/stretch/Dockerfile index 21eac556b..4a441093f 100644 --- a/3.5/stretch/Dockerfile +++ b/3.5/stretch/Dockerfile @@ -40,6 +40,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.5/stretch/slim/Dockerfile b/3.5/stretch/slim/Dockerfile index b5a6976e0..c993f100f 100644 --- a/3.5/stretch/slim/Dockerfile +++ b/3.5/stretch/slim/Dockerfile @@ -63,6 +63,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.6/alpine3.10/Dockerfile b/3.6/alpine3.10/Dockerfile index 16b5f4afb..66b2c2593 100644 --- a/3.6/alpine3.10/Dockerfile +++ b/3.6/alpine3.10/Dockerfile @@ -70,6 +70,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.6/alpine3.9/Dockerfile b/3.6/alpine3.9/Dockerfile index 93c88804e..badfe5250 100644 --- a/3.6/alpine3.9/Dockerfile +++ b/3.6/alpine3.9/Dockerfile @@ -70,6 +70,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.6/buster/Dockerfile b/3.6/buster/Dockerfile index deeffabbd..8f9c928c3 100644 --- a/3.6/buster/Dockerfile +++ b/3.6/buster/Dockerfile @@ -40,6 +40,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.6/buster/slim/Dockerfile b/3.6/buster/slim/Dockerfile index 8dab47340..66468fa6a 100644 --- a/3.6/buster/slim/Dockerfile +++ b/3.6/buster/slim/Dockerfile @@ -63,6 +63,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.6/stretch/Dockerfile b/3.6/stretch/Dockerfile index cce564fdd..5f464c49d 100644 --- a/3.6/stretch/Dockerfile +++ b/3.6/stretch/Dockerfile @@ -40,6 +40,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.6/stretch/slim/Dockerfile b/3.6/stretch/slim/Dockerfile index 23aa47c66..8689259e0 100644 --- a/3.6/stretch/slim/Dockerfile +++ b/3.6/stretch/slim/Dockerfile @@ -63,6 +63,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.7/alpine3.10/Dockerfile b/3.7/alpine3.10/Dockerfile index c4bc352e2..f73b81716 100644 --- a/3.7/alpine3.10/Dockerfile +++ b/3.7/alpine3.10/Dockerfile @@ -71,6 +71,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.7/alpine3.9/Dockerfile b/3.7/alpine3.9/Dockerfile index 69916e673..dd47c1aa0 100644 --- a/3.7/alpine3.9/Dockerfile +++ b/3.7/alpine3.9/Dockerfile @@ -71,6 +71,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.7/buster/Dockerfile b/3.7/buster/Dockerfile index 79c7c4f6b..dfeb8e03f 100644 --- a/3.7/buster/Dockerfile +++ b/3.7/buster/Dockerfile @@ -41,6 +41,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.7/buster/slim/Dockerfile b/3.7/buster/slim/Dockerfile index 26951cd74..52a256c5b 100644 --- a/3.7/buster/slim/Dockerfile +++ b/3.7/buster/slim/Dockerfile @@ -64,6 +64,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.7/stretch/Dockerfile b/3.7/stretch/Dockerfile index 58127c7d3..49c3aa60c 100644 --- a/3.7/stretch/Dockerfile +++ b/3.7/stretch/Dockerfile @@ -41,6 +41,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.7/stretch/slim/Dockerfile b/3.7/stretch/slim/Dockerfile index e649e6174..40141a895 100644 --- a/3.7/stretch/slim/Dockerfile +++ b/3.7/stretch/slim/Dockerfile @@ -64,6 +64,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.8/alpine3.10/Dockerfile b/3.8/alpine3.10/Dockerfile index 8329bb9ea..de2101c77 100644 --- a/3.8/alpine3.10/Dockerfile +++ b/3.8/alpine3.10/Dockerfile @@ -71,6 +71,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.8/buster/Dockerfile b/3.8/buster/Dockerfile index a858429b9..05fef70cd 100644 --- a/3.8/buster/Dockerfile +++ b/3.8/buster/Dockerfile @@ -41,6 +41,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.8/buster/slim/Dockerfile b/3.8/buster/slim/Dockerfile index 816b279b8..fa6faa439 100644 --- a/3.8/buster/slim/Dockerfile +++ b/3.8/buster/slim/Dockerfile @@ -64,6 +64,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.9-rc/alpine3.10/Dockerfile b/3.9-rc/alpine3.10/Dockerfile index ee735e9cd..fc544557f 100644 --- a/3.9-rc/alpine3.10/Dockerfile +++ b/3.9-rc/alpine3.10/Dockerfile @@ -71,6 +71,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/3.9-rc/buster/Dockerfile b/3.9-rc/buster/Dockerfile index 8473baaa9..cd7690949 100644 --- a/3.9-rc/buster/Dockerfile +++ b/3.9-rc/buster/Dockerfile @@ -41,6 +41,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 5bfb76256..f4fd8b260 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -65,6 +65,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/Dockerfile-caveman-alpine.template b/Dockerfile-caveman-alpine.template index 66671b3b9..101063a01 100644 --- a/Dockerfile-caveman-alpine.template +++ b/Dockerfile-caveman-alpine.template @@ -63,6 +63,8 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ --with-system-expat \ @@ -71,6 +73,42 @@ RUN set -ex \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ \ && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ diff --git a/Dockerfile-caveman-debian.template b/Dockerfile-caveman-debian.template index da272fb29..19069ed59 100644 --- a/Dockerfile-caveman-debian.template +++ b/Dockerfile-caveman-debian.template @@ -34,9 +34,47 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ && make -j "$(nproc)" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ && ldconfig \ \ diff --git a/Dockerfile-caveman-slim.template b/Dockerfile-caveman-slim.template index 1741005c4..075cdc8df 100644 --- a/Dockerfile-caveman-slim.template +++ b/Dockerfile-caveman-slim.template @@ -55,9 +55,47 @@ RUN set -ex \ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ && ./configure \ --build="$gnuArch" \ + --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --enable-unicode=ucs4 \ && make -j "$(nproc)" \ +# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + ' \ && make install \ && ldconfig \ \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index fe2e6d5e9..4d56b25cf 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -37,6 +37,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 92bde25e2..91e12a58c 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -58,6 +58,7 @@ RUN set -ex \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ --enable-optimizations \ + --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \