1DOLLY 82PACKAGE python3REQUIRES HOST runtime@04REQUIRES HOST dso@05REQUIRES HOST http@06REQUIRES HOST sockets@07REQUIRES HOST threads@089FROM /Dollyfile-system 5eb06684bc61be6a1d9af98b8a740fba55b22ff4216f6cdb117c6ff6583104f010USE /Dollyfile-curl bce8c6fafa9e15aa65c9804fc4fec07a309e6174c8e1cb80b7396ac6e458431e11USE /Dollyfile-libdolly-sockets 6b09a69a442e3002873b97f13b5ebef36beea3b660a40b55b3a58f8eddf41af012USE /demos/tools/Dollyfile-sqlite a594173d22ccd1c200fb03dcf8afe17de61e7425b6673f1f8eb6316d1f757b4813USE /demos/tools/Dollyfile-bzip2 ae99f712af0274f3d4c3e05cf8b1651c2df751547d062ab604c24778943fb21714USE /demos/tools/Dollyfile-xz 1ee07b9f2944f5dc4599228939c64a0918ccac7f591bbcced5d13338b267102415# Build the Python runtime and native extension SDK; pip.dm adds pip.16REQUIRES HEADER curl17REQUIRES HEADER libc18REQUIRES HEADER runtime19REQUIRES HEADER zlib20REQUIRES HEADER sqlite321REQUIRES HEADER bzlib22REQUIRES HEADER lzma23REQUIRES LIB    curl24REQUIRES LIB    z25REQUIRES LIB    sqlite326REQUIRES LIB    bz227REQUIRES LIB    lzma28REQUIRES TOOL   ar29REQUIRES TOOL   cc30REQUIRES TOOL   c++31REQUIRES TOOL   cp32REQUIRES TOOL   make33REQUIRES TOOL   mkdir34REQUIRES TOOL   mv35REQUIRES TOOL   rm36REQUIRES TOOL   tar37REQUIRES TOOL   test38REQUIRES TOOL   touch3940INSTALL /demos/python/Dollyfile-libffi 75794b08ca3faa58ac456f4a53e3134feab8da43da02605066c16c8dc4b8032941# python links the three USEd libraries statically and carries their licences.42FILE /usr/share/licenses/sqlite/blessing43FILE /usr/share/licenses/bzip2/LICENSE44FILE /usr/share/licenses/xz/COPYING45FILE /usr/share/licenses/xz/COPYING.0BSD46REQUIRES HEADER ffi47REQUIRES HEADER ffitarget48REQUIRES LIB    ffi49REQUIRES TOOL   gzip5051# Upstream Make runs the new interpreter before installing Lib. Do not retain52# timestamped bytecode caches from that build in the immutable image.53EXPORTS ENV PYTHONDONTWRITEBYTECODE 15455# The target is configured outside the browser, but every target object and56# executable is compiled here. Dolly-owned adapters remain independent pinned57# inputs instead of being hidden inside the upstream archive.58SOURCE /dist/static/python/cpython.tar.gz 4d96d70f2c8762ad6e5b7cca5450b342df94586b45d7ad30e0f46c9319483501 /tmp/cpython.tar.gz5960SLOP gzip -dc /tmp/cpython.tar.gz | tar -xf - -C /6162SOURCE /dist/static/python/runtimes/cpython-platform.c        20c5c120f835ce94ceb9be08cc25c4623ae333d844b2d3c3098ffed36f3b41eb /usr/src/python/Python/dolly_platform.c63SOURCE /dist/static/python/runtimes/cpython-extension-check.c 1763ec04e582beee6066af81c93fe20e8cf0d83ae7d41d935b395c5cb3cdf071 /usr/src/python/Modules/dolly_extension_check.c64SOURCE /dist/static/python/runtimes/cpython-socket-stubs.c    2aebdbdf3722dfa79f7b7eeb178b4beae2894a3d35ef12501054fb667342b335 /usr/src/python/Modules/dolly_socket_stubs.c65SOURCE /dist/static/python/runtimes/cpython-http.c 13610f3322a4d09aa558e5d31523a082303835bf7c5981557c09443562cdc2da /usr/src/python/Modules/dolly_http.c66SOURCE /dist/static/python/runtimes/cpython-transport.py 4567a855ff8459f6671c770dd69d93c84870bef3acd272f11ca28a394c9be92d /usr/src/python/Lib/_dolly_transport.py67SOURCE /dist/static/python/runtimes/cpython-process.c         354dd7a01f1d16276d8478fdcb41bcb07da3078d6860ba52b423e059a32dd389 /usr/src/python/Modules/dolly_process.c68SOURCE /dist/static/python/runtimes/cpython-subprocess.py     cabc2b4eb15e61332c2b63454724c3b390c5f2a2f0effa2889861e123835b785 /usr/src/python/Lib/_dolly_subprocess.py6970# The embedded LLVM optimizer spends minutes on a small measured set of71# translation units. Compile only those outliers at -O0 and let upstream Make72# preserve the prepared objects; the rest of CPython is substantially faster73# at -O2.74SLOP CWD /usr/src/python cc \75  -c \76  -O0 \77  -std=c11 \78  -fno-builtin \79  -fno-strict-aliasing \80  -IInclude/internal \81  -IInclude/internal/mimalloc \82  -IObjects \83  -IInclude \84  -IPython \85  -I. \86  -DPy_BUILD_CORE \87  Python/tracemalloc.c \88  -o Python/tracemalloc.o89SLOP CWD /usr/src/python cc \90  -c \91  -O0 \92  -std=c11 \93  -fno-builtin \94  -fno-strict-aliasing \95  -IInclude/internal \96  -IInclude/internal/mimalloc \97  -IObjects \98  -IInclude \99  -IPython \100  -I. \101  -DPy_BUILD_CORE \102  Modules/arraymodule.c \103  -o Modules/arraymodule.o104SLOP CWD /usr/src/python cc \105  -c \106  -O0 \107  -std=c11 \108  -IInclude/internal \109  -IInclude/internal/mimalloc \110  -IObjects \111  -IInclude \112  -IPython \113  -I. \114  -DPy_BUILD_CORE \115  Python/dolly_platform.c \116  -o Python/dolly_platform.o117SLOP CWD /usr/src/python cc \118  -c \119  -O0 \120  -std=c11 \121  -IInclude/internal \122  -IInclude/internal/mimalloc \123  -IObjects \124  -IInclude \125  -IPython \126  -I. \127  -DPy_BUILD_CORE \128  -DDATE='"Jan 01 1970"' \129  -DTIME='"00:00:00"' \130  Modules/getbuildinfo.c \131  -o Modules/getbuildinfo.o132SLOP CWD /usr/src/python cc \133  -c \134  -O0 \135  -std=c11 \136  -IInclude/internal \137  -IInclude/internal/mimalloc \138  -IObjects \139  -IInclude \140  -IPython \141  -I. \142  -DPy_BUILD_CORE \143  -DPLATFORM='"dolly"' \144  Python/getplatform.c \145  -o Python/getplatform.o146SLOP CWD /usr/src/python cc \147  -c \148  -O0 \149  -std=c11 \150  -IInclude/internal \151  -IInclude/internal/mimalloc \152  -IObjects \153  -IInclude \154  -IPython \155  -I. \156  -DPy_BUILD_CORE \157  -DABIFLAGS='""' \158  -DMULTIARCH='"dolly_0_wasm64"' \159  Python/sysmodule.c \160  -o Python/sysmodule.o161SLOP CWD /usr/src/python cc \162  -c \163  -O0 \164  -std=c17 \165  Modules/dolly_socket_stubs.c \166  -o Modules/dolly_socket_stubs.o167# The frozen modules are made by CPython's C freezer, built here, as a native168# build makes them: configure's cross build would run the build host's Python.169# pyexpatns.h, which gives CPython's own expat names of its own so that a170# program that embeds Python links another expat too (Blender), misses expat171# 2.8's XML_SetHashSalt16Bytes: the build renames it as the header does the rest.172SLOP CWD /usr/src/python make \173  -o configure \174  -o config.status \175  -o Makefile.pre \176  -o Makefile \177  -o Modules/config.c \178  -o Modules/getbuildinfo.o \179  -o Python/getplatform.o \180  -o Python/sysmodule.o \181  -o Python/tracemalloc.o \182  -o Modules/arraymodule.o \183  python \184  libpython3.14.a \185  SHELL=/bin/slop \186  CC=cc \187  LINKCC=cc \188  AR=ar \189  BLDSHARED=cc\ -shared \190  INSTSONAME=libpython3.14.a \191  DYNLOADFILE=dynload_shlib.o \192  PY_CFLAGS=-O2\ -std=c11\ -fno-builtin\ -fno-strict-aliasing\ -pthread \193  PY_CFLAGS_NODIST= \194  PY_CPPFLAGS=-IInclude/internal\ -IInclude/internal/mimalloc\ -IObjects\ -IInclude\ -IPython\ -I.\ -DXML_SetHashSalt16Bytes=PyExpat_XML_SetHashSalt16Bytes \195  CFLAGSFORSHARED= \196  PY_CORE_LDFLAGS=-pthread \197  LDFLAGS= \198  LINKFORSHARED=-rdynamic \199  MODULE_MATH_LDFLAGS= \200  MODULE_CMATH_LDFLAGS= \201  MODULE__STATISTICS_LDFLAGS= \202  MODULE__DATETIME_LDFLAGS= \203  MODULE_PYEXPAT_LDFLAGS=Modules/expat/libexpat.a \204  MODULE__SOCKET_CFLAGS=-Dfreeaddrinfo=dolly_py_freeaddrinfo\ -Dgai_strerror=dolly_py_gai_strerror\ -Dgetaddrinfo=dolly_py_getaddrinfo\ -Dgethostbyaddr=dolly_py_gethostbyaddr\ -Dgethostname=dolly_py_gethostname\ -Dgetnameinfo=dolly_py_getnameinfo\ -Dgetprotobyname=dolly_py_getprotobyname\ -Dgetservbyport=dolly_py_getservbyport\ -Dhtonl=dolly_py_htonl\ -Dif_freenameindex=dolly_py_if_freenameindex\ -Dif_indextoname=dolly_py_if_indextoname\ -Dif_nameindex=dolly_py_if_nameindex\ -Dif_nametoindex=dolly_py_if_nametoindex\ -Dinet_aton=dolly_py_inet_aton\ -Dinet_ntop=dolly_py_inet_ntop\ -Dinet_pton=dolly_py_inet_pton\ -Dntohl=dolly_py_ntohl\ -Dpoll=dolly_py_poll \205  MODULE_BINASCII_CFLAGS=-DUSE_ZLIB_CRC32 \206  MODULE_BINASCII_LDFLAGS=-lz \207  MODULE_ZLIB_CFLAGS= \208  MODULE_ZLIB_LDFLAGS=-lz \209  MODULE__CTYPES_CFLAGS=-DHAVE_FFI_PREP_CIF_VAR\ -DHAVE_FFI_PREP_CLOSURE_LOC\ -DHAVE_FFI_CLOSURE_ALLOC \210  MODULE__CTYPES_LDFLAGS=-lffi \211  LIBS=-ldolly-sockets \212  SYSLIBS= \213  LIBM= \214  LIBC= \215  SHLIBS= \216  MACHDEP_OBJS=Python/dolly_platform.o\ Modules/dolly_socket_stubs.o \217  DTRACE= \218  FREEZE_MODULE_BOOTSTRAP=./Programs/_freeze_module \219  FREEZE_MODULE_BOOTSTRAP_DEPS=Programs/_freeze_module \220  FREEZE_MODULE=./Programs/_freeze_module \221  FREEZE_MODULE_DEPS=Programs/_freeze_module222223# Install the standard-library contents into their final prefix.  Treat the224# destination as an installation directory explicitly: it may already exist225# in a composed image, and `mv SOURCE DESTINATION` would then create a nested226# `Lib` directory instead of the sys.path layout CPython requires.227SLOP mkdir \228  -p \229  /usr/lib/python3.14 \230  /usr/lib/python3.14/lib-dynload231SLOP cp \232  -R \233  /usr/src/python/Lib/. \234  /usr/lib/python3.14235SLOP test \236  -f \237  /usr/lib/python3.14/encodings/__init__.py238# The library a program that embeds Python links (Blender: demos/blender).239SLOP cp \240  /usr/src/python/libpython3.14.a \241  /usr/lib/libpython3.14.a242# And what it links beside it, which CPython's build makes and installs243# nowhere: the HACL archives of its hashes and its own expat, whose API244# pyexpatns.h renames.245SLOP mkdir -p /usr/lib/python3.14/embed246SLOP cp /usr/src/python/Modules/expat/libexpat.a /usr/lib/python3.14/embed/libpyexpat.a247SLOP CWD /usr/src/python/Modules/_hacl cp libHacl_Hash_MD5.a libHacl_Hash_SHA1.a libHacl_Hash_SHA2.a \248  libHacl_Hash_SHA3.a libHacl_Hash_BLAKE2.a /usr/lib/python3.14/embed249SLOP mv \250  /usr/src/python/python \251  /usr/bin/python252SLOP ln -sf python /usr/bin/python3253SLOP mkdir \254  -p \255  /usr/include/python3.14256SLOP cp \257  -R \258  /usr/src/python/Include/. \259  /usr/include/python3.14260SLOP cp \261  /usr/src/python/pyconfig.h \262  /usr/include/python3.14/pyconfig.h263SLOP CWD /usr/src/python slop \264  -c \265  'export _PYTHON_PROJECT_BASE=/usr/src/python; python -m sysconfig --generate-posix-vars'266SLOP cp \267  /usr/src/python/build/lib.dolly_0-wasm64-3.14/_sysconfigdata__dolly_dolly_0_wasm64.py \268  /usr/lib/python3.14/_sysconfigdata__dolly_dolly_0_wasm64.py269SLOP mkdir \270  -p \271  /usr/lib/python3.14/config-3.14-dolly_0_wasm64272SLOP cp \273  /usr/src/python/Makefile \274  /usr/lib/python3.14/config-3.14-dolly_0_wasm64/Makefile275# The check module is built as setuptools builds an extension: sysconfig's CC276# and CFLAGS compile it, its LDSHARED links it.277SLOP python -c 'import shlex, subprocess, sysconfig; flags = lambda name: shlex.split(sysconfig.get_config_var(name)); \278  subprocess.run(flags("CC") + flags("CFLAGS") + ["-I/usr/include/python3.14", "-c", "/usr/src/python/Modules/dolly_extension_check.c", "-o", "/tmp/dolly_extension_check.o"], check=True); \279  subprocess.run(flags("LDSHARED") + ["/tmp/dolly_extension_check.o", "-o", "/usr/lib/python3.14/lib-dynload/dolly_extension_check.cpython-314-dolly_0_wasm64.so"], check=True)'280281EXPORTS TOOL   python282EXPORTS TOOL   python3283EXPORTS ENV    PYTHONUTF8 1284EXPORTS HEADER python     /usr/include/python3.14285EXPORTS LIB    python     /usr/lib/libpython3.14.a286287SLOP python \288  --version289SLOP python \290  -c 'import pathlib; p = pathlib.Path("/tmp/python-check.txt"); p.write_text("PYTHON-WASM64"); assert p.read_text() == "PYTHON-WASM64"'291SLOP python \292  -c 'import dolly_extension_check; assert dolly_extension_check.answer() == 42'293SLOP python \294  -c 'import mmap, pathlib; p = pathlib.Path("/tmp/mmap-check"); p.write_bytes(b"DOLLY"); f = p.open("rb"); m = mmap.mmap(f.fileno(), 5, access=mmap.ACCESS_READ); assert m[:] == b"DOLLY"; m.madvise(mmap.MADV_SEQUENTIAL); m.close(); f.close()'295SLOP python \296  -c 'import sysconfig; assert sysconfig.get_platform() == "dolly_0-wasm64"; assert sysconfig.get_config_var("EXT_SUFFIX") == ".cpython-314-dolly_0_wasm64.so"'297SLOP python \298  -c 'import os, subprocess; assert subprocess.check_output(["echo", "spawn-ok"], text=True).strip() == "spawn-ok"; assert subprocess.check_output(["python", "-c", "print(6 * 7)"], text=True).strip() == "42"; child_env = dict(os.environ, DOLLY_CHILD_ENV="explicit"); assert subprocess.check_output(["python", "-c", "import os; print(os.environ[\"DOLLY_CHILD_ENV\"])"] , env=child_env, text=True, timeout=1).strip() == "explicit"'299# Threads run at once: two that wait on each other, a pool's three workers at300# a barrier, and a library and a closure used from a thread they were not made in.301SLOP python \302  -c 'import threading; started, answered = threading.Event(), threading.Event(); worker = threading.Thread(target=lambda: (started.set(), answered.wait(60))); worker.start(); assert started.wait(60); answered.set(); worker.join(60); assert not worker.is_alive()'303SLOP python \304  -c 'import threading; from concurrent.futures import ThreadPoolExecutor; barrier = threading.Barrier(3); pool = ThreadPoolExecutor(3); assert sorted(item.result(60) for item in [pool.submit(barrier.wait, 60) for n in range(3)]) == [0, 1, 2]; pool.shutdown()'305SLOP python \306  -c 'import ctypes, threading; callback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int)(lambda value: value + 1); seen = []; worker = threading.Thread(target=lambda: seen.extend([__import__("dolly_extension_check").answer(), callback(41)])); worker.start(); worker.join(); assert seen == [42, 42]'307SLOP python \308  -c 'import hashlib; assert hashlib.md5(b"abc", usedforsecurity=False).hexdigest() == "900150983cd24fb0d6963f7d28e17f72"'309SLOP python \310  -c 'import ctypes; libc = ctypes.CDLL(None); libc.strlen.argtypes = [ctypes.c_char_p]; libc.strlen.restype = ctypes.c_size_t; assert libc.strlen(b"dolly") == 5; callback_type = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int); callback = callback_type(lambda value: value + 1); assert callback(41) == 42'311SLOP python \312  -c 'import locale, sys; assert sys.flags.utf8_mode == 1; assert locale.getpreferredencoding(False).lower() == "utf-8"; assert sys.getfilesystemencoding().lower() == "utf-8"'313SLOP python \314  -c 'from pathlib import Path; p = Path("/tmp/python-header-check/check.cpp"); p.parent.mkdir(); p.write_text("#include <Python.h>\nint python_header_check = 42;\n", encoding="utf-8")'315SLOP c++ \316  -c \317  -std=c++17 \318  -I/usr/include/python3.14 \319  /tmp/python-header-check/check.cpp \320  -o /tmp/python-header-check/check.o321SLOP python \322  -c 'import os, sys, termios, tty; assert not os.isatty(0); assert sys.stdin.buffer.read(1) == b""'323# A C++ thread_local with a destructor registers it through pthread_key_create324# (SciPy's _uarray), which the thread stubs refused with a fatal error.325SLOP python \326  -c 'from pathlib import Path; p = Path("/tmp/python-tls/tls.cpp"); p.parent.mkdir(); p.write_text("#include <string>\nstatic thread_local std::string name(\"dolly\");\nextern \"C\" int tls_length() { return int(name.size()); }\n", encoding="utf-8")'327SLOP c++ -shared /tmp/python-tls/tls.cpp -o /tmp/python-tls/tls.so328SLOP python -c 'import ctypes; assert ctypes.CDLL("/tmp/python-tls/tls.so").tls_length() == 5'329330FILE /usr/share/licenses/cpython/LICENSE331# The PSF License Agreement asks derivatives to summarize their changes.332FILE /usr/share/licenses/cpython/DOLLY-CHANGES333    Dolly's changes to CPython: cpython-dolly.patch ports posixmodule, getpath,334    faulthandler, subprocess, site, platform, sysconfig, uuid, ctypes.util and335    the pager to sys.platform "dolly", where processes use Dolly's spawn and336    wait and there is no fork. Built-in modules added by Dolly carry HTTP through the337    browser's broker (_dolly_http, _dolly_transport), fail name resolution338    and ssl explicitly, and run libffi over process-local calls. The patched source is339    published beside this image as dist/static/python/cpython.tar.gz.340EXPORTS FOLDER python-stdlib /usr/lib/python3.14341342SLOP rm \343  -rf \344  /tmp/cpython.tar.gz \345  /tmp/mmap-check \346  /tmp/python \347  /tmp/python-header-check \348  /tmp/python-check.txt \349  /usr/lib/python3.14/test \350  /usr/src/python351REQUIRES TOOL python352353# CPython's bundled pip, installed offline without build-time bytecode.354SLOP python \355  /usr/lib/python3.14/ensurepip/_bundled/pip-26.2.1-py3-none-any.whl/pip \356  install \357  --no-compile \358  --no-index \359  --disable-pip-version-check \360  --root-user-action=ignore \361  /usr/lib/python3.14/ensurepip/_bundled/pip-26.2.1-py3-none-any.whl362FOLDER /usr/lib/python3.14/site-packages363EXPORTS TOOL pip364EXPORTS TOOL pip3365366# pip builds what has no wheel for Dolly, which is every native package: a C367# extension with the compiler, a Meson project such as NumPy with Ninja too.368INSTALL /Dollyfile-cc 3c50048026aec1c0c21ac6c0b74d93f53b5c0a3fa83b5c9930d86924a3b59eaa369370# The browser policy decides which indexes are reachable; skip pip's own371# PyPI version check. Dolly has one user, uid 0. sdists build as upstream372# builds its wheels: NumPy's release build takes as long as its debug build373# (141 s, 2026-11-03).374FILE /etc/pip.conf375    [global]376    disable-pip-version-check = true377    root-user-action = ignore378379SLOP python \380  -c 'import urllib.request; assert urllib.request.HTTPHandler.__module__ == "_dolly_transport"'381SLOP pip \382  --version383FILE /usr/share/man/cat1/python3.1384    python3, python, pip: CPython and pip, with the cc package pip builds native385    packages with.386    387      python3 SCRIPT          runs a script; python3 alone, the prompt388      pip install PACKAGE     installs a wheel or builds an sdist389    390    An sdist with C code is compiled by cc. One built with Meson (NumPy,391    Pandas) needs Ninja too: amy install ninja. pip's settings are in392    /etc/pip.conf. urllib.request and requests send through the page's HTTP393    broker and its policy. sys.platform is "dolly"; Emscripten and Pyodide394    wheels do not fit it. Upstream's documentation: https://docs.python.org/3/395