From 15d9d1c7ce6c64f6e4e06ef62312f7fa8799b783 Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 16 Jul 2023 11:42:31 -0700 Subject: [PATCH] v1.7.23 --- .efrocachemap | 56 +++++++++++------------ CHANGELOG.md | 4 +- src/assets/ba_data/python/baenv.py | 2 +- src/ballistica/core/python/core_python.cc | 56 ++++++++++++++--------- src/ballistica/shared/ballistica.cc | 2 +- tools/efrotools/pybuild.py | 32 +++++++++++-- 6 files changed, 95 insertions(+), 57 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index bd2d6de5..8c71bc14 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4068,26 +4068,26 @@ "build/assets/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/2d/ef/5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/b0/8a/55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/86/5b/2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/99/22/5edc8e3ab710bd45726c15dfecbd", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/ce/77/0674ace0d25118717c7f3137c619", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b3/5e/4795e49ba007c80d4d3d02e41605", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/de/f3/f8694fa9ce2d3ac24f851f060068", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/9a/28/5c215f7054450e783f4d6bbaada5", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/e2/5b/eb646a7f85fbecb170909c36e396", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/30/40/38ccf00d716141837bd9f5c80955", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b7/d1/257d573c1ac4bd819131697549f2", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/83/c0/4ca3860b2acad24ca006b5bed38b", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/e1/f5/722d2b66926941cfd7cd23047c2b", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/1e/2c/fce598b734a5cc6651f026bf148c", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/10/68/a2f0705f92da098f979d0b83ca63", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/0d/13/ccf5a83588a2fd67e4da968e7025", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/26/0e/9d7b75f68ef46658d36b08e97ca4", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/30/78/b49e48e81107774a02c0f70087db", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ff/5a/ec26a662dc58862fca2180aac807", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/05/70/ce0c0e49428f5a39fc5bd736a6da", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/a0/10/2161276835beb6c638cd98ebcef7", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/70/84/b89c19db1a09f691fa6398ad6850", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/d3/28/3351f3a14277dc1f755cb6a90e19", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/a8/5e/e644cd4120304fba4d4dbd9762e2", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/92/73/0a1325df721b51d0c9f2e0f6f075", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/24/f8/b372c8e02345a5540bd976069de8", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/81/5d/8368c53554a9b997f0a1d38c0ced", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/cb/90/6f74ab7d83e5ff9db887f391664a", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/cd/51/6639bbf611e918b21c1676b25764", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d1/4b/5f2cb963955fd973bd7498c57519", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/9b/9f/1e1d79b604749c2033e7fad06394", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/97/f6/2f0e7dba9be2437f43dc4af5e449", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/2e/22/297bedb0cbfb169fb9ba607bff1b", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/c6/3e/6b09e07290a01483186b2ca44f8b", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/9e/c9/89f8f396ba8597453d81542f6ff6", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/0b/d8/4b6df9ec36d59a5560615c763bbf", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/2d/5e/f6e1619a73c21c886425d878b96a", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b6/4b/c7e9a14a16d69b20313f7007662c", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/2c/00/fe4d13eb53c0d825da2750b30cec", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/69/19/13f59849fe2a31eac8a350db2e12", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/01/ab/f243ffaa211fd9463cc7ede10f29", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/87/d3/88a28894dc15e511f3ba56f44267", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/b5/1e/bb7075104c420ca1c0663d24768c", "build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/84/aa/534f35b6499762739646ea173382", "build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/25/2f/3bd787d6debb2c4073fd6c2e8098", "build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/84/aa/534f35b6499762739646ea173382", @@ -4104,14 +4104,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/47/61/eca0961c54b2eae2cf65fac7848d", "build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/06/5c/90c3a49e16a004e2db71909af919", "build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/47/61/eca0961c54b2eae2cf65fac7848d", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/24/51/e35d1ebf519aecaed8bc345b9714", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/d3/1f/6c10b7cde22b523833ed456a0e58", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/c8/2c/a0688e3edeac37ec252f9e4ee68a", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/7a/48/da9923cdcb9d3865d74eb83cdaf9", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/3a/7c/48e67a2aa61e8bceeada113795ed", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/58/74/8cf519b8516cfb866877c6fa6aca", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/84/a6/fbf13c8e367d333de19d18c20070", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/a2/7f/7ce8adcc84c5fe8e3b228f17c3d3", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/d3/34/d2fa72d15a085424bad4157a6f2e", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/56/5f/6cde7712eebd76bcd9081b1d063a", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/8e/bb/cde5d48031a147358f49372348fc", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/82/e5/7d8d72481b84b81a3ec2b85cddf1", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/74/11/5059d262beb03fda192c967760ea", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/bf/57/94af76a5f7f51c10e9725730469e", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/fc/56/19374bffec117190ae9c132cff68", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/c6/c9/b6828fe5295e6d5df08fad9ebf3f", "src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/f8/85/fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/f8/cd/3af311ac63147882590123b78318", "src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/3e/7a/203e2a5d2b5bb42cfe3fd2fe16c2", diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fd5b181..ea9f29b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ -### 1.7.23 (build 21169, api 8, 2023-07-12) +### 1.7.23 (build 21171, api 8, 2023-07-16) - Network security improvements. (Thanks Dliwk!) -- You can now double click a chat message to copy it (Thanks Vishal332008!) +- You can now double click a chat message to copy it. (Thanks Vishal332008!) - Android's audio library has been updated to the latest version (and is now much easier for me to keep up to date). Please holler if you run into anything wonky related to audio. diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 06a969bf..8cd7fc29 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -28,7 +28,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21169 +TARGET_BALLISTICA_BUILD = 21171 TARGET_BALLISTICA_VERSION = '1.7.23' _g_env_config: EnvConfig | None = None diff --git a/src/ballistica/core/python/core_python.cc b/src/ballistica/core/python/core_python.cc index 3ff2d5cc..40a76b88 100644 --- a/src/ballistica/core/python/core_python.cc +++ b/src/ballistica/core/python/core_python.cc @@ -10,7 +10,7 @@ namespace ballistica::core { -static void LowLevelPythonDebugLog(const char* msg) { +void LowLevelPythonDebugLog(const char* msg) { assert(g_core); g_core->platform->DebugLog(msg); } @@ -70,38 +70,53 @@ void CorePython::InitPython() { PyConfig_InitPythonConfig(&config); } config.dev_mode = dev_mode; - if (!g_buildconfig.debug_build()) { - config.optimization_level = 1; - } + config.optimization_level = g_buildconfig.debug_build() ? 0 : 1; // In cases where we bundle Python, set up all paths explicitly. // https://docs.python.org/3/c-api/init_config.html#path-configuration if (g_buildconfig.contains_python_dist()) { + std::string root = g_buildconfig.ostype_windows() ? "C:\\" : "/"; + + // In our embedded case, none of these paths are really meaningful, but + // we want to explicitly provide them so Python doesn't try to calc its + // own. So let's set them to obvious dummy ones so its clear if they + // show up anywhere important. + CheckPyInitStatus( + "pyconfig home set", + PyConfig_SetBytesString(&config, &config.home, + (root + "dummy_py_home").c_str())); CheckPyInitStatus( "pyconfig base_exec_prefix set", - PyConfig_SetBytesString(&config, &config.base_exec_prefix, "")); + PyConfig_SetBytesString(&config, &config.base_exec_prefix, + (root + "dummy_py_base_exec_prefix").c_str())); CheckPyInitStatus( "pyconfig base_executable set", - PyConfig_SetBytesString(&config, &config.base_executable, "")); + PyConfig_SetBytesString(&config, &config.base_executable, + (root + "dummy_py_base_executable").c_str())); CheckPyInitStatus( "pyconfig base_prefix set", - PyConfig_SetBytesString(&config, &config.base_prefix, "")); + PyConfig_SetBytesString(&config, &config.base_prefix, + (root + "dummy_py_base_prefix").c_str())); CheckPyInitStatus( "pyconfig exec_prefix set", - PyConfig_SetBytesString(&config, &config.exec_prefix, "")); - CheckPyInitStatus("pyconfig executable set", - PyConfig_SetBytesString(&config, &config.executable, "")); - CheckPyInitStatus("pyconfig prefix set", - PyConfig_SetBytesString(&config, &config.prefix, "")); + PyConfig_SetBytesString(&config, &config.exec_prefix, + (root + "dummy_py_exec_prefix").c_str())); + CheckPyInitStatus( + "pyconfig executable set", + PyConfig_SetBytesString(&config, &config.executable, + (root + "dummy_py_executable").c_str())); + CheckPyInitStatus( + "pyconfig prefix set", + PyConfig_SetBytesString(&config, &config.prefix, + (root + "dummy_py_prefix").c_str())); // Note: we're using utf-8 mode above so Py_DecodeLocale will convert // from utf-8. - // Interesting note: it seems we can pass relative paths here but - // they wind up in sys.path as absolute paths (unlike entries we add - // to sys.path *after* things are up and running). - // Though nowadays we want to use abs paths anyway to avoid doing chdir - // so its a moot point. + // Interesting note: it seems we can pass relative paths here but they + // wind up in sys.path as absolute paths (unlike entries we add to + // sys.path *after* things are up and running). Though nowadays we want + // to use abs paths anyway to avoid needing chdir so its a moot point. if (g_buildconfig.ostype_windows()) { // Windows Python looks for Lib and DLLs dirs by default, along with // some others, but we want to be more explicit in limiting to these. It @@ -128,12 +143,11 @@ void CorePython::InitPython() { config.module_search_paths_set = 1; } - // In monolithic builds, let Python know how to import all our built in - // modules. + // In monolithic builds, let Python know how to import all our built-in + // modules. In other builds, everything will be expected to live on disk + // as .so files (or symlinks to them). if (g_buildconfig.monolithic_build()) { MonolithicRegisterPythonModules(); - } else { - FatalError("FIXME UNIMPLEMENTED"); } // Init Python. diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 73ee0c62..1ddfbe7d 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int { namespace ballistica { // These are set automatically via script; don't modify them here. -const int kEngineBuildNumber = 21169; +const int kEngineBuildNumber = 21171; const char* kEngineVersion = "1.7.23"; auto MonolithicMain(const core::CoreConfig& core_config) -> int { diff --git a/tools/efrotools/pybuild.py b/tools/efrotools/pybuild.py index f9641209..db0082a3 100644 --- a/tools/efrotools/pybuild.py +++ b/tools/efrotools/pybuild.py @@ -713,15 +713,39 @@ def android_patch_ssl() -> None: def _patch_py_wreadlink_test() -> None: fname = 'Python/fileutils.c' txt = readfile(fname) + + txt = replace_exact( + txt, + ' res = readlink(cpath, cbuf, cbuf_len);\n', + ( + ' res = readlink(cpath, cbuf, cbuf_len);\n' + ' const wchar_t *path2 = path;\n' + ' int path2len = 0;\n' + ' while (*path2) {\n' + ' path2++;\n' + ' path2len++;\n' + ' }\n' + ' char dlog1[512];\n' + ' if (res >= 0) {\n' + ' snprintf(dlog1, sizeof(dlog1), "ValsA1 pathlen=%d slen=%d' + ' path=\'%s\'", path2len, strlen(cpath), cpath);\n' + ' } else {\n' + ' snprintf(dlog1, sizeof(dlog1), "ValsA2 pathlen=%d",' + ' path2len);\n' + ' }\n' + ' Py_BallisticaLowLevelDebugLog(dlog1);\n' + ), + ) + txt = replace_exact( txt, " cbuf[res] = '\\0'; /* buf will be null terminated */", ( ' char dlog[512];\n' - ' snprintf(dlog, sizeof(dlog), "hello world1 res=%d mpl=%d' - ' eq1=%d eq2=%d slen=%d path=\'%s\'",' - ' (int)res, (int)MAXPATHLEN, (int)(res == -1),' - ' (int)((size_t)res == cbuf_len), strlen(cpath), cpath);\n' + ' snprintf(dlog, sizeof(dlog), "ValsB res=%d resx=%X' + ' eq1=%d eq2=%d",' + ' (int)res, res, (int)(res == -1),' + ' (int)((size_t)res == cbuf_len));\n' ' Py_BallisticaLowLevelDebugLog(dlog);\n' " cbuf[res] = '\\0'; /* buf will be null terminated */" ),