Skip to content

Commit d188118

Browse files
authored
Merge pull request #440 from infosiftr/enable-caveman-optimizations
Add "--enable-optimizations" on Python 2.7
2 parents 925dabd + 43fe04f commit d188118

35 files changed

+368
-0
lines changed

2.7/alpine3.10/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ RUN set -ex \
6969
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
7070
&& ./configure \
7171
--build="$gnuArch" \
72+
--enable-optimizations \
73+
--enable-option-checking=fatal \
7274
--enable-shared \
7375
--enable-unicode=ucs4 \
7476
--with-system-expat \
@@ -77,6 +79,42 @@ RUN set -ex \
7779
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7880
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
7981
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
82+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
83+
PROFILE_TASK='-m test.regrtest --pgo \
84+
test_array \
85+
test_base64 \
86+
test_binascii \
87+
test_binhex \
88+
test_binop \
89+
test_bytes \
90+
test_c_locale_coercion \
91+
test_class \
92+
test_cmath \
93+
test_codecs \
94+
test_compile \
95+
test_complex \
96+
test_csv \
97+
test_decimal \
98+
test_dict \
99+
test_float \
100+
test_fstring \
101+
test_hashlib \
102+
test_io \
103+
test_iter \
104+
test_json \
105+
test_long \
106+
test_math \
107+
test_memoryview \
108+
test_pickle \
109+
test_re \
110+
test_set \
111+
test_slice \
112+
test_struct \
113+
test_threading \
114+
test_time \
115+
test_traceback \
116+
test_unicode \
117+
' \
80118
&& make install \
81119
\
82120
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \

2.7/alpine3.9/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ RUN set -ex \
6969
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
7070
&& ./configure \
7171
--build="$gnuArch" \
72+
--enable-optimizations \
73+
--enable-option-checking=fatal \
7274
--enable-shared \
7375
--enable-unicode=ucs4 \
7476
--with-system-expat \
@@ -77,6 +79,42 @@ RUN set -ex \
7779
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7880
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
7981
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
82+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
83+
PROFILE_TASK='-m test.regrtest --pgo \
84+
test_array \
85+
test_base64 \
86+
test_binascii \
87+
test_binhex \
88+
test_binop \
89+
test_bytes \
90+
test_c_locale_coercion \
91+
test_class \
92+
test_cmath \
93+
test_codecs \
94+
test_compile \
95+
test_complex \
96+
test_csv \
97+
test_decimal \
98+
test_dict \
99+
test_float \
100+
test_fstring \
101+
test_hashlib \
102+
test_io \
103+
test_iter \
104+
test_json \
105+
test_long \
106+
test_math \
107+
test_memoryview \
108+
test_pickle \
109+
test_re \
110+
test_set \
111+
test_slice \
112+
test_struct \
113+
test_threading \
114+
test_time \
115+
test_traceback \
116+
test_unicode \
117+
' \
80118
&& make install \
81119
\
82120
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \

2.7/buster/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,47 @@ RUN set -ex \
4040
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
4141
&& ./configure \
4242
--build="$gnuArch" \
43+
--enable-optimizations \
44+
--enable-option-checking=fatal \
4345
--enable-shared \
4446
--enable-unicode=ucs4 \
4547
&& make -j "$(nproc)" \
48+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
49+
PROFILE_TASK='-m test.regrtest --pgo \
50+
test_array \
51+
test_base64 \
52+
test_binascii \
53+
test_binhex \
54+
test_binop \
55+
test_bytes \
56+
test_c_locale_coercion \
57+
test_class \
58+
test_cmath \
59+
test_codecs \
60+
test_compile \
61+
test_complex \
62+
test_csv \
63+
test_decimal \
64+
test_dict \
65+
test_float \
66+
test_fstring \
67+
test_hashlib \
68+
test_io \
69+
test_iter \
70+
test_json \
71+
test_long \
72+
test_math \
73+
test_memoryview \
74+
test_pickle \
75+
test_re \
76+
test_set \
77+
test_slice \
78+
test_struct \
79+
test_threading \
80+
test_time \
81+
test_traceback \
82+
test_unicode \
83+
' \
4684
&& make install \
4785
&& ldconfig \
4886
\

2.7/buster/slim/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,47 @@ RUN set -ex \
6161
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
6262
&& ./configure \
6363
--build="$gnuArch" \
64+
--enable-optimizations \
65+
--enable-option-checking=fatal \
6466
--enable-shared \
6567
--enable-unicode=ucs4 \
6668
&& make -j "$(nproc)" \
69+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
70+
PROFILE_TASK='-m test.regrtest --pgo \
71+
test_array \
72+
test_base64 \
73+
test_binascii \
74+
test_binhex \
75+
test_binop \
76+
test_bytes \
77+
test_c_locale_coercion \
78+
test_class \
79+
test_cmath \
80+
test_codecs \
81+
test_compile \
82+
test_complex \
83+
test_csv \
84+
test_decimal \
85+
test_dict \
86+
test_float \
87+
test_fstring \
88+
test_hashlib \
89+
test_io \
90+
test_iter \
91+
test_json \
92+
test_long \
93+
test_math \
94+
test_memoryview \
95+
test_pickle \
96+
test_re \
97+
test_set \
98+
test_slice \
99+
test_struct \
100+
test_threading \
101+
test_time \
102+
test_traceback \
103+
test_unicode \
104+
' \
67105
&& make install \
68106
&& ldconfig \
69107
\

2.7/stretch/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,47 @@ RUN set -ex \
4040
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
4141
&& ./configure \
4242
--build="$gnuArch" \
43+
--enable-optimizations \
44+
--enable-option-checking=fatal \
4345
--enable-shared \
4446
--enable-unicode=ucs4 \
4547
&& make -j "$(nproc)" \
48+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
49+
PROFILE_TASK='-m test.regrtest --pgo \
50+
test_array \
51+
test_base64 \
52+
test_binascii \
53+
test_binhex \
54+
test_binop \
55+
test_bytes \
56+
test_c_locale_coercion \
57+
test_class \
58+
test_cmath \
59+
test_codecs \
60+
test_compile \
61+
test_complex \
62+
test_csv \
63+
test_decimal \
64+
test_dict \
65+
test_float \
66+
test_fstring \
67+
test_hashlib \
68+
test_io \
69+
test_iter \
70+
test_json \
71+
test_long \
72+
test_math \
73+
test_memoryview \
74+
test_pickle \
75+
test_re \
76+
test_set \
77+
test_slice \
78+
test_struct \
79+
test_threading \
80+
test_time \
81+
test_traceback \
82+
test_unicode \
83+
' \
4684
&& make install \
4785
&& ldconfig \
4886
\

2.7/stretch/slim/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,47 @@ RUN set -ex \
6161
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
6262
&& ./configure \
6363
--build="$gnuArch" \
64+
--enable-optimizations \
65+
--enable-option-checking=fatal \
6466
--enable-shared \
6567
--enable-unicode=ucs4 \
6668
&& make -j "$(nproc)" \
69+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
70+
PROFILE_TASK='-m test.regrtest --pgo \
71+
test_array \
72+
test_base64 \
73+
test_binascii \
74+
test_binhex \
75+
test_binop \
76+
test_bytes \
77+
test_c_locale_coercion \
78+
test_class \
79+
test_cmath \
80+
test_codecs \
81+
test_compile \
82+
test_complex \
83+
test_csv \
84+
test_decimal \
85+
test_dict \
86+
test_float \
87+
test_fstring \
88+
test_hashlib \
89+
test_io \
90+
test_iter \
91+
test_json \
92+
test_long \
93+
test_math \
94+
test_memoryview \
95+
test_pickle \
96+
test_re \
97+
test_set \
98+
test_slice \
99+
test_struct \
100+
test_threading \
101+
test_time \
102+
test_traceback \
103+
test_unicode \
104+
' \
67105
&& make install \
68106
&& ldconfig \
69107
\

3.5/alpine3.10/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ RUN set -ex \
6868
--build="$gnuArch" \
6969
--enable-loadable-sqlite-extensions \
7070
--enable-optimizations \
71+
--enable-option-checking=fatal \
7172
--enable-shared \
7273
--with-system-expat \
7374
--with-system-ffi \

3.5/alpine3.9/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ RUN set -ex \
6868
--build="$gnuArch" \
6969
--enable-loadable-sqlite-extensions \
7070
--enable-optimizations \
71+
--enable-option-checking=fatal \
7172
--enable-shared \
7273
--with-system-expat \
7374
--with-system-ffi \

3.5/buster/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN set -ex \
4040
--build="$gnuArch" \
4141
--enable-loadable-sqlite-extensions \
4242
--enable-optimizations \
43+
--enable-option-checking=fatal \
4344
--enable-shared \
4445
--with-system-expat \
4546
--with-system-ffi \

3.5/buster/slim/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN set -ex \
6363
--build="$gnuArch" \
6464
--enable-loadable-sqlite-extensions \
6565
--enable-optimizations \
66+
--enable-option-checking=fatal \
6667
--enable-shared \
6768
--with-system-expat \
6869
--with-system-ffi \

3.5/stretch/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN set -ex \
4040
--build="$gnuArch" \
4141
--enable-loadable-sqlite-extensions \
4242
--enable-optimizations \
43+
--enable-option-checking=fatal \
4344
--enable-shared \
4445
--with-system-expat \
4546
--with-system-ffi \

3.5/stretch/slim/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN set -ex \
6363
--build="$gnuArch" \
6464
--enable-loadable-sqlite-extensions \
6565
--enable-optimizations \
66+
--enable-option-checking=fatal \
6667
--enable-shared \
6768
--with-system-expat \
6869
--with-system-ffi \

3.6/alpine3.10/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN set -ex \
7070
--build="$gnuArch" \
7171
--enable-loadable-sqlite-extensions \
7272
--enable-optimizations \
73+
--enable-option-checking=fatal \
7374
--enable-shared \
7475
--with-system-expat \
7576
--with-system-ffi \

3.6/alpine3.9/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN set -ex \
7070
--build="$gnuArch" \
7171
--enable-loadable-sqlite-extensions \
7272
--enable-optimizations \
73+
--enable-option-checking=fatal \
7374
--enable-shared \
7475
--with-system-expat \
7576
--with-system-ffi \

3.6/buster/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN set -ex \
4040
--build="$gnuArch" \
4141
--enable-loadable-sqlite-extensions \
4242
--enable-optimizations \
43+
--enable-option-checking=fatal \
4344
--enable-shared \
4445
--with-system-expat \
4546
--with-system-ffi \

3.6/buster/slim/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN set -ex \
6363
--build="$gnuArch" \
6464
--enable-loadable-sqlite-extensions \
6565
--enable-optimizations \
66+
--enable-option-checking=fatal \
6667
--enable-shared \
6768
--with-system-expat \
6869
--with-system-ffi \

3.6/stretch/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN set -ex \
4040
--build="$gnuArch" \
4141
--enable-loadable-sqlite-extensions \
4242
--enable-optimizations \
43+
--enable-option-checking=fatal \
4344
--enable-shared \
4445
--with-system-expat \
4546
--with-system-ffi \

3.6/stretch/slim/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN set -ex \
6363
--build="$gnuArch" \
6464
--enable-loadable-sqlite-extensions \
6565
--enable-optimizations \
66+
--enable-option-checking=fatal \
6667
--enable-shared \
6768
--with-system-expat \
6869
--with-system-ffi \

3.7/alpine3.10/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ RUN set -ex \
7171
--build="$gnuArch" \
7272
--enable-loadable-sqlite-extensions \
7373
--enable-optimizations \
74+
--enable-option-checking=fatal \
7475
--enable-shared \
7576
--with-system-expat \
7677
--with-system-ffi \

0 commit comments

Comments
 (0)