Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .nanvix/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ def _generate_setup_local_cmd() -> str:
f"'_statistics _statisticsmodule.c' "
f"'mmap mmapmodule.c' "
f"'_contextvars _contextvarsmodule.c' "
f"'# Phase 1C: Tier-1 text codecs (pure C, no external deps).' "
f"'unicodedata unicodedata.c' "
f"'_multibytecodec cjkcodecs/multibytecodec.c' "
f"'_codecs_cn cjkcodecs/_codecs_cn.c' "
f"'_codecs_hk cjkcodecs/_codecs_hk.c' "
f"'_codecs_iso2022 cjkcodecs/_codecs_iso2022.c' "
f"'_codecs_jp cjkcodecs/_codecs_jp.c' "
f"'_codecs_kr cjkcodecs/_codecs_kr.c' "
f"'_codecs_tw cjkcodecs/_codecs_tw.c' "
f"> {ws}/Modules/Setup.local"
)

Expand Down
22 changes: 22 additions & 0 deletions .nanvix/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,27 @@ def stage(
" print(f'CPYTHON_TEST_PHASE1A: {_name} loaded via dlopen from "
"{_mod.__file__}')\n"
)
# Phase 1C: Tier-1 text-codec modules (CJK + unicodedata). No
# external deps; resolve against python.elf's .dynsym via dlopen.
phase1c_snippet = (
"_phase1c = [\n"
" ('unicodedata', lambda m: m.lookup('LATIN SMALL LETTER A') == 'a'),\n"
" ('_multibytecodec', lambda m: hasattr(m, '__create_codec')),\n"
" ('_codecs_cn', lambda m: hasattr(m, 'getcodec')),\n"
" ('_codecs_hk', lambda m: hasattr(m, 'getcodec')),\n"
" ('_codecs_iso2022', lambda m: hasattr(m, 'getcodec')),\n"
" ('_codecs_jp', lambda m: hasattr(m, 'getcodec')),\n"
" ('_codecs_kr', lambda m: hasattr(m, 'getcodec')),\n"
" ('_codecs_tw', lambda m: hasattr(m, 'getcodec')),\n"
"]\n"
"for _name, _check in _phase1c:\n"
" _mod = __import__(_name)\n"
" assert _name not in sys.builtin_module_names, "
"f'{_name} still built-in!'\n"
" assert _check(_mod), f'{_name} sanity check failed'\n"
" print(f'CPYTHON_TEST_PHASE1C: {_name} loaded via dlopen from "
"{_mod.__file__}')\n"
)
# Phase 1B: Tier-1 math + memory modules. Same dlopen flow; libm
# symbols are pulled from python.elf via --whole-archive.
phase1b_snippet = (
Expand Down Expand Up @@ -526,6 +547,7 @@ def stage(
+ array_snippet
+ phase1a_snippet
+ phase1b_snippet
+ phase1c_snippet
+ (lxml_snippet if standalone else ""),
)

Expand Down
Loading