@@ -48,6 +48,33 @@ if [ "${DISABLE_GIL:-0}" = "1" ]; then
4848 CONFIGURE_EXTRA=" --disable-gil"
4949fi
5050
51+ # PGO exclusions for the musl (Alpine) base. The default PROFILE_TASK from
52+ # configure.ac is `-m test --pgo --timeout=$(TESTTIMEOUT)`; we append -x
53+ # flags for tests that fail during profile generation because of musl
54+ # limitations rather than CPython regressions. Alpine aports follows the
55+ # same pattern (their ppc64le branch excludes `test_time`) but handles
56+ # musl locale breakage in post-build `check()` only because they never
57+ # build 3.13 or free-threaded. We must handle it at PGO time.
58+ #
59+ # test_re: test_locale_caching / test_locale_compiled assume iso8859-1
60+ # case-folding works. musl's LC_CTYPE has no such locale data, so the
61+ # case-insensitive match of `\xc5` ~ `\xe5` fails. Alpine's own check()
62+ # skips the whole test_re module on musl for the same reason. 3.12 passed
63+ # by accident because Modules/_sre/sre.c called libc `tolower` directly;
64+ # 3.13 routes through a `sre_tolower` wrapper that exposes the musl gap.
65+ PGO_EXCLUDES=" test_re"
66+
67+ # Per-Dockerfile opt-in for version-specific PGO breakage. Used by 3.14t
68+ # to skip test_struct.test_endian_table_init_subinterpreters, which races
69+ # on importlib._bootstrap_external._fill_cache() under concurrent
70+ # subinterpreter import (upstream gh-140260 / gh-142414). Remove the ENV
71+ # once the upstream fix lands in a 3.14.x point release.
72+ if [ -n " ${EXTRA_PGO_EXCLUDES:- } " ]; then
73+ PGO_EXCLUDES=" ${PGO_EXCLUDES} ${EXTRA_PGO_EXCLUDES} "
74+ fi
75+
76+ export PROFILE_TASK=" -m test --pgo --timeout=\$ (TESTTIMEOUT) -x ${PGO_EXCLUDES} "
77+
5178./configure --build=" $gnuArch " --enable-loadable-sqlite-extensions \
5279 --enable-optimizations --enable-option-checking=fatal --enable-shared \
5380 --with-lto --with-system-expat --without-ensurepip \
0 commit comments