CPython opens the stdlib zip with its own stdio, so it needs a real path.
On the desktop res:// is a directory and globalize_path() is enough; in an
exported build res:// is inside the PCK, which nothing outside Godot reads.
make_stdlib_zip.py now also writes <out>.sha256
mtpython_stdlib_project copies python27.zip + .sha256 into project/
(gitignored), and both export presets' include_filter lists them, so
they enter the PCK — checked with --export-pack
extension/src/python_stdlib.{h,cpp} (Metin2Python.stdlib_path in
GDScript): reads the bytes out of the PCK, writes
user://python27.zip.part, hashes the file as written against the
shipped digest, then renames. A sandbox copy is reused only when it
matches, so a first start killed mid-copy and a zip replaced by a new
build both re-stage instead of feeding zipimport a torn file.
PythonHost::SetDefaultStdLibPath / DefaultStdLibPath() answer with that
path ($MT_PYTHON_STDLIB still wins). python_stdlib.cpp is the only unit
that knows res:// / user://; port_platform stays godot-free.
Also fixes the Windows gate, which step 3b broke: without mtpython the
MinGW build compiled UserInterface/StdAfx.h (it includes ScriptLib/StdAfx.h,
as the original PCH does). port/CMakeLists.txt excludes that header and
PythonPackModule.cpp with ScriptLib, and platform/CMakeLists.txt excludes
platform/ScriptLib/ the same way.
Not done: on-device staging. The macOS test drives the mobile path with
force_stage=true, and nothing in the app boot calls it yet — the
interpreter only starts in the process with 2V0.
gates: python_stdlib_test.gd PASS (in-place path, staging, sha256, bytes
equal res://, no .part, ZIPReader finds encodings/__init__.py, no re-copy
on a second call, corrupted copy re-staged) · macOS ctest 27/27 ·
mingw + android + ios port_platform compile clean · port_map.py check 0
errors · key leak check 8/8 none.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
129 lines
3.6 KiB
INI
129 lines
3.6 KiB
INI
[preset.0]
|
|
|
|
name="macOS"
|
|
platform="macOS"
|
|
runnable=true
|
|
advanced_options=false
|
|
dedicated_server=false
|
|
custom_features=""
|
|
export_filter="all_resources"
|
|
include_filter="python27.zip,python27.zip.sha256"
|
|
exclude_filter=""
|
|
export_path="../build/export/mtgodot-poc.app"
|
|
patches=PackedStringArray()
|
|
encryption_include_filters=""
|
|
encryption_exclude_filters=""
|
|
seed=0
|
|
encrypt_pck=false
|
|
encrypt_directory=false
|
|
script_export_mode=2
|
|
|
|
[preset.0.options]
|
|
|
|
export/distribution_type=1
|
|
binary_format/architecture="universal"
|
|
custom_template/debug=""
|
|
custom_template/release=""
|
|
debug/export_console_wrapper=1
|
|
application/icon=""
|
|
application/icon_interpolation=4
|
|
application/bundle_identifier="org.internal.mtgodotpoc"
|
|
application/signature=""
|
|
application/app_category="Games"
|
|
application/short_version="1.0"
|
|
application/version="1.0"
|
|
application/copyright=""
|
|
display/high_res=true
|
|
xcode/platform_build="14C18"
|
|
xcode/sdk_version="13.1"
|
|
xcode/sdk_path="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
|
xcode/sdk_name="macosx13.1"
|
|
codesign/codesign=0
|
|
codesign/identity=""
|
|
codesign/certificate_file=""
|
|
codesign/certificate_password=""
|
|
codesign/entitlements/allow_jit_code_execution=false
|
|
codesign/entitlements/allow_unsigned_executable_memory=false
|
|
codesign/entitlements/allow_dyld_environment_variables=false
|
|
codesign/entitlements/disable_library_validation=true
|
|
notarization/notarization=0
|
|
privacy/microphone_usage_description=""
|
|
privacy/camera_usage_description=""
|
|
privacy/location_usage_description=""
|
|
privacy/address_book_usage_description=""
|
|
privacy/calendar_usage_description=""
|
|
privacy/photos_library_usage_description=""
|
|
privacy/desktop_folder_usage_description=""
|
|
privacy/documents_folder_usage_description=""
|
|
privacy/downloads_folder_usage_description=""
|
|
privacy/network_volumes_usage_description=""
|
|
privacy/removable_volumes_usage_description=""
|
|
ssh_remote_deploy/enabled=false
|
|
|
|
[preset.1]
|
|
|
|
name="Android"
|
|
platform="Android"
|
|
runnable=true
|
|
advanced_options=false
|
|
dedicated_server=false
|
|
custom_features=""
|
|
export_filter="all_resources"
|
|
include_filter="python27.zip,python27.zip.sha256"
|
|
exclude_filter=""
|
|
export_path="../build/export/mtgodot-poc.apk"
|
|
patches=PackedStringArray()
|
|
encryption_include_filters=""
|
|
encryption_exclude_filters=""
|
|
seed=0
|
|
encrypt_pck=false
|
|
encrypt_directory=false
|
|
script_export_mode=2
|
|
|
|
[preset.1.options]
|
|
|
|
custom_template/debug=""
|
|
custom_template/release=""
|
|
gradle_build/use_gradle_build=true
|
|
gradle_build/gradle_build_directory="res://android"
|
|
gradle_build/android_source_template=""
|
|
gradle_build/compress_native_libraries=false
|
|
gradle_build/export_format=0
|
|
gradle_build/min_sdk=""
|
|
gradle_build/target_sdk=""
|
|
architectures/armeabi-v7a=false
|
|
architectures/arm64-v8a=true
|
|
architectures/x86=false
|
|
architectures/x86_64=false
|
|
version/code=1
|
|
version/name="1.0"
|
|
package/unique_name="org.internal.mtgodotpoc"
|
|
package/name=""
|
|
package/signed=true
|
|
package/app_category=2
|
|
package/retain_data_on_uninstall=false
|
|
package/exclude_from_recents=false
|
|
package/show_in_android_tv=false
|
|
package/show_in_app_library=true
|
|
package/show_as_launcher_app=false
|
|
launcher_icons/main_192x192=""
|
|
launcher_icons/adaptive_foreground_432x432=""
|
|
launcher_icons/adaptive_background_432x432=""
|
|
launcher_icons/adaptive_monochrome_432x432=""
|
|
graphics/opengl_debug=false
|
|
xr_features/xr_mode=0
|
|
screen/immersive_mode=true
|
|
screen/support_small=true
|
|
screen/support_normal=true
|
|
screen/support_large=true
|
|
screen/support_xlarge=true
|
|
user_data_backup/allow=false
|
|
command_line/extra_args="res://client_main.tscn"
|
|
apk_expansion/enable=false
|
|
apk_expansion/SALT=""
|
|
apk_expansion/public_key=""
|
|
permissions/internet=true
|
|
permissions/access_network_state=true
|
|
permissions/access_wifi_state=true
|
|
permissions/wake_lock=true
|