From bcaf99ed6cf5e4dc5229221dc933e3ffa664b2e8 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 28 Jul 2023 10:22:26 -0700 Subject: [PATCH] tidying --- .efrocachemap | 88 ++++++++++++++--------------- CHANGELOG.md | 2 +- src/assets/ba_data/python/baenv.py | 48 +++++++++++----- src/ballistica/shared/ballistica.cc | 2 +- 4 files changed, 79 insertions(+), 61 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index ab41d2a9..b4d63597 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4068,50 +4068,50 @@ "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/38/97/54930c0a92c35d1495143963a14b", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/c3/87/00ffdb34a0d990eac9f5cb24252d", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/7d/e0/f68c2bece91b5de6fab78aebf4db", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/52/4c/db8a302384eff4743f3b7beb53f3", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/79/dc/ddf990c6e8e084cb77df896170c8", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/49/0a/02c83d10142c54908458ab2c84b0", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/18/0f/adb627d4566639dc3c2436096812", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ee/93/1b516123a11ef5c5feddccb891fc", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/9e/8e/5d330b8097516af37b06504fc600", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/93/c9/2374979aa4bf12bb24c56f5a40fd", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/12/3c/c4f8a565eb3c9f625e8df57d7a6d", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/8b/1c/4e4fdd55512a5990e093fbf445dd", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/42/e1/4c14924f7cfb90592c650e2f0ce7", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/3c/b3/73763cd76709e50afd3102333624", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b9/2b/850e047f2d9419b2f5e1cdb3e9d6", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3c/f0/18f7abf98c30f3db6ffdfd2fd6f0", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/5f/78/c591e718a00c49bac5d86eddf6b7", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/62/75/dc93a43507c06360d9210e53251b", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/f0/aa/f92a4de4f37ce44d19a3ab6ac41a", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/a6/78/3db15a61181e23bab55fd6675102", - "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/50/4e/39e4ff62ab5c2c3e72862c2c0881", - "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/9d/2b/44367bfb114e7b1148e4e100acd1", - "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/50/4e/39e4ff62ab5c2c3e72862c2c0881", - "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/9d/2b/44367bfb114e7b1148e4e100acd1", - "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/eb/1a/21761c11e160525903190cfe4ed3", - "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/a3/38/2c4abbc88434720311048185fdd1", - "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/eb/1a/21761c11e160525903190cfe4ed3", - "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/a3/38/2c4abbc88434720311048185fdd1", - "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/5f/47/5e5c2e910c783b15c6dcf0d78715", - "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/75/af/1ca3bec27e72101585254739189d", - "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/5f/47/5e5c2e910c783b15c6dcf0d78715", - "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/75/af/1ca3bec27e72101585254739189d", - "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/0b/6e/67ffc264f249cde0044637982bab", - "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/06/ab/699f575fabf3819dcf40b4c3125e", - "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/b3/27/a8e1a856695454d8b37a7d4f3604", - "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/06/ab/699f575fabf3819dcf40b4c3125e", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/e4/5e/23a2320ec571902f4d2fbf61f86d", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/0e/2a/936d4510f873b9f290413686af5a", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/ed/91/6e5cc86189fc485bdc4c62f7049e", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/25/55/b6a6440cea1cdbdfdbc1ca29c17f", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/3b/d7/6a40df7fb477dc2f3459e4a62b20", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/5b/a5/bf087511fbd98c48282287e4ca0c", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/a3/0a/bafe9c23554258d212c29c971c63", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/60/36/15be893226e8210de0e0d71adb27", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/e4/74/7645925e59db5abcf9e11ab589f4", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/37/4b/72a12c9141f7520c7ad4e763e755", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d6/8c/cc6c2e8848985fac0761e9a18aaf", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d6/14/6a1187449dccbcda997f3c88a92b", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/e3/51/1d557f7169bf942e7cfc84534e8d", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/40/3e/3349942b3c9d559b3077a67d4155", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/cd/27/794c4492feb22d279b2aa20a5b68", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/12/7f/f7550d898b2e5ba6bc6e4e39d9b8", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/0b/bb/190949ff2a4c782e64fc1ea0f730", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/e0/ce/d569ba47d21c6bba39805bddd4da", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/c0/c6/44f6b17e3674e90556d2b5f40fe6", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/fd/66/f74db5a1d2ee6298a02fa938ba4f", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/f9/d1/fd643b745341ad0831f6d8b03777", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/83/51/bbfff45c627e851906cc22fec14f", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/56/16/8977791e28c4cc4666836b988ced", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ff/6f/c0e0f423ac7a420699a8a6e5a3b3", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/00/4d/3b81fae9371c82afa08bfcb2b584", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/c5/58/ec12c684e96fad96eb7cbf4525de", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/fc/ee/37c626c8f2cbea272a9c8d84659f", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/0e/18/0acd5eabc324c1053a7ef42d8be6", + "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/85/ba/4e81a1f7ae2cff4b1355eb49904f", + "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/49/89/21f7eb2afd327d4b900cb70e31f9", + "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/85/ba/4e81a1f7ae2cff4b1355eb49904f", + "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/49/89/21f7eb2afd327d4b900cb70e31f9", + "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/de/d5/f785236bf64e644ee20041ac8342", + "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/c4/36/a058b7204fa39f22eafc7ca7855f", + "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/de/d5/f785236bf64e644ee20041ac8342", + "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/c4/36/a058b7204fa39f22eafc7ca7855f", + "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/fe/0b/a4b21528a557c5a434b8f2eeda41", + "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/79/50/a02c3d9a1088e9acd4c29bd3cb72", + "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/fe/0b/a4b21528a557c5a434b8f2eeda41", + "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/79/50/a02c3d9a1088e9acd4c29bd3cb72", + "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/87/0d/11d339fd1b3acf66cc601ff29c83", + "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/0a/b6/38b6602610bdaf432e3cc2464080", + "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/92/39/4eb19387c363471ce134ac9e6a1b", + "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "https://files.ballistica.net/cache/ba1/0a/b6/38b6602610bdaf432e3cc2464080", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/c0/c5/dd7ebc937da7e73e07dbc8aa7d09", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/91/ae/373c5eded629067dd887a2086a13", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/13/ef/99cd93139134df6d7c06c81d79b8", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/53/6e/df1700960b79df6d5cb320cb524f", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/b9/77/9a8b5644941c749cfb7e26d98ea6", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/dd/5d/44fdd6bcdbf6d3d4867f3a0371ef", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/ad/be/4bc93f33874bc74c8697e3ce65a9", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/4a/3e/fba19abdc16563b3ba75ceb9dbb8", "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/ee/dd/ad968b176000e31c65be6206a2bc", diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f183a9a..fd92dc3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.25 (build 21201, api 8, 2023-07-28) +### 1.7.25 (build 21202, api 8, 2023-07-28) ### 1.7.24 (build 21199, api 8, 2023-07-27) diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index ef7c047b..47f72f5d 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -50,7 +50,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21201 +TARGET_BALLISTICA_BUILD = 21202 TARGET_BALLISTICA_VERSION = '1.7.25' @@ -405,25 +405,35 @@ def extract_arg(args: list[str], names: list[str], is_dir: bool) -> str | None: def _modular_main() -> None: from efro.error import CleanError + # Fundamentally, running a Ballistica app consists of the following: + # import baenv; baenv.configure(); import babase; babase.app.run() + # + # First baenv sets up things like Python paths the way the engine + # needs them, and then we import and run the engine. + # + # Below we're doing a slightly fancier version of that. Namely we do + # some processing of command line args to allow overriding of paths + # or running explicit commands or whatever else. Our goal is that + # this modular form of the app should be basically indistinguishable + # from the monolithic form when used from the command line. + try: - # Take note that we're running via modular-main. - # The native layer can key off this to know whether it - # should apply sys.argv or not. + # Take note that we're running via modular-main. The native + # layer can key off this to know whether it should apply + # sys.argv or not. _EnvGlobals.get().modular_main_called = True - # We run configure() BEFORE importing babase. (part of its job - # is to set up where babase and everything else gets loaded - # from). - - # We deal with a few key ours here ourself before spinning up - # any engine stuff. - - # NOTE: Need to keep these arg long/short versions synced to - # those in core_config.cc since they parse the same values (they - # just don't handle them). + # Deal with a few key things here ourself before even running + # configure. + # Extract stuff below modifies this so work with a copy. args = sys.argv.copy() + # NOTE: We need to keep these arg long/short arg versions synced + # to those in core_config.cc. That code parses these same args + # (even if it doesn't handle them in our case) and will complain + # if unrecognized args come through. + # Our -c arg basically mirrors Python's -c arg. If we get that, # simply exec it and return; no engine stuff. command = extract_arg(args, ['--command', '-c'], is_dir=False) @@ -434,6 +444,10 @@ def _modular_main() -> None: config_dir = extract_arg(args, ['--config-dir', '-C'], is_dir=True) data_dir = extract_arg(args, ['--data-dir', '-d'], is_dir=True) mods_dir = extract_arg(args, ['--mods-dir', '-m'], is_dir=True) + + # We run configure() BEFORE importing babase. (part of its job + # is to wrangle paths to determine where babase and everything + # else gets loaded from). configure( config_dir=config_dir, data_dir=data_dir, @@ -444,12 +458,16 @@ def _modular_main() -> None: # The engine will have parsed and processed all other args as # part of the above import. If there were errors or args such as - # --help which should lead to immediate returns, do so. + # --help which should lead to us immediately returning, do so. code = babase.get_immediate_return_code() if code is not None: sys.exit(code) + # Aaaand we're off! babase.app.run() + + # Code wanting us to die with a clean error message instead of an + # ugly stack trace can raise one of these. except CleanError as clean_exc: clean_exc.pretty_print() sys.exit(1) diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index ac646574..59cfac3f 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 = 21201; +const int kEngineBuildNumber = 21202; const char* kEngineVersion = "1.7.25"; #if BA_MONOLITHIC_BUILD