Skip to content

Prepare the runtime build scripts for Python 3.15 - #2154

Merged
edmorley merged 1 commit into
mainfrom
edmorley/python-3.15-runtime-build
Oct 8, 2026
Merged

edmorley merged 1 commit into
mainfrom
edmorley/python-3.15-runtime-build

Conversation

@edmorley

@edmorley edmorley commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

This prepares the scripts used to compile the Python runtime binaries for Python 3.15. It does not add Python 3.15 support to the buildpack itself, which will follow in a later PR once Python 3.15.0 has been released (expected 2026-10-09) and its binaries built and uploaded.

Python 3.15 no longer falls back to the bundled libmpdec when the system library is missing, which would otherwise cause the _decimal module to silently not be built:
https://docs.python.org/3.15/whatsnew/3.15.html#build-changes

We can't use the system package yet, since Ubuntu 24.04 doesn't currently ship libmpdec-dev. We've requested that it be re-added (https://bugs.launchpad.net/ubuntu/+source/mpdecimal/+bug/2167730), but even once it is, it must first be rolled out to all base images. So for now we explicitly opt in to the bundled copy using --without-system-libmpdec, with a TODO to switch later.

The runtime test script now imports _decimal and _hashlib directly, since decimal and hashlib fall back to other implementations if their C modules weren't built, which would hide a broken build. It also imports curses.panel, since curses doesn't import _curses_panel, and now runs the compression.zstd check for all versions that have it rather than only 3.14.

Tested by compiling Python 3.15.0rc3 for arm64 on Heroku-24 and running the runtime test script against the result. (This used a modified copy of the build script, since release candidates are published under a different URL to final releases, and we intentionally don't support them in the buildpack itself.)

GUS-W-20591263.

This prepares the scripts used to compile the Python runtime binaries
for Python 3.15. It does not add Python 3.15 support to the buildpack
itself, which will follow in a later PR once Python 3.15.0 has been
released (expected 2026-10-09) and its binaries built and uploaded.

Python 3.15 no longer falls back to the bundled `libmpdec` when the
system library is missing, which would otherwise cause the `_decimal`
module to silently not be built:
https://docs.python.org/3.15/whatsnew/3.15.html#build-changes

We can't use the system package yet, since Ubuntu 24.04 doesn't
currently ship `libmpdec-dev`. We've requested that it be re-added
(https://bugs.launchpad.net/ubuntu/+source/mpdecimal/+bug/2167730), but
even once it is, it must first be rolled out to all base images. So for
now we explicitly opt in to the bundled copy using
`--without-system-libmpdec`, with a TODO to switch later.

The runtime test script now imports `_decimal` and `_hashlib` directly,
since `decimal` and `hashlib` fall back to other implementations if
their C modules weren't built, which would hide a broken build. It also
imports `curses.panel`, since `curses` doesn't import `_curses_panel`,
and now runs the `compression.zstd` check for all versions that have it
rather than only 3.14.

Tested by compiling Python 3.15.0rc3 for arm64 on Heroku-24 and running
the runtime test script against the result. (This used a modified copy
of the build script, since release candidates are published under a
different URL to final releases, and we intentionally don't support
them in the buildpack itself.)

GUS-W-20591263.
@edmorley edmorley self-assigned this Oct 8, 2026
@edmorley
edmorley marked this pull request as ready for review October 8, 2026 14:24
@edmorley
edmorley requested a review from a team as a code owner October 8, 2026 14:24
@edmorley
edmorley enabled auto-merge (squash) October 8, 2026 14:24
@edmorley
edmorley merged commit 30471db into main Oct 8, 2026
10 of 11 checks passed
@edmorley
edmorley deleted the edmorley/python-3.15-runtime-build branch October 8, 2026 14:30
@heroku-linguist heroku-linguist Bot mentioned this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants