From c12d2337ef6cdf8a03f24bbf8864a5b99d0898b5 Mon Sep 17 00:00:00 2001 From: shen <> Date: Thu, 24 Sep 2026 01:14:18 -0700 Subject: [PATCH] build(macos): include sound assets in bundle, add diagnostic signal handler and update audio driver --- build-macos-client.sh | 1 + extension/src/platform/ScriptLib/PythonBoot.cpp | 14 ++++++++++++++ project/audio_driver.gd | 2 ++ 3 files changed, 17 insertions(+) diff --git a/build-macos-client.sh b/build-macos-client.sh index a137b97c..f89b0c25 100755 --- a/build-macos-client.sh +++ b/build-macos-client.sh @@ -70,6 +70,7 @@ mkdir -p "$BUNDLE_CLIENT" ditto "$SOURCE_CLIENT/pack" "$BUNDLE_CLIENT/pack" if [ -d "$SOURCE_CLIENT/BGM" ]; then ditto "$SOURCE_CLIENT/BGM" "$BUNDLE_CLIENT/BGM"; fi if [ -f "$SOURCE_CLIENT/locale.cfg" ]; then cp "$SOURCE_CLIENT/locale.cfg" "$BUNDLE_CLIENT/locale.cfg"; fi +if [ -d "$REPO/assets/Sound/sound" ]; then ditto "$REPO/assets/Sound/sound" "$BUNDLE_CLIENT/sound"; fi test -s "$BUNDLE_CLIENT/pack/Index" # Record the exact source revision inside the signed bundle. A Beta release is built only diff --git a/extension/src/platform/ScriptLib/PythonBoot.cpp b/extension/src/platform/ScriptLib/PythonBoot.cpp index 0eb227f6..41f8cdcb 100644 --- a/extension/src/platform/ScriptLib/PythonBoot.cpp +++ b/extension/src/platform/ScriptLib/PythonBoot.cpp @@ -53,6 +53,11 @@ #include #include #include +#if defined(__APPLE__) +#include +#include +#include +#endif namespace { @@ -345,6 +350,15 @@ bool Start(const char* stdlib_path, std::string* error) { if (g_launcher) return true; + #if defined(__APPLE__) + if (std::getenv("MT_BETA_DIAGNOSTIC")) + signal(SIGSEGV, [](int) { + void* frames[64]; + int count = backtrace(frames, 64); + backtrace_symbols_fd(frames, count, STDERR_FILENO); + std::_Exit(139); + }); + #endif // 40250 Main (UserInterface.cpp:410): if (LocaleService_LoadGlobal(hInstance)) SetDefaultCodePage(...). std::string locale_config = "locale.cfg"; diff --git a/project/audio_driver.gd b/project/audio_driver.gd index 984a0752..bd84fc5c 100644 --- a/project/audio_driver.gd +++ b/project/audio_driver.gd @@ -42,6 +42,8 @@ func _init_roots() -> void: # 音效查找根目录 var candidate_roots := [ + client.path_join("sound"), + client.path_join("Sound/sound"), assets.path_join("Sound/sound"), assets.path_join("sound2/sound"), assets.path_join("sound_m/sound"),