Repository navigation
Python 3.15.2, built with the configure flags the Dockerfile asks for - #256
Open
rongxin-liu wants to merge 3 commits into
Open
rongxin-liu wants to merge 3 commits into
rongxin-liu wants to merge 3 commits into
Conversation
Moves the image's python3 from 3.14.10 to 3.15.2, now that cs50/check runs its TensorFlow checks on a runtime of its own (cs50/check#53) and no longer needs this image to stay on a Python that TensorFlow supports. The bare second ./configure, there since 2020, regenerated the Makefile with default flags: the shipped python3 reports an empty CONFIG_ARGS and Py_ENABLE_SHARED=0, so --enable-optimizations, --with-lto, and --enable-shared never took effect. With it gone, libpython is a shared library for the first time, so both stages run ldconfig after /usr/local/lib gains it. 3.15 no longer falls back to the bundled libmpdec, so the builder installs libmpdec-dev and the final stage its runtime package, libmpdec4; without the latter `import decimal` silently loads the pure-Python fallback. The smoke test now asserts the configure flags are in CONFIG_ARGS, the build is shared and python3 resolves libpython from /usr/local/lib, and _decimal is the C module. The workflow's setup-python moves to 3.15 to match.
rongxin-liu
added a commit
to cs50/check
that referenced
this pull request
Nov 25, 2026
…eels requirements.txt is installed into both runtimes, and cs50/cli:canary is now Python 3.15 (cs50/cli#256), so each pin needs cp314 and cp315 wheels. These are the first versions of each that have both; no pandas 2.x has cp315. Pillow's JPEG output decides whether a CS50P shirt submission passes (the check byte-hashes the saved image), so the reference solution was run against the check's six muppet inputs under Pillow 11.3.0, 12.3.0, and 13.0.0: all six hashes match on every version. Verified by building the Python layers FROM cs50/cli:latest (3.14) and cs50/cli:canary (3.15) and running the smoke test's Python sections on each.
…test suite configure has been warning "unrecognized options: --disable-static, --without-tests" on every build. Neither is a CPython option. --disable-static did nothing (a shared build installs no libpython.a), and --without-tests quietly shipped Lib/test plus the _test* extension modules, 176 MB in the 3.15 image. --disable-test-modules is the real flag; PGO training still runs from the source tree, and lib/python3.15 drops to 225 MB. The smoke test asserts Lib/test and _testcapi are absent so a return to the no-op flag cannot pass. (Spotted by rongxin-liu while reviewing cs50/check#53.)
This was referenced Nov 25, 2026
canary is whichever branch pushed last, so a dependent that wants to build on one branch's image for a while (cs50/check trialing Python 3.15 in production from this branch) has nothing stable to point at. Every branch other than main and ubuntu-* now also publishes <branch>-amd64, <branch>-arm64, and a <branch> manifest, with / in the branch name replaced by -.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The image's
python3moves to 3.15.2, and for the first time it is actually the build the Dockerfile asks for: optimized, LTO, and shared. The shipped 3.14python3reports an emptyCONFIG_ARGSandPy_ENABLE_SHARED=0, because a bare second./configure, there since 2020, regenerated the Makefile with default flags.Second half of the Python 3.15 move. cs50/check#53 already took TensorFlow off this image's
python3and onto a runtime of its own, which is what unblocks this; it should be merged first, since pushing this branch publishescs50/cli:canary, the base forcs50/checkbranch builds.What changes beyond the version number
./configureis gone. Removing it makes--enable-sharedtake effect, solibpython3.15.sois now a real shared library in/usr/local/lib. Both stages runldconfigafter that directory gains it; without it the builder's ownpip3 installfails to loadlibpython3.15.so.1.0, which is how this surfaced.--disable-staticand--without-testsare not CPython options; configure has warnedunrecognized optionson every build since they were added. The first did nothing. The second quietly shippedLib/testand the_test*extension modules, 176 MB in the 3.15 image;--disable-test-modulesis the real flag, PGO training still runs from the source tree, andlib/python3.15drops from ~400 MB to 225 MB. (Spotted by @rongxin-liu reviewing Run checks that import TensorFlow on a Python 3.14 runtime check#53.)libmpdec-devand the final stagelibmpdec4. Without the runtime packageimport decimalsucceeds but quietly loads the pure-Python_pydecimal.CONFIG_ARGS,Py_ENABLE_SHAREDis 1 andpython3resolveslibpythonfrom/usr/local/lib,_decimal(not the fallback) is whatimport decimalloads, andLib/testand_testcapiare absent. Any future bare./configureor missing runtime library fails the build instead of shipping.Verification
Built the Python block for arm64 against
ubuntu:26.04with these exact Dockerfile lines, then copied/usr/localinto a fresh stage the way the final stage does. Result: nounrecognized optionswarning,CONFIG_ARGS: '--disable-test-modules' '--enable-optimizations' '--enable-shared' '--with-lto' 'CFLAGS=-Os', no test suite installed,Py_ENABLE_SHARED: 1,libpython3.15.so.1.0 => /usr/local/lib/..., andbz2 ctypes curses decimal lzma readline sqlite3 ssl zliball import with_decimalloaded. The full image andtests/smoke.shrun in CI, andcanaryis only published if it passes.Not verified here: the CS50 Python tools on 3.15 (
compare50/style50broke at runtime on 3.14, which is why the smoke test exercises them for real) and thepip3 installblock. The workflow's smoke test covers both.Downstream
cs50/check#53 already moved
cs50/check's shared pins to versions with cp315 wheels and its CI passes against this canary. Not in scope here:compare50 1.2.15pinsattrs<21, which is satisfiable in this image (pip resolvesattrs 20.3.0,pip checkis clean) but conflicts with check50's4.0.0-devbranch incs50/check; the fix belongs incs50/compare50.cs50/serverand the apps built on it need the per-app audit from the tracking issue.Related: #254