@ai-ecoverse/wasix-python
v3.15.2-1
Published
The Python 3.15 programming language, with pip.
Readme
@ai-ecoverse/wasix-python
CPython 3.15 for slicc WASIX (commands python / python3).
Since 3.15.2-1
- CPython 3.15.2, with bundled
pip26.2.2. The ABI stayscp315. multiprocessingstill starts withspawn. 3.15.2 chooses the default start method on first use; on WASIX it staysspawnin both builds, and the build without fork still offers onlyspawn.venvfinds its home the same way. 3.15.2's getpath also searches from the resolved base executable;cert/venv.mjsandcert/isolated.mjscover it.- The py-* take every 3.15 patch release (homescoop#1939). Since their series re-pin, each py-* takes wasix-python as the series range
>=3.15.0-1 <3.15.1 || >=3.15.1-1 <3.15.2 || … || >=3.15.29-1 <3.15.30, so npm and pnpm install one python for all of them, this one, and a later 3.15.N needs no new py-*. A published py-* from before the re-pin (>=3.15.0-1 <3.15.1) still nests its own 3.15.0 python under this one, and discovery refuses it, so update it. CPython keeps the ABI within 3.15 (3.15.2 changes no struct layout and removes no exported symbol), and every wasix-python release is certified with the published py-* installed by their ranges. A range up to the next minor wouldn't do: our versions are semver prereleases, and npm matches 3.15.2-1 only against a range that names a 3.15.2 prerelease. - Discovery still wants the same python.
_slicc_siteputs a py-* onsys.pathonly if the wasix-python it resolves to is this exact version, as before. A py-* whose python can't be resolved at all is accepted when its declared range holds this python, which now includes the series range. Under pnpm'spnpm add -g, where every package is its own project with its own copy of python, a py-* project installed before a python update keeps the older copy and is refused untilpnpm update -gmoves it. - mimalloc 2.5.2, from 2.1.2, comes with 3.15.2. It is built in, but python allocates with the libc's malloc (
WITH_PYMALLOC=0, noPYTHONMALLOC=mimalloc);cert/heap-size.mjsandcert/heap-threads.mjscover the heap as before.
Since 3.15.0-10
- pip knows the native-crypto packages.
pip installof cffi, cryptography, PyNaCl or bcrypt stops at once when they aren't installed, with the package to add:pnpm add -g @ai-ecoverse/py-cryptography(orpy-cffi,py-pynacl,py-bcrypt). It doesn't try to build them from an sdist, which needs a C compiler or Rust and fails slowly. Once they're installed, pip treats them as already satisfied, sopip installof a package that requires them (msal, paramiko, azure-identity) installs the rest of what it needs. - The hint for packages outside Python data tools no longer mentions matplotlib. Before, every package outside the
pydatacatalog got "which pulls these in via matplotlib". That's now only for pillow, contourpy and kiwisolver. - The PyPI→homescoop map that pip and uv share is now
scripts/homescoop-pydata-map.jsonin the homescoop repo (homescoop#2119).
Since 3.15.0-9
- Serial ports work with pyserial (wasix-sysroot 2025.9.30-44, slicc-kernel ≥ 1.183.0). A serial port the page grants shows up as
/dev/ttyUSB0or/dev/ttyACM0.pip install pyserial, thenserial.Serial('/dev/ttyUSB0', 115200)reads and writes it.dtr,rts,cts,dsr,cd,ri,in_waiting,out_waiting,send_break(),break_condition,reset_input_buffer(),reset_output_buffer(),flush(), the standard baud rates, byte size, parity and stop bits all reach the port, andselectworks on it. Before, the libc answered EINVAL to the modem-line, break and queue ioctls, sos.dtr = FalseraisedOSError: [Errno 28].termiosandfcntl.ioctlreach the same calls with Linux's request numbers (TIOCMGET0x5415,TCGETS20x802C542A withBOTHERfor a custom speed).sys.platformiswasi, so pyserial's own custom-speed path, which is Linux-only, refuses non-standard rates;fcntl.ioctl(fd, TCSETS2, …)sets one. Opening a port for writing needs root (sudo) when the node isroot:dialout 0640. - esptool: its serial calls work: the DTR/RTS resets into the ROM bootloader (the classic and the
TIOCMSETtight one), the SLIP exchange and the baud change (cert/serial/serial.mjs, against a fake ROM loader).pip install esptooldoesn't: esptool 4.x and 5.x requirecryptography, which has no WASIX wheel. - Rebuilt on wasix-sysroot -44, from -40. That also brings -41's relative paths through the cwd descriptor, -42's and -43's
/etc/hostname, and -43'sgetcwdtermination.
Since 3.15.0-8
pipfails fast on homescoop-native packages.pip install/pip3 install/python -m pip installof numpy, scipy, pandas, matplotlib, pillow, contourpy or kiwisolver exits at once with a hint to install Python data tools (pydata/slicc-py-datatools) from seven's Install/Update, orpnpm add -g @ai-ecoverse/py-…, but only when that distribution is not already installed. Once pydata is present, those names are already satisfied and dependents (e.g.pip install formulas) resolve normally. PyPI has nowasm32-wasixwheels for those; without the guard pip tried an sdist build that looked hung. Pure-Python packages from PyPI still work (pip install six). PyPI keys matchscripts/homescoop-pydata-map.json(shared with wasi-uv); the runtime table is_slicc_pip.py, armed from_slicc_site.fix()(cert/pip-guard.mjs).
Since 3.15.0-7
- Time zones by name. With the zone files at
/usr/share/zoneinfo(seven links it to@ai-ecoverse/tzdata, the IANA database),TZ=Europe/Berlingives CET/CEST intime.localtime(),datetime.now().astimezone()andtime.strftime('%Z %z'), and withTZunset python reads/etc/localtime. Without the files a zone name is UTC, as before;TZ=:/path/to/Europe/Berlintakes any file. Only this README changed: the binaries are 3.15.0-6's (a packaging-only release).
Since 3.15.0-6
- Under
-Iand-E, a caller's environment no longer picks python's home (homescoop#1572). In 3.15.0-5, a caller could setSLICC_PYTHONHOME=/somewhere python3 -I, and python loaded its standard library from/somewhere. Now nothing in the environment chooses the home under-I/-E. The slicc command passes the home in its own argv: every command (python,python3,pip,pip3) starts python aspython3 -X slicc_home=<this package>/ …(package.jsonargs). A caller can override the command'senv, but not that argv prefix.SLICC_PYTHONHOMEis gone. You can see the prefix insys.orig_argvandsys._xoptions, andsubprocesspasses it on to child pythons, which is harmless. Without-I/-E,PYTHONHOMEworks as before. - Under
-I/-E, nothing in a caller's environment or current directory picks a venv or a._pthhome. slicc starts python, a#!/usr/bin/python3 -Iscript included, with onlypython3asargv[0]. So getpath looked for the executable onPATH, tookPYTHONEXECUTABLEor__PYVENV_LAUNCHER__as the executable, and without an executable searched the current directory and its parent for apyvenv.cfg. Each of these let a caller make some directory the venv and run its.pthfiles, or name apython3._pththat replaced the home. Under-I/-E, python now ignoresPATH,PYTHONEXECUTABLEand__PYVENV_LAUNCHER__, takes the executable only from an absoluteargv[0], never looks for apyvenv.cfgin the current directory, and lets no._pthreplace the command's home. A venv's ownbin/python -Istill runs in the venv, since slicc gives it its absolute path asargv[0]. - Under
-I/-E, the py-* discovery cache ignoresXDG_CACHE_HOMEandHOME. It lives in~/.cache/slicc-site/of the user's passwd home instead, so a caller can't hand python a cache that adds directories tosys.path. The same goes forsys.executablewhen python has to find it itself:/usr/binand/bin, notPATH. - The memory numbers are corrected (homescoop#1573). See Memory.
Since 3.15.0-5
python3 -Iand-Eignore a caller'sPYTHONHOME(homescoop#1504), as stock CPython does. In 3.15.0-4,PYTHONHOME=/somewhere python3 -Iloaded its standard library,encodingsincluded, from/somewhere. 3.15.0-5 took the home fromSLICC_PYTHONHOMEunder-I/-Einstead, but a caller could set that too (homescoop#1572, fixed in -6).- A larger initial memory: 160 MiB, was 40 MiB (homescoop#1287). See Memory.
- Built on wasix-sysroot 2025.9.30-40 (3.15.0-4: -39), whose
mallocuses the initial memory. -40 changes no libc++/libc++abi/libunwind file, so the published py-* side modules (ranges>=3.15.0-1 <3.15.1) load as before.
Memory
bin/python.wasm and bin/python-fork.wasm start with 160 MiB of shared memory and can grow to 4 GiB, the wasm32 limit (recipe.yaml wasm:).
- Why 160 MiB: after importing numpy, pandas, scipy and matplotlib, python uses about 81 MiB of the 160 MiB: its data, its 16 MiB stack and the heap (measured with
sbrk(0)in the importing thread on 3.15.0-5: 79 MiB more of 1 MiB buffers fit before the memory grows). So the heap of a typical session stays in the initial memory with about twice the room it needs. That matters for threads: a thread can trap while another thread grows the memory (slicc-kernel#1172). - The imports still grow the memory, by the side modules' data. slicc-kernel's loader gives each side module (every
.sothatdlopenloads, 114 of them for these four packages) its data by growing the memory past its current size. No initial size avoids that: a larger one only moves the side modules up. These imports grow the memory from 160 MiB to about 170.5 MiB, exactly the 10.5 MiB of the side modules' data. 3.15.0-5's README said they took the memory to about 116 MiB and fit without growing it, which was wrong (homescoop#1573).cert/heap-size.mjschecks that the growth during the imports is no more than the side modules' data and that at least 48 MiB of buffers still fit afterwards. If the loader ever places side modules in the heap, the same check holds. - Since -40, malloc uses those pages. Up to wasix-sysroot -39, dlmalloc ignored the pages between the heap base and the initial size and grew the memory for every allocation, so a larger initial memory only cost space.
cert/heap-size.mjschecks that 48 MiB of allocations right after start don't grow the memory. - Peak: a numpy/pandas/scipy/matplotlib workload peaked at about 3,700 MiB. That fits under the 4 GiB maximum, but leaves little room, so very large arrays can fail with
MemoryError. - Cost: every python process, including each
multiprocessingworker and eachsubprocesspython, reserves 160 MiB up front. On most hosts a page takes real memory only once it is touched.
Since 3.15.0-4
python3 -Iand-Ework (homescoop#1144). They used to stop withNo module named 'encodings': they ignorePYTHONHOME, which the slicc command sets to this package, and nothing else could find the standard library. Python still ignoresPYTHONPATHand the other variables under-E/-I.venv.create(dir)andpython -m venv --copiesmake a venv that runs (homescoop#1269). A copiedbin/pythoncan't find the standard library here: slicc starts a bare copy ofpython.wasmwithout the command's environment and with only its name asargv[0]. On WASI, venv now always symlinks the interpreter, aspython -m venvalready did by default.- Threads that fill or copy freshly allocated memory no longer risk
memory access out of boundswhile the heap grows (homescoop#1287, wasix-sysroot 2025.9.30-39). mprotectis exported (it reports ENOSYS: wasm memory has no page protection), so py-matplotlib'sft2fontresolves every import.- The bytes don't depend on the build machine (homescoop#1310):
.pycrecord the install path and the build root is fixed.
Since 3.15.0-3
latest, the Python 3.15 flip (homescoop#761). The cp314 line (3.14.2-29 and earlier) stays on npm by exact version; its C-extension py-* don't load on 3.15. See the release notes.
Since 3.15.0-2
Needs slicc-kernel ≥ 1.122.3 (engines; it was ≥ 1.120.0). Older kernels could leave a sqlite -journal behind and wedge a shared sqlite database (homescoop#1152, fixed in slicc-kernel 1.122.3). The cert runs with kernel users enforced (homescoop#819).
Since 3.15.0-1
A new ABI since CPython 3.15.0 (homescoop#761). SOABI cpython-315-wasm32-wasix, the stdlib and site-packages under lib/python3.15, bytecode tag cpython-315, package.json slicc.python abi cp315.
- The py-* built before 3.15 don't load. Their extension modules are
cpython-314-wasm32-wasix.soand theirslicc.python.requires.abiiscp314, so_slicc_site.discover()leaves them offsys.path(python -vnames each one) andimport numpyraisesModuleNotFoundError. That covers py-numpy, py-pandas, py-scipy, py-matplotlib, py-contourpy, py-kiwisolver and py-pillow until they're rebuilt for 3.15. The pure-Python py-* load, except those that, until their next release, depend on wasix-python<3.14.3: npm or pnpm gives them their own older python, nested beside this one, and discovery refuses them as built for another python. - UTF-8 mode is the default (PEP 686):
open()without an encoding and the filesystem encoding are UTF-8 whatever the locale;-X utf8=0orPYTHONUTF8=0turns it off. - Every CPython patch in
patches/is regenerated against 3.15.0; none is dropped, since 3.15 has none of the fixes. Bundledpip26.2.1. - Built on wasix-sysroot 2025.9.30-38 (3.14.2-28: -34): -37's Linux
S_IF*file-type bits and -38'spoll, which degrades cleanly on kernels before 1.125.0, soenginesstays slicc-kernel ≥ 1.120.0. - Everything of 3.14.2-28 carries over: both binaries (
PYTHON_FORK=true), engines slicc-kernel ≥ 1.120.0, realfcntl/lockf/flocklocks, sqlite'sunixVFS, multiprocessing via spawn,Manager.
Since 3.14.2-28
Needs slicc-kernel ≥ 1.120.0 (engines; it was ≥ 1.100.0). Since -26, os.mkfifo exists (wasix-sysroot -34's libc) and fcntl.flock is real, but on older kernels they answer ENOSYS or fall back to a whole-file lock (homescoop#1018).
Features
- PIE dynamic-main (
dylink.0) on wasix-sysroot 2025.9.30-44'ssysroot-ehpic(-40 in 3.15.0-5 to -8, -38 in 3.15.0-1 to -3, -39 in -4, -34 up to 3.14.2-28) (legacy wasm EH), SOABIcpython-315-wasm32-wasix(3.14.2-N:cpython-314-wasm32-wasix); native side modules (py-numpy, py-scipy, py-pandas, …) load bydlopen - File modes (3.14.2-12, on slicc-kernel ≥ 1.35.1; older kernels keep the no-op modes):
os.umask,open()/os.mkdircreate modes,os.chmod,tempfile.mkstemp600 /mkdtemp700, pip console scripts 755 - Built in:
ssl/hashlib(OpenSSL 3.5.9,@ai-ecoverse/wasix-openssl),zlib1.3.1,bz2,lzma(xz 5.8.4),sqlite3(3.54.0; FTS5, JSON, math, R*Tree; no WAL, no extensions),readline8.3 (ncurses 6.5 terminfo compiled in: xterm, screen, tmux, vt100, linux),ctypes/_ctypes(wasix-org/libffi; needs slicc-kernel#306 step 1 forcall_dynamic+closure_{allocate,free}),mmap,fcntl,termios,resource,pwd,grp,select - Two binaries (since 3.14.2-25): the default has no
fork/vfork;PYTHON_FORK=trueselects the fork-capable one (below).subprocessusesos.posix_spawn(proc_spawn2/3) in both os.getuid()/getgid()/getgroups()andpwd/grpcome from slicc-kernel's process credentials and its/etc/passwd//etc/group(3.14.2-13, wasix-sysroot -20; slicc-kernel ≥ 1.44.0, no fallback: ids are -1 on older kernels). Root is uid 0 with home/root.- Record locks (
fcntlF_SETLK*,lockf) go through slicc-kernel (since -21, below). Since 3.14.2-26fcntl.flockis real: per open file description, on any descriptor (slicc.flock, slicc-kernel ≥ 1.117.0). On older kernels it's a whole-file record lock, and up to -25 it was a no-op. - stdout is line-buffered unless it is a regular file, so output streams and survives crashes
signal.alarm/setitimerandtime.sleepresuming after a signal (the sysroot's libc patches,patches/)- Bundled
pip(26.2.2 since 3.15.2-1, 26.2.1 in 3.15.0-N);.pycare unchecked-hash - Not built:
_uuid,curses,dbm,_zstd,tkinter TZworks: POSIX rules (EST5EDT,M3.2.0,M11.1.0; wasix-sysroot -18, homescoop#193), and zone names (TZ=Europe/Berlin, which slicc-kernel ≥ 1.174.2 sets) once/usr/share/zoneinfohas the zone files: seven links it to@ai-ecoverse/tzdata.time.localtime(),datetime.now().astimezone()andstrftime('%Z')follow it, andzoneinforeads the same tree (/usr/share/zoneinfois onzoneinfo.TZPATH), or thepy-tzdatapackage where it's installed
Since 3.14.2-12 the package is cross-built from source in CI (build.sh); see THIRD-PARTY-NOTICES.md for the statically linked libraries.
Since 3.14.2-25 (wasix-sysroot -32):
- Two binaries, one package (homescoop#357).
bin/python.wasmis the default build, without fork, at full speed.bin/python-fork.wasmhasos.fork(HAVE_FORK, fully asyncified). Thepython,python3,pipandpip3commands pick it when the process environment hasPYTHON_FORK=true(slicc.commandsvariants, slicc-kernel#859). The kernel loads only the chosen wasm, and children inherit the choice through the environment, also when they execsys.executable. Kernels before #859 (1.110.0) ignorevariantsand always run the default.- In the default binary,
os.fork(),os.forkpty()andmultiprocessing.get_context("fork")/("forkserver")fail with an error that names the switch: os.fork() isn't available in this python. Re-run with PYTHON_FORK=true (needs slicc-kernel >= 1.110.0) to use the fork-capable build. On an older kernelPYTHON_FORK=truestill runs this default binary, so the message names the kernel too.hasattr(os, "fork")staysFalse. - In the fork binary,
os.fork,os.waitpid, threads in a forked child, andget_context("fork")Pool/Queue/Lockwork. The full asyncify makes it larger and slower (about +60% size, +35-60% interpreter time). spawnstays the default start method in both. Shared ctypes still can't be shared across processes, since a fork copies memory.
- In the default binary,
- From the sysroot:
signal.sigwait,sigwaitinfoandsigtimedwaitwork on slicc-kernel ≥ 1.106.2 (homescoop#520), andselect.epollmasks are atomic there. A signal inherited as ignored (nohup,trap '') reads asSIG_IGNfromsignal.getsignalon slicc-kernel ≥ 1.108.0 (homescoop#740). - Kernel conditions. -24's lift of the 256-named-semaphore limit holds
only on slicc-kernel ≥ 1.102.2 (#770/#773). On 1.100.x a process still
stops at about 250 (homescoop#698). The
enginesfloor (≥ 1.122.3 since 3.15.0-2, ≥ 1.120.0 since 3.14.2-28, ≥ 1.100.0 before) is enforced from slicc-kernel 1.106.2 on (slicc-kernel#797/#806): those kernels refuse the commands on an older kernel. Kernels before 1.106.2 install the package without a warning, and therefcntllocks aren't real below 1.100.0 (homescoop#651).
Since 3.14.2-24 (wasix-sysroot -31):
multiprocessing.Manager()works:dict,list,Queue,Namespace,Valueand the other managed objects, also passed to spawned children, over an AF_UNIX socket. Up to -23 the first proxy call raisedTypeError: str, bytes or bytearray expected, not int: WASIX's libc returned family 0 and no path fromgetsockname,getpeernameandacceptfor every AF_UNIX socket (homescoop#515).socket.getsockname()of a bound AF_UNIX socket now gives its path, and an unbound one''.- A Manager is what the -23 error for shared ctypes recommends, so that
advice holds now (homescoop#669). The error also names
Barrier, which keeps its state in shared memory too. - From the sysroot:
select.pollreportsPOLLHUPfor a registered fd with no events whose peer closed, andPOLLERRfor a pipe write end whose reader is gone; a process is no longer limited to 256 named semaphores (on slicc-kernel ≥ 1.102.2; see -25).
Since 3.14.2-23:
multiprocessing.connection'sListeneron an AF_UNIX path closes cleanly on every kernel. slicc-kernel before 1.103.1 keeps socket paths out of the filesystem (slicc-kernel#753), so the path it unlinks at close was already gone, and up to -22close()raisedFileNotFoundErrorthere.multiprocessing.Manager()also needs WASIX's libc to return AF_UNIX addresses fromgetsockname, which comes with wasix-sysroot -31 in the next release (homescoop#515).threading.get_native_id()andThread.native_idexist (WASIX's thread id; homescoop#587). Up to -22 they were missing orNone, andscipy.fft.set_backend/skip_backendraisedAttributeError.- Shared memory fails loudly instead of silently (homescoop#516).
Processes share no memory here, so nothing written into an
mp.Value,mp.Array(with or without a lock) orSharedMemoryever reached another process, and up to -22 nothing said so.- Passing a
Value,Arrayor other shared ctypes object to a child (Processarguments,Poolinitargs) now raisesNotImplementedErroratstart(), naming a Queue, a Pipe or a Manager as the alternatives. Inside one process (threads) they work as before. multiprocessing.shared_memoryraisesImportErroron import, as on upstream WASI builds, andmultiprocessing.managers.HAS_SHMEMisFalse.multiprocessing.get_all_start_methods()is['spawn'], andget_context("fork")/("forkserver")raiseValueError. Up to -22 they listedforkandforkserver, and a forkProcessfailed atstart()withAttributeError(noos.fork, homescoop#357).
- Passing a
Since 3.14.2-22 the sqlite3 module uses SQLite's unix VFS, with fcntl
locks, instead of SQLITE_WASI's default unix-dotfile, whose .lock
directory no other program saw. Python and the sqlite3 CLI (or another
program) now lock each other out on the same database. Up to -21, a CLI write
during a python transaction went through, and python's commit then failed
with disk I/O error.
-22 needs slicc-kernel ≥ 1.100.0 (engines; it was ≥ 1.51.0). Its
fcntl locks only reach other processes through slicc-kernel's
slicc.fcntl_lock (1.100.0, #722). On an older kernel the libc grants every
lock locally, so two python processes writing one database could lose a row
(homescoop#567); -21's .lock directory had kept them apart.
Since 3.14.2-21 (wasix-sysroot -30):
multiprocessingworks with thespawnstart method (the default):Pool,Queue,Lock,Semaphoreand the other synchronisation primitives, across processes. Its named semaphores are kept by slicc-kernel (≥ 1.99.0).shared_memoryand shared ctypes (Value/Array, whatever theirlock) aren't shared between processes, because processes don't share memory (an error since -23). The default binary has noforkstart method (noos.fork).PYTHON_FORK=trueselects the fork-capable binary, which has fork and forkserver (since -25, above). Neither binary hasos.forkpty/os.openpty: WASIX has no ptys.fcntl.lockf/fcntl.fcntlrecord locks andos.lockfgo through the libc to slicc-kernel (slicc-kernel#722) and hold against other processes, such as a second python or the sqlite3 CLI on the same database. On an older kernel every lock is granted locally, as before.fcntl.flockis still a no-op.
Since 3.14.2-20 (wasix-sysroot -29):
select.polltakes a file descriptor registered with no events. Up to -19 the call failed with ENOSYS.select.epollerrors are real: a secondregisteris EEXIST and anunregisterof an unregistered fd is ENOENT. Up to -19 both succeeded silently. asyncio usesEpollSelectoron slicc-kernel ≥ 1.95.0 (WASIX epoll) andPollSelectoron older kernels.multiprocessinghad no_multiprocessing(fixed in -21).
Since 3.14.2-19 (wasix-sysroot -28):
- signal masks are real:
signal.pthread_sigmaskblocks and unblocks through slicc-kernel (≥ 1.88.0), a blocked signal stays pending (signal.sigpending()) without running its handler or interruptingtime.sleep, and its handler runs once when it is unblocked. Up to 3.14.2-18pthread_sigmaskraisedOSError(0, 'Error'). Kernels before 1.88.0 take wasix-sysroot -28's ENOSYS fallback (its README).signal.sigtimedwait/sigwaitinfo/sigwaitraise ENOSYS (slicc-kernel#520); sqlite3(3.54.0 since this release, 3.53.4 before) keeps its compile options;PRAGMA compile_optionsaddsMAX_SCHEMA=10000000;THIRD-PARTY-NOTICES.mdcarries the licence text of every statically linked component (see the license paragraph below).
Since 3.14.2-18:
ctypes.CDLL(None)has nofork(nor_Fork,__wasi_proc_fork, …): python.wasm no longer exports them (homescoop#296). In 3.14.2-17 callingctypes.CDLL(None).fork()crashed the interpreter (a wasm trap): fork needs Asyncify on every frame between it andmain, and ctypes' frames have none.os.forkstays absent;subprocess,os.posix_spawnandos.systemwork as before.
Since 3.14.2-17 (wasix-sysroot -27):
os.utime(path),pathlib.Path.touch()and everything else that sets a file's times to "now" set them to now; up to 3.14.2-16 they set them to 0 (1970) (wasix-sysroot's brokenutimensat(NULL), homescoop#294).os.times(),resource.getrusage(RUSAGE_SELF)andtime.clock-style callers report the process CPU time slicc-kernel keeps; system and children's times are 0. Up to -16 they held wall-clock values.- An empty path is
FileNotFoundError(os.stat(""),open("")), as on Linux; files have owners on slicc-kernel ≥ 1.59.0 with users on (os.chown,os.stat().st_uid), andos.accessasks the kernel (≥ 1.63.0). - A system site directory every user shares:
/usr/local/lib/python3.X/site-packages(this python's 3.X) is added (withsite.addsitedir, so its.pthfiles run) after python's own site-packages and the py-* packages it finds, when it exists. An embedder can drop a.pththere once for every user. A virtual environment sees it only with--system-site-packages, as on Linux. - The py-* discovery cache is per user:
${XDG_CACHE_HOME:-~/.cache}/slicc-site/, never in the package directory (which other users cannot write); without a home or a writable cache directory there is no cache. pipandpip3are commands (python3 -m pip);pip install --userinstalls into the user's own site-packages. Native pydata packages (numpy, scipy, pandas, matplotlib, pillow, contourpy, kiwisolver) are refused with a catalog hint (_slicc_pip.py, since 3.15.0-8).python -m venvtakes about half as long: ensurepip runs the package's own compiled pip instead of pip from the zipped wheel.
Since 3.14.2-16 (wasix-sysroot -22: the slicc.libc marker, no exported
itimer helper):
- ctypes calls variadic C functions (
printf,snprintf,sscanf,open(path, flags, mode),fcntl,ioctl, …): our libffi passes the variadic arguments the way the wasm32 C ABI does (patches/libffi-wasix-varargs.patch). As on Apple arm64, setargtypesto the fixed parameters (e.g.[c_char_p]forprintf) and pass the rest as typed ctypes values (c_int,c_double, …); withoutargtypesevery argument is taken as fixed, which is wrong for a variadic function on wasm32. Passc_doublefor%f: ctypes does not promote, and a variadicc_floatraisesRuntimeError: ffi_prep_cif_var failed(libffi rejects it, as on every platform). 3.14.2-15 could not call them at all ("ffi_prep_cif_var failed"). - Signals during blocking calls follow PEP 475 on slicc-kernel ≥ 1.53.3, which
answers -22-marked programs with EINTR: a signal whose handler returns does
not shorten
time.sleep/select/poll, and ^C raisesKeyboardInterruptat once (cert/signals.mjs).
Since 3.14.2-15:
ctypes/_ctypes(wasix-org/libffi) — needs slicc-kernel ≥ 1.51.0 (#306 / #316:call_dynamic,closure_{allocate,prepare,free}, POSIXdlopen(NULL)/ own path / symlink = running main). On 1.49.0,import ctypesraisesOSError(notImportError), so numpy fails — seecert/NEGATIVE.md.cert/sidemods.mjs(no PYTHONPATH; discovery) gates the py-* re-pin wave. Catalog move to -15 rides with the kernel bump (engines are advisory).- py- packages are found without
PYTHONPATH.* A package that declaresslicc.python.sitePackagesin itspackage.json(py-numpy, py-pandas, …) is put onsys.pathwhen it is installed in python's own project (npm'snode_modules, or pnpm's, including its.pnpmstore: a localpnpm add) or, for pnpm ≥ 11 global installs (pnpm add -g, one project per package under$PNPM_HOME/global/v<N>/), in a sibling global project. It is taken only if itsslicc.python.requiresabi/platform match (none: pure Python), and if thewasix-pythonit resolves to (Node's lookup from its real directory) is this python's exact version, so side modules never mix interpreter builds; the first package of a name wins.python -vreports what was skipped and why. The scan is cached per user in${XDG_CACHE_HOME:-~/.cache}/slicc-site/(since 3.14.2-17; keyed on the package directories and theirpackage.jsonstamps;-valways rescans); with the cache, a start costs about 2 ms more than with discovery off, and less than the same directories onPYTHONPATH. As withPYTHONPATH,.pthfiles in those directories are not run. It runs fromsite-packages/slicc-executable.pth, so a venv sees py-* packages only with--system-site-packages;SLICC_PYTHON_DISCOVER=0turns it off. A py-* built for another wasix-python (an exact pin with its own nested copy, e.g. py-numpy 2.3.2-7 for 3.14.2-13) is refused until it is re-pinned;python -vnames it.
Since 3.14.2-14 (wasix-sysroot -21):
asynciosubprocess pipes work:os.fstatgives a pipe its kernel type,S_ISFIFOon slicc-kernel with pipe types (#307) and a socket on 1.47.3-1.48.x, either of which asyncio's pipe transports accept;termios/tty.setrawreally switch the terminal to raw mode (^C arrives as a byte), andos.get_terminal_sizeandisattyanswer per descriptor (slicc-kernel ≥ 1.48.0; older kernels keep the previous behaviour).
The license is PSF-2.0 AND GPL-3.0-or-later, because GNU Readline
(GPL-3.0-or-later) is linked statically: bin/python.wasm as a whole is a
combined work distributed under the GPL-3.0-or-later. CPython's PSF-2.0 and
the other linked components' licences are GPL-compatible. If you redistribute
python.wasm, or an application that bundles it, the GPL-3.0's terms apply to
it: redistributors pass on the Corresponding Source, which is the homescoop
repository at the release's commit plus the sha256-pinned upstream archives
its recipe lists; homescoop keeps those available. Since 3.14.2-19,
THIRD-PARTY-NOTICES.md has every linked component's licence text, not just a
table. Since 3.14.2-13, time.tzset() exists and honours POSIX TZ rules.
The sysconfig records (_sysconfigdata*, _sysconfig_vars*.json) carry no
build-machine paths, host compilers or private stub archives.
Side modules: C++ runtime ABI
Native extensions are dylink.0 side modules that import the C++ runtime from
python.wasm: libc++, libc++abi and libunwind of the pinned
wasix-sysroot's sysroot-ehpic (legacy wasm EH, PIC), 2025.9.30-38 since
3.15.0-1. Up to 3.14.2-28 they came from upstream wasix-libc v2026-07-03.1's
sysroot-ehpic. Both sets define the same globals (llvm 6bb93a24, identical
include/c++), so side modules built against either load into either. That
ABI has:
_Unwind_CallPersonality(void *)and the personality__gxx_personality_wasm0;- a plain global
__wasm_lpad_context(imported throughGOT.mem); __cxa_thread_atexit.
build.sh checks all three in the sysroot's archives before linking. Build C++
side modules against that runtime: wasixcc with WASIXCC_WASM_EXCEPTIONS=legacy,
WASIXCC_PIC=yes, and the sysroot's sysroot-ehpic/include/c++/v1 headers.
A runtime where __gxx_wasm_personality_v0(void *) replaces
_Unwind_CallPersonality and __wasm_lpad_context is thread_local (as
in some earlier wasix-sysroot rebuilds) gives modules that don't load
into this python.wasm, and the reverse corrupts memory on the first C++
exception. test/side-abi.mjs checks every published py-* side module's
imports against python.wasm at build. It fails if one is missing, or if a
GOT.mem import resolves to thread_local data the side modules were not
built for.
Acceptance (Wasmer / SLICC)
python -c "import mmap; print('mmap ok')"
python -m pip install --prefix <dir> six # SLICC: HTTPS via realm proxy + SSL_CERT_FILE
PYTHONPATH=<dir>/lib/python3.15/site-packages python -c "import six"On plain Wasmer without _ssl, use a local wheel (--no-index --find-links) until openssl/_ssl is enabled.
Virtual environments (slicc-kernel ≥ 1.29.0)
python -m venv v && v/bin/pip install requests && v/bin/python -c "import requests"Venvs need slicc-kernel ≥ 1.29.0 (engines asks for ≥ 1.100.0 since -22, for sqlite's locks; ≥ 1.51.0 before, for _ctypes). On older kernels a
venv's bin/python and bin/pip run as the base interpreter: v/bin/pip
install then installs into the base package directory, not the venv.
CPython cannot find its own executable here (WASI stat() has no permission
bits, so its PATH search never matches), so _slicc_site.py sets
sys.executable from PATH. Two hooks run it:
site-packages/slicc-executable.pth for the base interpreter (a
sitecustomize of yours on PYTHONPATH cannot switch it off) and the stdlib
sitecustomize.py for venvs without system site-packages. A sitecustomize
of your own still runs after ours, and import sitecustomize returns yours.
python and python3 set "argv0Path": true, so slicc-kernel ≥ 1.29.0
(#168) passes a venv's bin/python path as argv[0]; that is how CPython
finds the venv's pyvenv.cfg:
| | slicc-kernel < 1.29.0 | slicc-kernel ≥ 1.29.0 |
| --- | --- | --- |
| v/bin/python, v/bin/pip, venv console scripts | run as the base interpreter (install into, and import from, the base) | run in the venv |
| source v/bin/activate; python … | base interpreter | in the venv |
| uv run … (@ai-ecoverse/wasix-uv-shim) | in the venv | in the venv |
sitecustomize.py, _slicc_site.py and site-packages/slicc-executable.pth
are the slicc additions (stdlib/ in the recipe).
