diff --git a/.efrocachemap b/.efrocachemap index b18d39c6..af5ecd0f 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4080,18 +4080,18 @@ "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/00/49/e47efddc17c6668697ad9779615c", "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e4/e7/3ec91b98817f29d17c95ee7bdee3", "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/4a/45/0299b8fe6a228b7ae3bd91edc606", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/78/c8/1ab96ede0d71b4cb51ff89b21399", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/f6/88/bea78837489f5bf92b0df5dbf22d", "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/fa/47/e5979c9a446e163af5758605d3ef", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/4c/3b/a5288d1f4cd67f37ab9ed57cd249", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/99/31/af469680f6071ab8585124cd6073", "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/09/52/fce56e0d6da0d2017b577a625eb5", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/35/c1/e9c0b08630749f1432e1f05fa500", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/fb/6d/ebb4c095daa9c7557754757c7b97", "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/83/ee/5e815a581095bc5cc4e9f4b0c520", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/1b/ca/083e81c9fe947c3151ad215d1879", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d3/f0/3b3344e4ea99935d6bbf0fa2bcc9", "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/36/17/ea670f5195251b7b926b7b271488", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/c5/ef/0db461dc89c2480513117dbc5d4c", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/2c/40/b5bb2aecfc863e6ba563472f3dce", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/41/9c/0ead8b3b8da6edcd74a6d1856fe3", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/db/87/709b5ca6f45e25c21b138e7662d2", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/5b/ce/97fccf1b34535049ad9746ed2c94", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/30/30/d29f4ab6c7b560c7648dd1bbb1a5", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/3c/f5/9c7a9b41d16132985aabb727d52c", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/a6/e2/95f32f494fd9a755f71be89bf37d", "build/prefab/lib/linux_arm64_gui/debug/libballisticakit_internal.a": "https://files.ballistica.net/cache/ba1/df/11/f2087bd3edce7376be6e6113bfe0", "build/prefab/lib/linux_arm64_gui/release/libballisticakit_internal.a": "https://files.ballistica.net/cache/ba1/aa/29/08d7c589821a466b966f79249394", "build/prefab/lib/linux_arm64_server/debug/libballisticakit_internal.a": "https://files.ballistica.net/cache/ba1/97/f2/7c6e1c10b9677759ee72d73added", @@ -4108,14 +4108,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticakit_internal.a": "https://files.ballistica.net/cache/ba1/d7/c4/ff0ab9a031720bd1889970f95f94", "build/prefab/lib/mac_x86_64_server/debug/libballisticakit_internal.a": "https://files.ballistica.net/cache/ba1/00/23/6094e9f386f10c2608835d0d46bc", "build/prefab/lib/mac_x86_64_server/release/libballisticakit_internal.a": "https://files.ballistica.net/cache/ba1/61/2a/d5ed8af50aaa5093fa93f45db8fc", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericInternal.lib": "https://files.ballistica.net/cache/ba1/3f/f3/118376d0111975bcf01e31d587e7", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/45/98/3363abf3f4b5fb270cc9b8cc729e", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/89/04/7c0005900322c5316ad861a40599", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/ad/e4/1058bf71c16131c256ff49d255c0", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericInternal.lib": "https://files.ballistica.net/cache/ba1/a7/51/9f05f32e67eaa14a1d22968e2229", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/e7/57/49366f1aa93aba773c57a0aebc3e", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/a1/e4/6f62514a136752c5103e2c5bae05", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/ba/75/382033fdc2cc8ccaff490fc19375", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericInternal.lib": "https://files.ballistica.net/cache/ba1/82/a9/9665535a47a71fc76ba49090e4c6", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/ca/67/606c4180ec286f5c3f4f23d8ae57", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/3f/6a/d5849cc743ffec00367f26d6c686", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/b8/62/c29086be087852c703ba976525a2", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericInternal.lib": "https://files.ballistica.net/cache/ba1/18/23/34d640f26bef245494bf4d7e6b0b", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/73/63/c4a940e4e2084823b729e98c76df", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/1a/a0/80b31a5ca14b2103141cf68b43a9", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/d9/2e/46b525bbefa5f13671bae0b2bf68", "src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa", "src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1", "src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/b4/3d/e352190a0e5673d101c0f3ee3ad2", diff --git a/tools/batools/dummymodule.py b/tools/batools/dummymodule.py index e33f8f67..60e05375 100755 --- a/tools/batools/dummymodule.py +++ b/tools/batools/dummymodule.py @@ -909,15 +909,44 @@ def generate(projroot: str) -> None: # parallel builds containing checks plus actual builds of cmake-binary. # The upside is during iteration this will often just use the same binary # we are iterating with, reducing redundant compiles. - # TODO(ericf): for the ballistica public repo should make this use - # prefab builds so folks without compiler toolchains can still run - # code checks. - print( - f'{Clr.SMAG}Building binary to generate dummy-modules...{Clr.RST}', - flush=True, - ) - subprocess.run(['make', 'cmake-binary'], check=True) + # Normally here we download a prefab binary to use when generating + # dummy modules. This allows people without full compiler setups to + # still get dummy modules made so they can check their Python code. + # However someone who *is* able to compile their own binaries might want + # to go with those so any changes they make to the binary are reflected + # in the dummy-modules. Set BA_ENABLE_DUMMY_MODULE_BINARY_BUILDS=1 to + # enable that. + binary_build_command: list[str] + if os.environ.get('BA_ENABLE_DUMMY_MODULE_BINARY_BUILDS') == '1': + print( + f'{Clr.SMAG}Building binary to generate dummy-modules...{Clr.RST}', + flush=True, + ) + binary_build_command = ['make', 'cmake-binary'] + binary_path = 'build/cmake/debug/ballisticakit' + else: + print( + f'{Clr.SMAG}Fetching prefab binary to' + f' generate dummy-modules...{Clr.RST}', + flush=True, + ) + binary_build_command = ['tools/pcommand', 'make_prefab', 'gui-release'] + binary_path = ( + subprocess.run( + ['tools/pcommand', 'prefab_binary_path', 'gui-release'], + check=True, + capture_output=True, + ) + .stdout.decode() + .strip() + ) + if not os.path.exists(binary_path): + raise RuntimeError( + f"Fetched prefab binary not found at '{binary_path}'" + ) + + subprocess.run(binary_build_command, check=True) subprocess.run(['make', 'scripts-cmake'], cwd='src/assets', check=True) pycmd = ( @@ -955,7 +984,7 @@ def generate(projroot: str) -> None: # Note: ask Python to not scatter __pycache__ files throughout # our build output. subprocess.run( - ['build/cmake/debug/ballisticakit', '--command', pycmd], + [binary_path, '--command', pycmd], env=dict(os.environ, PYTHONDONTWRITEBYTECODE='1'), check=True, ) diff --git a/tools/batools/pcommand.py b/tools/batools/pcommand.py index 8af73749..71f78da5 100644 --- a/tools/batools/pcommand.py +++ b/tools/batools/pcommand.py @@ -694,6 +694,20 @@ def prefab_run_var() -> None: print(f'RUN_PREFAB_{platform}_{base}', end='') +def prefab_binary_path() -> None: + """Print the current platform prefab binary path.""" + import batools.build + + if len(sys.argv) != 3: + raise RuntimeError('Expected 1 arg.') + buildtype, buildmode = sys.argv[2].split('-') + platform = batools.build.get_current_prefab_platform() + print( + f'build/prefab/full/{platform}_{buildtype}/{buildmode}/ballisticakit', + end='', + ) + + def make_prefab() -> None: """Run prefab builds for the current platform.""" import subprocess diff --git a/tools/pcommand b/tools/pcommand index a8cd06be..e1bd2c13 100755 --- a/tools/pcommand +++ b/tools/pcommand @@ -94,6 +94,7 @@ from batools.pcommand import ( checkenv, ensure_prefab_platform, prefab_run_var, + prefab_binary_path, make_prefab, lazybuild, efro_gradle,