docs(port-plan): close migration prerequisite gaps
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
|
||||
### 方案 A 的平台问题
|
||||
|
||||
- macOS / Linux / Windows:直接编译,无风险。
|
||||
- macOS / Linux / Windows:都需要各自编译和验证;Windows 使用 `PCbuild`/`PC/pyconfig.h`,不走 Unix configure。
|
||||
- Android(arm64,NDK 27):CPython 2.7 能用 NDK 编译(python-for-android、Kivy 曾长期支持),但需要补丁:
|
||||
关闭 `dlopen` 扩展、把用到的标准库 C 模块静态编进去、`pyconfig.h` 按 NDK 调整。
|
||||
- iOS:同样静态链接(Kivy-ios 曾支持 2.7)。App Store 允许包内自带的解释型代码(不下载代码即可)。
|
||||
@@ -72,8 +72,9 @@ extension/third_party/cpython-2.7.18/ # 静态库
|
||||
```
|
||||
|
||||
Godot 这边只剩一个宿主 Control:把输入转发给 `CPythonWindowManager`,每帧调用它的 Update/Render。
|
||||
`root/*.py` 和 `uiscript/` 直接从 pack 读取,和 40250 相同。port-map 中 `Client/root` 的 3350 个函数
|
||||
全部记为 `N_A`(原样运行,无需移植),python 层剩下约 1540 个 C++ 函数要移植。
|
||||
`root/*.py` 和 `uiscript/` 直接从 pack 读取,和 40250 相同。port-map 中 `Client/root` 的函数在其
|
||||
参考字节、资源清单和目标平台运行证据都成立后记为 `RUN_AS_IS`,不能记为 `N_A`;python 层剩下约
|
||||
1540 个 C++ 函数要移植。
|
||||
|
||||
## Android 验证(2026-09-22,已通过)
|
||||
|
||||
@@ -95,8 +96,10 @@ Godot 这边只剩一个宿主 Control:把输入转发给 `CPythonWindowManage
|
||||
|
||||
## 下一步
|
||||
|
||||
1. 把 CPython 2.7.18 放进 `extension/third_party/`,用我们自己的 CMake 编译(macOS / Android / iOS 共用一份源码清单和
|
||||
`pyconfig.h`),静态链接进 `libmtgodot`;
|
||||
2. `pack` 模块走 `asset_io`,标准库的纯 Python 文件放进资源包,用 `system.py` 自带的导入钩子加载;
|
||||
3. 在 APK 里跑同样的引导流程(C++ 桩模块),然后按同样方法验证 iOS;
|
||||
4. 之后 python 层才开始移植:`ScriptLib/PythonLauncher.cpp` → `EterPythonLib` 窗口系统 → `*Module.cpp`。
|
||||
1. 把 CPython 2.7.18 放进 `extension/third_party/`,共用源码/静态模块清单,但为 macOS、Linux、Windows、
|
||||
Android、iOS 分别生成或维护 `pyconfig.h`,静态链接进 `libmtgodot`;
|
||||
2. `pack` 模块走 `asset_io`,继续负责 40250 的 root/uiscript。标准库沿用已验证的 `python27.zip + sys.path`
|
||||
方案:桌面端放在解释器可读的真实文件系统路径,移动端首次启动从应用资源复制到应用沙盒并校验 sha256;静态启用
|
||||
`zipimport`。不要依赖 `system.py` 的简单 `name + '.py'` 钩子加载带 package/dotted import 的标准库;
|
||||
3. 在 APK app 进程里跑同样的引导流程(C++ 桩模块),然后分别验证 iOS、Linux 和 Windows;
|
||||
4. 按 `docs/PORT-PLAN.md` 的 2V0-2V3 切片依次替换桩模块和旧运行路径。
|
||||
|
||||
Reference in New Issue
Block a user