Skip to content

Ship full CPython (python3) for a full-featured guest python#7

Merged
lacraig2 merged 1 commit into
mainfrom
feat/python-ctypes
Jun 9, 2026
Merged

Ship full CPython (python3) for a full-featured guest python#7
lacraig2 merged 1 commit into
mainfrom
feat/python-ctypes

Conversation

@lacraig2

@lacraig2 lacraig2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The guest needs a full-featured Python. The micropython→CPython test migration (and real debugging use) needs ctypes (FFI for libc calls / ioctl), plus mmap, fcntl, socket, ssl, sqlite3 — none of which python3Minimal builds.

Switch python.nix from python3Minimal to the full python3.

Verified x86_64: lib-dynload now includes _ctypes, fcntl, mmap, _socket, _ssl, _sqlite3 (77 modules vs 63), the bundle's runtime link-closure check passes (libssl/libsqlite3/libffi/... staged into dylibs), and /igloo/utils/python3 runs them.

CI will confirm the full python3 cross-build across all arches.

The guest needs a full-featured Python: the migrated test suite (and real
debugging use) requires ctypes (FFI for libc calls / ioctl), mmap, fcntl,
socket, ssl, sqlite3 -- none of which python3Minimal builds. Switch to the
full python3 interpreter.

Verified x86_64: lib-dynload now includes _ctypes, fcntl, mmap, _socket,
_ssl, _sqlite3 (77 modules vs 63), and the bundle still passes the runtime
link-closure check (the new libs are staged into dylibs).
lacraig2 added a commit to rehosting/penguin that referenced this pull request Jun 9, 2026
hyperfs (which provided /igloo/utils/micropython) is gone, so the 9 tests
that used it now run on penguin-tools' CPython at /igloo/utils/python3:

- uos -> os; usocket -> socket
- ffilib/uctypes mmap -> the CPython `mmap` module (native_mmap, devfs
  mmap_custom, pseudofile_mmap_{shared,private,rw})
- ffilib open/ioctl -> os.open + fcntl.ioctl (pseudofiles_comprehensive)
- ffi libc/lib_inject calls -> ctypes (uprobes, proc_mtd_dynamic)

Requires the full CPython (ctypes/mmap/fcntl/socket), so bump
PENGUIN_TOOLS_VERSION to 0.0.6 (rehosting/penguin-tools#7).
@lacraig2 lacraig2 merged commit 0689382 into main Jun 9, 2026
1 check passed
@lacraig2 lacraig2 deleted the feat/python-ctypes branch June 9, 2026 03:50
lacraig2 added a commit to rehosting/penguin that referenced this pull request Jun 9, 2026
hyperfs (which provided /igloo/utils/micropython) is gone, so the 9 tests
that used it now run on penguin-tools' CPython at /igloo/utils/python3:

- uos -> os; usocket -> socket
- ffilib/uctypes mmap -> the CPython `mmap` module (native_mmap, devfs
  mmap_custom, pseudofile_mmap_{shared,private,rw})
- ffilib open/ioctl -> os.open + fcntl.ioctl (pseudofiles_comprehensive)
- ffi libc/lib_inject calls -> ctypes (uprobes, proc_mtd_dynamic)

Requires the full CPython (ctypes/mmap/fcntl/socket), so bump
PENGUIN_TOOLS_VERSION to 0.0.6 (rehosting/penguin-tools#7).
lacraig2 added a commit to rehosting/penguin that referenced this pull request Jun 9, 2026
hyperfs (which provided /igloo/utils/micropython) is gone, so the 9 tests
that used it now run on penguin-tools' CPython at /igloo/utils/python3:

- uos -> os; usocket -> socket
- ffilib/uctypes mmap -> the CPython `mmap` module (native_mmap, devfs
  mmap_custom, pseudofile_mmap_{shared,private,rw})
- ffilib open/ioctl -> os.open + fcntl.ioctl (pseudofiles_comprehensive)
- ffi libc/lib_inject calls -> ctypes (uprobes, proc_mtd_dynamic)

Requires the full CPython (ctypes/mmap/fcntl/socket), so bump
PENGUIN_TOOLS_VERSION to 0.0.6 (rehosting/penguin-tools#7).
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.

1 participant