Skip to content

Commit 8d2b5ff

Browse files
authored
Merge pull request #411 from infosiftr/profile-task
Remove explicit PROFILE_TASK for 3.8+
2 parents 8363975 + 81462d1 commit 8d2b5ff

File tree

25 files changed

+36
-133
lines changed

25 files changed

+36
-133
lines changed

3.5/alpine3.10/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ RUN set -ex \
7676
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7777
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
7878
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
79-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
79+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8080
PROFILE_TASK='-m test.regrtest --pgo \
8181
test_array \
8282
test_base64 \

3.5/alpine3.9/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ RUN set -ex \
7676
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7777
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
7878
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
79-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
79+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8080
PROFILE_TASK='-m test.regrtest --pgo \
8181
test_array \
8282
test_base64 \

3.5/buster/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RUN set -ex \
4545
--with-system-ffi \
4646
--without-ensurepip \
4747
&& make -j "$(nproc)" \
48-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
48+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
4949
PROFILE_TASK='-m test.regrtest --pgo \
5050
test_array \
5151
test_base64 \

3.5/buster/slim/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUN set -ex \
6868
--with-system-ffi \
6969
--without-ensurepip \
7070
&& make -j "$(nproc)" \
71-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
71+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7272
PROFILE_TASK='-m test.regrtest --pgo \
7373
test_array \
7474
test_base64 \

3.5/stretch/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RUN set -ex \
4545
--with-system-ffi \
4646
--without-ensurepip \
4747
&& make -j "$(nproc)" \
48-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
48+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
4949
PROFILE_TASK='-m test.regrtest --pgo \
5050
test_array \
5151
test_base64 \

3.5/stretch/slim/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUN set -ex \
6868
--with-system-ffi \
6969
--without-ensurepip \
7070
&& make -j "$(nproc)" \
71-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
71+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7272
PROFILE_TASK='-m test.regrtest --pgo \
7373
test_array \
7474
test_base64 \

3.6/alpine3.10/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ RUN set -ex \
7878
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7979
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8080
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
81-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
81+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8282
PROFILE_TASK='-m test.regrtest --pgo \
8383
test_array \
8484
test_base64 \

3.6/alpine3.9/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ RUN set -ex \
7878
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7979
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8080
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
81-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
81+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8282
PROFILE_TASK='-m test.regrtest --pgo \
8383
test_array \
8484
test_base64 \

3.6/buster/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RUN set -ex \
4545
--with-system-ffi \
4646
--without-ensurepip \
4747
&& make -j "$(nproc)" \
48-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
48+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
4949
PROFILE_TASK='-m test.regrtest --pgo \
5050
test_array \
5151
test_base64 \

3.6/buster/slim/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUN set -ex \
6868
--with-system-ffi \
6969
--without-ensurepip \
7070
&& make -j "$(nproc)" \
71-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
71+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7272
PROFILE_TASK='-m test.regrtest --pgo \
7373
test_array \
7474
test_base64 \

3.6/stretch/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RUN set -ex \
4545
--with-system-ffi \
4646
--without-ensurepip \
4747
&& make -j "$(nproc)" \
48-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
48+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
4949
PROFILE_TASK='-m test.regrtest --pgo \
5050
test_array \
5151
test_base64 \

3.6/stretch/slim/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUN set -ex \
6868
--with-system-ffi \
6969
--without-ensurepip \
7070
&& make -j "$(nproc)" \
71-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
71+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7272
PROFILE_TASK='-m test.regrtest --pgo \
7373
test_array \
7474
test_base64 \

3.7/alpine3.10/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ RUN set -ex \
7979
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8080
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8181
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
82-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
82+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8383
PROFILE_TASK='-m test.regrtest --pgo \
8484
test_array \
8585
test_base64 \

3.7/alpine3.9/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ RUN set -ex \
7979
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8080
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8181
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
82-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
82+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8383
PROFILE_TASK='-m test.regrtest --pgo \
8484
test_array \
8585
test_base64 \

3.7/buster/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN set -ex \
4646
--with-system-ffi \
4747
--without-ensurepip \
4848
&& make -j "$(nproc)" \
49-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
49+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
5050
PROFILE_TASK='-m test.regrtest --pgo \
5151
test_array \
5252
test_base64 \

3.7/buster/slim/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN set -ex \
6969
--with-system-ffi \
7070
--without-ensurepip \
7171
&& make -j "$(nproc)" \
72-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
72+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7373
PROFILE_TASK='-m test.regrtest --pgo \
7474
test_array \
7575
test_base64 \

3.7/stretch/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN set -ex \
4646
--with-system-ffi \
4747
--without-ensurepip \
4848
&& make -j "$(nproc)" \
49-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
49+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
5050
PROFILE_TASK='-m test.regrtest --pgo \
5151
test_array \
5252
test_base64 \

3.7/stretch/slim/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN set -ex \
6969
--with-system-ffi \
7070
--without-ensurepip \
7171
&& make -j "$(nproc)" \
72-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
72+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7373
PROFILE_TASK='-m test.regrtest --pgo \
7474
test_array \
7575
test_base64 \

3.8-rc/alpine3.10/Dockerfile

-36
Original file line numberDiff line numberDiff line change
@@ -79,42 +79,6 @@ RUN set -ex \
7979
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8080
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8181
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
82-
# 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-
' \
11882
&& make install \
11983
\
12084
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \

3.8-rc/buster/Dockerfile

-36
Original file line numberDiff line numberDiff line change
@@ -46,42 +46,6 @@ RUN set -ex \
4646
--with-system-ffi \
4747
--without-ensurepip \
4848
&& make -j "$(nproc)" \
49-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
50-
PROFILE_TASK='-m test.regrtest --pgo \
51-
test_array \
52-
test_base64 \
53-
test_binascii \
54-
test_binhex \
55-
test_binop \
56-
test_bytes \
57-
test_c_locale_coercion \
58-
test_class \
59-
test_cmath \
60-
test_codecs \
61-
test_compile \
62-
test_complex \
63-
test_csv \
64-
test_decimal \
65-
test_dict \
66-
test_float \
67-
test_fstring \
68-
test_hashlib \
69-
test_io \
70-
test_iter \
71-
test_json \
72-
test_long \
73-
test_math \
74-
test_memoryview \
75-
test_pickle \
76-
test_re \
77-
test_set \
78-
test_slice \
79-
test_struct \
80-
test_threading \
81-
test_time \
82-
test_traceback \
83-
test_unicode \
84-
' \
8549
&& make install \
8650
&& ldconfig \
8751
\

3.8-rc/buster/slim/Dockerfile

-36
Original file line numberDiff line numberDiff line change
@@ -69,42 +69,6 @@ RUN set -ex \
6969
--with-system-ffi \
7070
--without-ensurepip \
7171
&& make -j "$(nproc)" \
72-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
73-
PROFILE_TASK='-m test.regrtest --pgo \
74-
test_array \
75-
test_base64 \
76-
test_binascii \
77-
test_binhex \
78-
test_binop \
79-
test_bytes \
80-
test_c_locale_coercion \
81-
test_class \
82-
test_cmath \
83-
test_codecs \
84-
test_compile \
85-
test_complex \
86-
test_csv \
87-
test_decimal \
88-
test_dict \
89-
test_float \
90-
test_fstring \
91-
test_hashlib \
92-
test_io \
93-
test_iter \
94-
test_json \
95-
test_long \
96-
test_math \
97-
test_memoryview \
98-
test_pickle \
99-
test_re \
100-
test_set \
101-
test_slice \
102-
test_struct \
103-
test_threading \
104-
test_time \
105-
test_traceback \
106-
test_unicode \
107-
' \
10872
&& make install \
10973
&& ldconfig \
11074
\

Dockerfile-alpine.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ RUN set -ex \
7373
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7474
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
7575
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
76-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
76+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7777
PROFILE_TASK='-m test.regrtest --pgo \
7878
test_array \
7979
test_base64 \

Dockerfile-debian.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN set -ex \
4242
--with-system-ffi \
4343
--without-ensurepip \
4444
&& make -j "$(nproc)" \
45-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
45+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
4646
PROFILE_TASK='-m test.regrtest --pgo \
4747
test_array \
4848
test_base64 \

Dockerfile-slim.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ RUN set -ex \
6363
--with-system-ffi \
6464
--without-ensurepip \
6565
&& make -j "$(nproc)" \
66-
# https://github.com/docker-library/python/issues/160#issuecomment-509426916
66+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
6767
PROFILE_TASK='-m test.regrtest --pgo \
6868
test_array \
6969
test_base64 \

update.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,20 @@ for version in "${versions[@]}"; do
153153
-e 's!^(FROM (debian|buildpack-deps|alpine|mcr[.]microsoft[.]com/[^:]+)):.*!\1:'"$tag"'!' \
154154
"$dir/Dockerfile"
155155

156-
case "$version/$v" in
156+
case "$rcVersion/$v" in
157157
# Libraries to build the nis module only available in Alpine 3.7+.
158158
# Also require this patch https://bugs.python.org/issue32521 only available in Python 2.7, 3.6+.
159-
3.5*/alpine*)
159+
3.5/alpine*)
160160
sed -ri -e '/libnsl-dev/d' -e '/libtirpc-dev/d' "$dir/Dockerfile"
161161
;;& # (3.5*/alpine* needs to match the next blocks too)
162162

163163
# https://bugs.python.org/issue11063, https://bugs.python.org/issue20519 (Python 3.7.0+)
164164
# A new native _uuid module improves uuid import time and avoids using ctypes.
165165
# This requires the development libuuid headers.
166-
3.[5-6]*/alpine*)
166+
3.[5-6]/alpine*)
167167
sed -ri -e '/util-linux-dev/d' "$dir/Dockerfile"
168168
;;
169-
3.[5-6]*)
169+
3.[5-6]/*)
170170
sed -ri -e '/uuid-dev/d' "$dir/Dockerfile"
171171
;;& # (other Debian variants need to match later blocks)
172172
*/buster | */stretch)
@@ -175,6 +175,17 @@ for version in "${versions[@]}"; do
175175
;;
176176
esac
177177

178+
major="${rcVersion%%.*}"
179+
minor="${rcVersion#$major.}"
180+
minor="${minor%%.*}"
181+
if [ "$major" -gt 3 ] || { [ "$major" -eq 3 ] && [ "$minor" -ge 8 ]; }; then
182+
# PROFILE_TASK has a reasonable default starting in 3.8+; see:
183+
# https://bugs.python.org/issue36044
184+
# https://github.com/python/cpython/pull/14702
185+
# https://github.com/python/cpython/pull/14910
186+
perl -0 -i -p -e "s![^\n]+PROFILE_TASK(='[^']+?')?[^\n]+\n!!gs" "$dir/Dockerfile"
187+
fi
188+
178189
case "$v" in
179190
windows/*-1803)
180191
travisEnv='\n - os: windows\n dist: 1803-containers\n env: VERSION='"$version VARIANT=$v$travisEnv"

0 commit comments

Comments
 (0)