Commit Graph
5 Commits
Author SHA1 Message Date
shenleiandClaude Opus 5 19a9b18554 docs: 目标平台收窄为 macOS arm64 + Android arm64
用户决定:Linux 和 Windows 不做,不验收、不作为任何步骤的阻塞项。

- PORT-PLAN 第 1 节写明范围;2A step 3 的平台列表、2P step 1/2 措辞跟着改;
  2P step 4 由「五个平台分别验证」改为「两个目标平台」,Linux/Windows 两行
  划掉但保留原因备查(上游 2.7 只支持 MSVC + PC/pyconfig.h,mingw 下
  posixmodule.c / dynload_win.c 与 MinGW 头文件冲突)。
- PLATFORMS.md 新增 Scope 段;THIRD-PARTY.md 的 CPython Windows 段由
  "not built yet" 改为 out of scope;PYTHON-EMBED-EVAL.md 下一步两条。
- 仓库里的 mingw-w64 交叉编译只留作可移植性门禁(它抓到过
  UserInterface/StdAfx.h 的真问题),不代表支持 Windows。
- iOS arm64 暂按次要目标记录:保持交叉编译干净,但不作为验收目标。

仅文档改动。port_map.py check 0 error;参考 EterPack.cpp 的 8 个 pack key
值逐个 git grep --cached -w,均未入库。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 09:53:28 +09:00
shenleiandClaude Opus 5 5fad769ee8 port 2P step 1: vendor CPython 2.7.18 as the mtpython static library
The embedded 40250 script layer needs its own interpreter on five platforms.
2.7 is end-of-life, so nothing can be fetched from the target SDKs and the
source is vendored (official 2.7.18 tarball, trimmed to 25MB; Lib/ stays for
step 3's python27.zip).

cpython-2.7.18/CMakeLists.txt builds one `mtpython` static library from exactly
the 133 objects the reference libpython2.7.a contains, off by default behind
-DMTGODOT_EMBED_PYTHON=ON. The source list and the built-in module table
(config/config.c, 39 entries) are shared; pyconfig.h is a probe result and is
not, so each platform keeps its own under config/<platform>/, regenerated by
tools/py_embed/gen_pyconfig.sh and checked against the shared table.

Three vendor patches, documented in docs/THIRD-PARTY.md: configure/configure.ac
learn arm64 on macOS, and posixmodule.c undefines the process-control calls it
hard-defines past pyconfig.h when building for iOS.

macOS (ctest python.embed: every builtin imports, codecs and pickle work off the
vendored Lib/), Android arm64 and iOS arm64 build. Linux needs a Linux host and
Windows needs a MinGW-vs-MSVC decision; both are noted for step 4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 08:27:35 +09:00
shenandshen ae68ec5944 docs(port-plan): close migration prerequisite gaps 2026-09-22 03:01:57 -07:00
shenleiandClaude Opus 5 b02c49bb2f spike(python): CPython 2.7.18 runs the 40250 root scripts on Android arm64
libpython2.7.a cross-builds with NDK 27.2 (API 24) after disabling
HAVE_LANGINFO_H; 30 C modules built in. On a OnePlus 13 (API 36) the
harness runs system.py -> prototype.RunApp() and imports the root modules
with results identical to macOS (66/74; the 8 failures are stub values or
dev-only scripts). py_embed_spike.py now isolates __main__ like
CPythonLauncher and reports stdlib usage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:16:44 +09:00
shenleiandClaude Opus 5 9d0e50de8f docs(parity): mirror 40250 layout for the logic layer; evaluate embedded Python UI
- SKILL.md: logic units port into extension/src/port/<Lib>/<File>, platform
  adapters under extension/src/platform; legacy GDScript owners are migration
  sources; python layer frozen until the embedding decision
- port_map.py: logic/python/platform layers with per-layer progress, queue
  --layer, LEGACY layout check; inventory adds EterBase, EterPythonLib,
  ScriptLib, SpeedTreeLib, SphereLib, EterImageLib
- py_embed_spike.py + docs/PYTHON-EMBED-EVAL.md: the 40250 system.py bootstrap
  loads 67/74 root modules unchanged under CPython 2.7 with stub natives

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:06:32 +09:00