Skip to content

Conversation

@edmorley
Copy link
Member

@edmorley edmorley commented Oct 6, 2025

The upstream Python test suite (which gets run when compiling with PGO enabled) fails with the libexpat in Ubuntu 22.04.

In #1661, I previously added what I hoped would be a temporarily workaround until the failures were fixed upstream, however, the Python maintainers say they don't guarantee compatibility with distro expat, and that it's up to us to test for compatibility and patch if we want to use the distro version. However, this isn't viable given that we're neither a Linux distro maintainer, a CPython maintainer or an expat maintainer.

Instead, like the upstream Docker Hub Python images (who were also affected by this issue), we will switch the expat bundled within the CPython sources, which is actually what the upstream CPython project tests in its CI. This means users won't get security updates for free via the base image, and will instead need to update their Python patch versions instead as newer versions are vendored in CPython. However, this is the least worst alternative for now.

I'm doing this now, since otherwise I'll need to generate another patch series for the soon to be released Python 3.14.

Note: This change only affects Python versions compiled/released after this merges. Existing Python versions on S3 are unaffected for now (unless they ever get recompiled in the future).

For more details, see:
python/cpython#125067 (comment)

GUS-W-17414073.

The upstream Python test suite (which gets run when compiling with PGO
enabled) fails with the `libexpat` in Ubuntu 22.04.

In #1661 previously added what I hoped would be a temporarily workaround
until the failures were fixed upstream, however, the Python maintainers
say they don't guarantee compatibility with distro `expat`, and that
it's up to us to test for compatibility and patch if we want to use the
distro version. However, this isn't viable given that we're neither a
Linux distro maintainer, a CPython maintainer or an expat maintainer.

Instead, like the upstream Docker Hub Python images, we will switch the
`expat` bundled within the CPython sources, which is actually what the
upstream CPython project tests in its CI. This means users won't get
security updates for free via the base image, and will instead need to
update their Python patch versions instead as newer versions are
vendored in CPython. However, this is the least worst alternative for
now.

I'm doing this now, since otherwise I'll need to generate another patch
series for the soon to be released Python 3.14.

Note: This change only affects Python versions compiled/released after
this merges. Existing Python versions on S3 are unaffected for now
(unless they ever get recompiled in the future).

For more details, see:
python/cpython#125067 (comment)

GUS-W-17414073.
@edmorley edmorley self-assigned this Oct 6, 2025
@edmorley edmorley marked this pull request as ready for review October 6, 2025 12:21
@edmorley edmorley requested a review from a team as a code owner October 6, 2025 12:21
@edmorley
Copy link
Member Author

edmorley commented Oct 6, 2025

@edmorley edmorley enabled auto-merge (squash) October 6, 2025 13:14
@edmorley edmorley merged commit 227fcbf into main Oct 6, 2025
20 of 21 checks passed
@edmorley edmorley deleted the vendored-expat branch October 6, 2025 13:16
@heroku-linguist heroku-linguist bot mentioned this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants