Skip to content

Commit 2965c79

Browse files
committed
Do not set PROFILE_TASK environment variable
When this is set, the `--enable-optimizations` option is essentailly disabled, as the profile task step is skipped. For 3.13 on bullseye and alpine distros the version of expat has an issue that causes the xml tests to fail and thus results in a failed build. This was not an issue in version prior to 3.13 as the `Makefile` would ignore the failure and continue as the default `PROFILE_TASK` included a `|| true` clause. That clause was removed from 3.13's `Makefile`. Thus for these distros, a patch is applied to the unit test to skip them
1 parent fe21c86 commit 2965c79

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

Dockerfile-linux.template

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
def is_slim:
66
env.variant | startswith("slim-")
77
;
8+
def is_bullseye:
9+
env.variant | contains("bullseye")
10+
;
811
def rcVersion:
912
env.version | rtrimstr("-rc")
1013
-}}
@@ -191,19 +194,46 @@ RUN set -eux; \
191194
{{ ) end -}}
192195
{{ if is_slim or is_alpine then ( -}}
193196
LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \
197+
{{ ) else "" end -}}
198+
{{ if ([ "3.13" ] | index(rcVersion)) and (is_alpine or is_bullseye) then ( -}}
199+
# Workaround https://github.com/python/cpython/issues/125067
200+
printf '%s\n' \
201+
"diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py" \
202+
"index ebec9d8f18a..385735c1e18 100644" \
203+
"--- a/Lib/test/test_xml_etree.py" \
204+
"+++ b/Lib/test/test_xml_etree.py" \
205+
"@@ -1504,9 +1504,11 @@ def test_simple_xml(self, chunk_size=None, flush=False):" \
206+
" self.assert_event_tags(parser, [('end', 'root')])" \
207+
" self.assertIsNone(parser.close())" \
208+
"" \
209+
"+ @unittest.skip('Work around: https://github.com/python/cpython/issues/125067')" \
210+
" def test_simple_xml_chunk_1(self):" \
211+
" self.test_simple_xml(chunk_size=1, flush=True)" \
212+
"" \
213+
"+ @unittest.skip('Work around: https://github.com/python/cpython/issues/125067')" \
214+
" def test_simple_xml_chunk_5(self):" \
215+
" self.test_simple_xml(chunk_size=5, flush=True)" \
216+
"" \
217+
"@@ -1731,6 +1733,7 @@ def test_flush_reparse_deferral_enabled(self):" \
218+
"" \
219+
" self.assert_event_tags(parser, [('end', 'doc')])" \
220+
"" \
221+
"+ @unittest.skip('Work around: https://github.com/python/cpython/issues/125067')" \
222+
" def test_flush_reparse_deferral_disabled(self):" \
223+
" parser = ET.XMLPullParser(events=('start', 'end'))" > /tmp/python-3.13-libexpat-workaround.patch ; \
224+
patch -p1 </tmp/python-3.13-libexpat-workaround.patch ; \
225+
\
194226
{{ ) else "" end -}}
195227
make -j "$nproc" \
196228
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
197229
"LDFLAGS=${LDFLAGS:-}" \
198-
"PROFILE_TASK=${PROFILE_TASK:-}" \
199230
; \
200231
# https://github.com/docker-library/python/issues/784
201232
# prevent accidental usage of a system installed libpython of the same version
202233
rm python; \
203234
make -j "$nproc" \
204235
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
205236
"LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \
206-
"PROFILE_TASK=${PROFILE_TASK:-}" \
207237
python \
208238
; \
209239
make install; \

0 commit comments

Comments
 (0)