diff --git a/.efrocachemap b/.efrocachemap index 17d5a493..92acd3c4 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4038,26 +4038,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": "d9afde0c1cc61b1fa27aed723afd9ede", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "42fc71b128260196094cc517deba76db", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "764f0b4661e0c92d5c376356f5fa8825", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "a6ae3a8df85d6b245a944164c437471b", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "b5a068b26fc52668bbb4f79eba5c047d", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "b3636e3fb8e268ced15daa2a2256ee44", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "d5b503fe1aa2681724581e02ea049f73", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "d465f04ba2c8fa98624db8cf38e9177e", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "d0b8c22e04f83f712b0033b427282eea", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "03e09fdffcbcb6a0ea967e81c3b0c7c9", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "932a3acd7abd13074eebfc03e0e7d56c", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "bbe5aa04abb57add770af26fc101d488", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "3c33079f35aff14e62117f30f297b2c5", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "36567f3012c97261d54ddff9d682e4da", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "5c30ad4693e19c3f4261711e38b6b5a5", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "ec40d7abbe4d0ad4cc35667fb9685784", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "cb685b901201a75b094c1f5ac655155c", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "0d2c6f859dc14ee5eb5267e06128e090", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "df7849c6f6bee1c20ce74cb46fa591b2", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "069841aea1eb622b693c98eed7482a35", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "a92a8552dc768a124023921e2d7c8e4b", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "4aed94d02131e7387238efb8e8c88517", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "8b95dbba57e6453070609a8f7c05284e", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "36961e7faa9e949ef714136f6f72ed9d", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "4b96f8141e053abef2796f6970cca7bf", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "7d2542c6f789099c37f1c36a004c0532", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "2b35512a02c77933cc9d1988761e9907", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "30fe1c1ac3a70695001a21ceb7b137ec", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "633e84b17f8e564c904dc85f1b4fa657", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "07cd831fee262def54be88ce219207c8", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "ee638b2db04ebcf3889c5cb6ce70c153", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "360cedd219db792e8910544b028b76cf", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "6338e5613990e5df7592109a77f2ce66", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "d29b1531d1610c5815071c0f5fd596e9", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "6656b4b2bcbc87f94cf573ff9c34648e", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "8153ea67d0e0bdeb852e656a9ff89505", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "4a5f1dd454ff6e2215d63e24b871b226", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "4a6ba058616fddd1d2f3045e7eba5fef", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "79d13825d258fb365b99e1045cff2607", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "7fcfa30b3aab3ce4c31287b7cd15aeef", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "f231b10895bdcb542de87b887ca181fd", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "ae936a119668ede7b36f38c8672f4bf8", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "f231b10895bdcb542de87b887ca181fd", @@ -4074,14 +4074,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "efffc4f330e77530accd9a9f82840a6c", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "c20363fe2af3d54e666b1c8ee67f6b76", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "efffc4f330e77530accd9a9f82840a6c", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "a75854a744d9f2abe9027fe03ea4d458", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "4581a1ce0934b7b3ea5bf8a46823a761", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "99ee35add584cbdeead0d845a637ad18", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "83ec9375d7c1bc790cc3e784488960b0", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "7838f2899be0eedeb352a9f31bd9f860", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "c27c37020a0c0b29792435f05a8c19b6", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "40326b4848a648ece17d2f2f50e2cc27", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "281f67c8179e1f5d7fd1445ed4069699", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "632d0e121545353cc40577b765c156f9", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "ffe84e846b294dc8517d9af555dad70f", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "ef1743ca2035c525e8884129d69fa582", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "0d215e98b6440a823809d3d582ae542f", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "359f0e344c2f9d6409b675c2ab600df4", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "7467cc9095607857b21f5f55518874e0", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "2680d5d44629d8a19857d1c6b87a6fd2", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "bed37e7b4e1dfcdd31789db7730a388e", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "5548f407d97e380069f6c596c4e36cd7", "src/ballistica/base/mgen/pyembed/binding_base.inc": "efa61468cf098f77cc6a234461d8b86d", diff --git a/CHANGELOG.md b/CHANGELOG.md index f001af9a..914fedb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ -### 1.7.36 (build 21895, api 8, 2024-06-26) - +### 1.7.36 (build 21896, api 8, 2024-06-26) +- `bacloud workspace put` is now a bit smarter; you can now do things like + `bacloud workspace put .` and it will work. Previously such cases required + explicitly passing the workspace name as a second argument. + ### 1.7.35 (build 21889, api 8, 2024-06-20) - Fixed an issue where the engine would block at exit on some version of Linux until Ctrl-D was pressed in the calling terminal. diff --git a/config/projectconfig.json b/config/projectconfig.json index 835fa668..e32dc36f 100644 --- a/config/projectconfig.json +++ b/config/projectconfig.json @@ -1,4 +1,5 @@ { + "assets": "a-0.assets1.dev", "code_source_dirs": [ "src/ballistica" ], diff --git a/src/assets/Makefile b/src/assets/Makefile index 88ae95d2..22e19a64 100644 --- a/src/assets/Makefile +++ b/src/assets/Makefile @@ -7499,6 +7499,21 @@ assets: assets-cmake assets-win-Win32 clean: @rm -rf $(BUILD_DIR) +# Modern AssetPackage bits. + +# Extract the asset-package version from project-config and stuff it into +# a 'resolved' file. If we are using dev version, clear the file which +# will force an explicit check each time through. +$(PROJ_DIR)/.cache/asset_package_resolved: $(PROJ_DIR)/config/projectconfig.json + @$(PCOMMAND) asset_package_resolve $@ + +$(PROJ_DIR)/.cache/assetmanifests/cmake-debug.manifest: \ + $(PROJ_DIR)/.cache/asset_package_resolved + @$(PCOMMAND) asset_package_fetch $(PROJ_DIR)/.cache/asset_package_resolved \ + cmake-debug $@ + +foo: $(PROJ_DIR)/.cache/assetmanifests/cmake-debug.manifest + # These targets don't correspond to actual files; make sure make knows that. .PHONY: cmake win mac ios android audio audio-clean fonts fonts-clean data \ data-clean meshes meshes-clean textures-clean scripts scripts-clean \ diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 66b9109c..b5a6bdbb 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 = 21895 +TARGET_BALLISTICA_BUILD = 21896 TARGET_BALLISTICA_VERSION = '1.7.36' diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index ca0845c6..dabd36b5 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 = 21895; +const int kEngineBuildNumber = 21896; const char* kEngineVersion = "1.7.36"; const int kEngineApiVersion = 8; diff --git a/tools/bacommon/bacloud.py b/tools/bacommon/bacloud.py index 15f85ee5..f293ffcb 100644 --- a/tools/bacommon/bacloud.py +++ b/tools/bacommon/bacloud.py @@ -14,7 +14,7 @@ if TYPE_CHECKING: # Version is sent to the master-server with all commands. Can be incremented # if we need to change behavior server-side to go along with client changes. -BACLOUD_VERSION = 8 +BACLOUD_VERSION = 9 @ioprepped diff --git a/tools/batools/bacloud.py b/tools/batools/bacloud.py index f50f368a..ec988e6c 100755 --- a/tools/batools/bacloud.py +++ b/tools/batools/bacloud.py @@ -94,24 +94,10 @@ class App: ): raise CleanError('Unable to locate project directory.') - # Also run project env checks so we can hopefully inform the user - # of missing Python modules/etc. instead of just failing cryptically. - try: - subprocess.run( - ['make', '--quiet', 'env'], - check=True, - cwd=self._project_root, - ) - except subprocess.CalledProcessError as exc: - raise CleanError( - '"make env" check failed. ' - 'Install missing requirements and try again.' - ) from exc - self._load_state() # Simply pass all args to the server and let it do the thing. - self.run_interactive_command(sys.argv[1:]) + self.run_interactive_command(cwd=os.getcwd(), args=sys.argv[1:]) self._save_state() @@ -287,8 +273,13 @@ class App: os.makedirs(dirname, exist_ok=True) data_zipped = base64.b64decode(fdata) data = zlib.decompress(data_zipped) - with open(fname, 'wb') as outfile: + + # Write to tmp files first and then move into place. This + # way crashes are less likely to lead to corrupt data. + fnametmp = f'{fname}.tmp' + with open(fnametmp, 'wb') as outfile: outfile.write(data) + os.rename(fnametmp, fname) def _handle_dir_prune_empty(self, prunedir: str) -> None: """Handle pruning empty directories.""" @@ -334,11 +325,14 @@ class App: print(prompt, end='', flush=True) self._end_command_args['input'] = input() - def run_interactive_command(self, args: list[str]) -> None: + def run_interactive_command(self, cwd: str, args: list[str]) -> None: """Run a single user command to completion.""" # pylint: disable=too-many-branches - nextcall: tuple[str, dict] | None = ('_interactive', {'a': args}) + nextcall: tuple[str, dict] | None = ( + '_interactive', + {'c': cwd, 'a': args}, + ) # Now talk to the server in a loop until there's nothing left to do. while nextcall is not None: diff --git a/tools/batools/pcommandmain.py b/tools/batools/pcommandmain.py index d50fa1f1..d51f59cf 100644 --- a/tools/batools/pcommandmain.py +++ b/tools/batools/pcommandmain.py @@ -142,6 +142,8 @@ from batools.pcommands2 import ( wsl_path_to_win, wsl_build_check_win_drive, get_modern_make, + asset_package_resolve, + asset_package_fetch, ) # pylint: enable=unused-import diff --git a/tools/batools/pcommands2.py b/tools/batools/pcommands2.py index 1607319c..1ab0f6df 100644 --- a/tools/batools/pcommands2.py +++ b/tools/batools/pcommands2.py @@ -602,3 +602,75 @@ def get_modern_make() -> None: print('gmake') else: print('make') + + +def asset_package_resolve() -> None: + """Resolve exact asset-package-version we'll use (if any).""" + import os + + from efro.error import CleanError + from efrotools.project import getprojectconfig + + pcommand.disallow_in_batch() + args = pcommand.get_args() + if len(args) != 1: + raise CleanError('Expected 1 arg.') + + resolve_path = args[0] + + apversion = getprojectconfig(pcommand.PROJROOT).get('assets') + if apversion is None: + raise CleanError("No 'assets' value found in projectconfig.") + + splits = apversion.split('.') + if len(splits) != 3: + raise CleanError( + f"'{apversion}' is not a valid asset-package-version id." + ) + + # 'dev' versions are a special case; in that case we don't create + # a resolve file, which effectively causes our manifest fetch logic + # to run each time. + if splits[2] == 'dev': + if os.path.exists(resolve_path): + os.unlink(resolve_path) + else: + with open(resolve_path, 'w', encoding='utf-8') as outfile: + outfile.write(apversion) + + +def asset_package_fetch() -> None: + """Build/fetch an asset-package-manifest.""" + import os + from efro.error import CleanError + + from efrotools.project import getprojectconfig + + pcommand.disallow_in_batch() + args = pcommand.get_args() + if len(args) != 3: + raise CleanError('Expected 3 args.') + + resolve_path, _buildtype, outpath = args + + # If resolve path exists, it is the exact asset-package-version we + # should use. + apversion: str | None + if os.path.exists(resolve_path): + with open(resolve_path, encoding='utf-8') as infile: + apversion = infile.read() + else: + # If there's no resolve file, look up the value directly from + # project-config. Generally this means it's set to a dev + # version. + apversion = getprojectconfig(pcommand.PROJROOT).get('assets') + if not isinstance(apversion, str): + raise CleanError( + f'Expected a string asset-package-version; got {type(apversion)}.' + ) + + print('WOULD GO FORWARD WITH', apversion) + + os.makedirs(os.path.dirname(outpath), exist_ok=True) + with open(outpath, 'w', encoding='utf-8') as outfile: + outfile.write('foo') diff --git a/tools/efrotools/buildlock.py b/tools/efrotools/buildlock.py index 7930b041..e430cd0b 100644 --- a/tools/efrotools/buildlock.py +++ b/tools/efrotools/buildlock.py @@ -17,20 +17,22 @@ LOCK_DIR_PATH = '.cache/buildlocks' class BuildLock: """Tries to ensure a build is not getting stomped on/etc.""" - def __init__(self, name: str) -> None: + def __init__(self, name: str, projroot: str) -> None: self.name = name + self.projroot = projroot if '/' in name or '\\' in name: raise ValueError(f"Illegal BuildLock name: '{name}'.") - self.lockpath = os.path.join(LOCK_DIR_PATH, name) + self.lockpath = os.path.join(self.projroot, LOCK_DIR_PATH, name) def __enter__(self) -> None: - if not os.path.exists(LOCK_DIR_PATH): - os.makedirs(LOCK_DIR_PATH, exist_ok=True) + lockdir = os.path.dirname(self.lockpath) + if not os.path.exists(lockdir): + os.makedirs(lockdir, exist_ok=True) - # Note: we aren't doing anything super accurate/atomic here. This - # is more intended as a gross check to make noise on clearly broken - # build logic; it isn't important that it catch every corner case - # perfectly. + # Note: we aren't doing anything super accurate/atomic here. + # This is more intended as a gross check to make noise on + # clearly broken build logic; it isn't important that it catch + # every corner case perfectly. if os.path.exists(self.lockpath): raise RuntimeError( f"Build-lock: lock '{self.name}' exists." diff --git a/tools/efrotools/lazybuild.py b/tools/efrotools/lazybuild.py index 37242e67..f2a2b7c4 100644 --- a/tools/efrotools/lazybuild.py +++ b/tools/efrotools/lazybuild.py @@ -106,7 +106,7 @@ class LazyBuildContext: # sure that only one build for some given purpose is being run at # once. if self.buildlockname is not None: - with BuildLock(self.buildlockname): + with BuildLock(self.buildlockname, projroot='.'): self._run_commands_and_update_target() else: self._run_commands_and_update_target() diff --git a/tools/efrotools/pcommands2.py b/tools/efrotools/pcommands2.py index 10648db0..e9469a14 100644 --- a/tools/efrotools/pcommands2.py +++ b/tools/efrotools/pcommands2.py @@ -31,7 +31,7 @@ def with_build_lock() -> None: raise CleanError( 'Expected one lock-name arg and at least one command arg' ) - with BuildLock(args[0]): + with BuildLock(args[0], projroot=str(pcommand.PROJROOT)): subprocess.run(' '.join(args[1:]), check=True, shell=True)