From 9bf0974eecdc08aa97682ff8057017ddb5c7fe5f Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 23 Apr 2024 17:33:25 -0700 Subject: [PATCH] autogenerating tools/bacloud so it uses venv --- .efrocachemap | 56 ++++++++++++++--------------- .gitignore | 1 + CHANGELOG.md | 2 +- Makefile | 10 +++++- src/assets/ba_data/python/baenv.py | 2 +- src/ballistica/shared/ballistica.cc | 2 +- tools/bacloud | 28 ++++----------- tools/batools/bacloud.py | 13 +++++++ tools/batools/spinoff/_context.py | 3 +- 9 files changed, 63 insertions(+), 54 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 4f051e1f..025e839a 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4056,26 +4056,26 @@ "build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "93bf8f800fabeecc672a60bc7f5bedc5", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "3f5d79c23fb7a2aa5c32bfeb01841b7b", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "2fd63e8c51f5da231f389a23434d1a93", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "4e4e362a8ecd66f8c2bdc493e4d6252d", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "db4090086dcee82e6c40a5557138de27", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "7209321341bb6702c61ecda3803bce4f", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "ef872d67f1086edeb5af7d2bf2023fec", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "771fa2990e761a1a67977b92b9818a85", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "015dbcf56263e84043bbeb1585239720", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "31c121c7b137681bae41c5431dac3c71", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "08a4ddbaa68e65a706994b804c6073ff", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "b8ea38d8ac7721834be096bcbc3ecd09", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "aa7c12f44dbe822eb083ce475f162d01", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "07064f41580f8e83bf84206a93524060", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "6cb47237b92fb2ef26f2b26ae00f0daf", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "10f29b6b69d615e414306b451dc660c7", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "95d9f48a6fbbe230e704930d4f62fb26", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "7856bc878b2458c059cf145a8378749a", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "58ee4b65fe1185d104a047b91a11e21f", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "b11437fea648fb155d54a5f371cae3e4", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "1e1a72bb42210e0992bd7a2408565a2e", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "86af590d3b1dcbe7452fc34812b80703", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "404fe0d51e5de5cefc953d310478fa72", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b74b319219ebf9d65d7140ec7a578915", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "1f5c341e94401653a3126ad4f8321cdc", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "d564109fb87d7a130a9d79a846a60ca1", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "11942d4276b94506d4b723d07065c4c5", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "81d8eab614d6288cbf414e723287fa76", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "fbcc1a2f462b6c6060c420590fb7f497", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "a76f362992100904bc068ae17776f36c", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "0e8eac9274458830040a5693910453ea", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "8e02d3a23ebd0be9623f53c5d21b7b2a", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "b94ba75ec9f10f4d96edc7e5f779fce5", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "1ac05648d26a6186d5a9fb083f417628", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "c416a591991e58339d6bd128824e2cce", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "9d50a74360e4e1d0f3b84426b280a2df", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "6e9b87bf674c50d40b92880a90a777e4", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "a5cdc149d88a8231c85d5bbf67e5fbb4", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "8116d38c4678920ce707ada95989fc1e", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "93f08183b435f9b2d69d33429fab8ded", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "11668f7191dc8d4e2b03db15ff2a4241", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "b190199ce8b8fe122993d14fb7e8e813", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "11668f7191dc8d4e2b03db15ff2a4241", @@ -4092,14 +4092,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "4fab22abc481a97e884cce9d67b35c6b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "7c536b056d78148a302c975bf9238118", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "4fab22abc481a97e884cce9d67b35c6b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "4dd7741e15bc53f6ea13039e12ccfafe", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "196d66ae39cb1a5e51136a5fe807f1e9", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "3d80a18699a538cb82557e5d98922a33", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "09313a2246f87977cd4f997a47c9bb0b", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "9281419c2d307bc30ccf2eba2da95029", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "b86175ecfc52e34cebcf788291114003", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "7f0a197d61a8670fdf8417c4e713f06b", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "b7c2059f4426450b9ff15ea58f4d7aee", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "af223593bb6072052625a9352ca1e2e0", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "17e870062f0252e1ff53b74d4ead9a42", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "71378bcf65b096029b080f7bd8bfc982", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "0f5c4e26925e83e76d82a67bd8fc9aaa", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "9e947cd01c42f05f7cb0e957571a8243", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "b6390897bf65ee022ecaf8c12b561c8c", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "d6f03f8f0c2a54c156e602cb83b7480c", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "453de128a75126e519c1a4c9724a1dfe", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "b611c090513a21e2fe90e56582724e9d", "src/ballistica/base/mgen/pyembed/binding_base.inc": "72bfed2cce8ff19741989dec28302f3f", diff --git a/.gitignore b/.gitignore index 665272c6..5ef8653c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ _fulltest_buildfile_* ballistica_files/ tools/pcommand tools/cloudshell +tools/bacloud **/.#* # Environment files diff --git a/CHANGELOG.md b/CHANGELOG.md index d00333ef..bfd7013c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.34 (build 21806, api 8, 2024-04-23) +### 1.7.34 (build 21808, api 8, 2024-04-23) - Bumped Python version from 3.11 to 3.12 for all builds and project tools. One of the things this means is that we can use `typing.override` instead of the `typing_extensions` version so the annoying requirement of installing diff --git a/Makefile b/Makefile index d24ebeaf..4fa42212 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,8 @@ endif # are out of date. PREREQS_SAFE = .cache/checkenv $(PCOMMANDBATCHBIN) .dir-locals.el .mypy.ini \ .pyrightconfig.json .pylintrc .clang-format \ - ballisticakit-cmake/.clang-format .editorconfig tools/cloudshell + ballisticakit-cmake/.clang-format .editorconfig tools/cloudshell \ + tools/bacloud # Prereq targets that may break if the project needs updating should go here. # An example is compile-command-databases; these might try to run cmake and @@ -1235,6 +1236,13 @@ tools/cloudshell: tools/efrotools/genwrapper.py tools/efrotools/pyver.py @PYTHONPATH=tools python3 -m \ efrotools.genwrapper cloudshell efrotoolsinternal.cloudshell tools/cloudshell +# Generate a bacloud script hard-coded to use our virtual environment. +# This is a prereq dependency so should not itself depend on prereqs. +tools/bacloud: tools/efrotools/genwrapper.py tools/efrotools/pyver.py + @echo Generating tools/bacloud... + @PYTHONPATH=tools python3 -m \ + efrotools.genwrapper bacloud batools.bacloud tools/bacloud + .clang-format: config/toolconfigsrc/clang-format $(TOOL_CFG_SRC) @$(TOOL_CFG_INST) $< $@ diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 0d292c85..e7591fa6 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -52,7 +52,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21806 +TARGET_BALLISTICA_BUILD = 21808 TARGET_BALLISTICA_VERSION = '1.7.34' diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index f2153e15..95b6d20f 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 = 21806; +const int kEngineBuildNumber = 21808; const char* kEngineVersion = "1.7.34"; const int kEngineApiVersion = 8; diff --git a/tools/bacloud b/tools/bacloud index c136123c..5d67be0f 100755 --- a/tools/bacloud +++ b/tools/bacloud @@ -1,23 +1,9 @@ -#!/usr/bin/env python3.12 -# Released under the MIT License. See LICENSE for details. +#!/Users/ericf/LocalDocs/ballistica-internal/.venv/bin/python3.12 +# Copyright (c) 2011-2024 Eric Froemling +# This file is autogenerated; do not edit. # -"""A tool for interacting with ballistica's cloud services. -This facilitates workflows such as creating asset-packages, etc. -""" +"""Simple wrapper so bacloud uses our internal virtual environment.""" +from batools.bacloud import run_bacloud_main -from __future__ import annotations - -import sys - -from batools.bacloud import App -from efro.error import CleanError - -try: - App().run() -except KeyboardInterrupt: - # Let's do a clean fail on keyboard interrupt. - # Can make this optional if a backtrace is ever useful. - sys.exit(1) -except CleanError as clean_exc: - clean_exc.pretty_print() - sys.exit(1) +if __name__ == "__main__": + run_bacloud_main() diff --git a/tools/batools/bacloud.py b/tools/batools/bacloud.py index fb375033..c09ab201 100755 --- a/tools/batools/bacloud.py +++ b/tools/batools/bacloud.py @@ -57,6 +57,19 @@ def get_tz_offset_seconds() -> float: return utc_offset +def run_bacloud_main() -> None: + """Do the thing.""" + try: + App().run() + except KeyboardInterrupt: + # Let's do a clean fail on keyboard interrupt. + # Can make this optional if a backtrace is ever useful. + sys.exit(1) + except CleanError as clean_exc: + clean_exc.pretty_print() + sys.exit(1) + + class App: """Context for a run of the tool.""" diff --git a/tools/batools/spinoff/_context.py b/tools/batools/spinoff/_context.py index d2516613..f70f5dc4 100644 --- a/tools/batools/spinoff/_context.py +++ b/tools/batools/spinoff/_context.py @@ -1050,7 +1050,8 @@ class SpinoffContext: # The proper way might be to ask the parent repo for its full list of # script files but that would add more expense. if ( - src_path.endswith('.py') or src_path in {'tools/cloudshell'} + src_path.endswith('.py') + # or src_path in {'tools/cloudshell'} ) and out != text: self._ensure_parent_repo_tool_configs_exist() out = format_python_str(projroot=self._src_root, code=out)