fixed incorrect plugin error reporting

This commit is contained in:
Eric 2023-06-07 19:42:07 -07:00
parent aee8a0ce44
commit ddffdbdbb0
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
8 changed files with 87 additions and 58 deletions

88
.efrocachemap generated
View File

@ -4072,50 +4072,50 @@
"build/assets/workspace/ninjafightplug.py": "https://files.ballistica.net/cache/ba1/c5/09/4f10b8a21ba87aa5509cff7a164b",
"build/assets/workspace/onslaughtplug.py": "https://files.ballistica.net/cache/ba1/ff/0a/a354984f9c074dab0676ac7e4877",
"build/assets/workspace/runaroundplug.py": "https://files.ballistica.net/cache/ba1/2a/1c/9ee5db6d1bceca7fa6638fb8abde",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/57/cf/fe513c33a572cdcfbbba9e76a537",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/3f/dc/b35efa449a34a40af97204dc0027",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/76/f7/b07fc9a280c607649265028e511e",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/dc/1f/9ee6f88ed657c465e5c18a937e42",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/ac/fe/2bbd42cfdd1636f0b429c709e169",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/57/4a/f2aad7e06f9130d63d963146dea3",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/df/cf/401fc1dad742264fa10af1a93f9b",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/4a/6b/74200494c9ff5506d53dfadeedbb",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/52/1a/1c7b34726cfd69083c6ac7cb0751",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/ad/2e/a6dc78f3fd0de3378cdeb1ee0849",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/6f/ce/22702096896bd2648334fbabdb00",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/94/2f/d2e9fba5f220a16a0416aab24fd4",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/5f/84/4c71130875897f96a1852dc926e4",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/a0/c2/f90402315ad5fadfd39e8c93b83e",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ec/50/6cd315f45dcc28aa6a9c542475f0",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/59/39/102368cce793e002313b04d4c2fa",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/55/a9/862acc6882cd9d9c3242259362b8",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/bb/55/75de30d2dcec6bcada3e167ace4a",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/fe/18/4b0ea64c6e4d339373c6ce4dd513",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/89/c1/14800dfecf06745aa48c6bd11f71",
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/66/b7/4be2fcf57b9bc9cb12d97d6ac298",
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4d/31/1654791c0ae8eb78b517b548f2f7",
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/62/04/d4b18d10e866785b23756d48f91c",
"build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/e8/cf/a780e3f8bde8b2ff58b33ff9ceef",
"build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/dd/a0/cd002bc6817fdda826c0e01bf714",
"build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/bb/7a/eb3cabeaf7e3d823d6e24b829a45",
"build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/78/92/4c036866d152edc05854e4fcaa64",
"build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ed/c6/b4e7c39c236857ca991904cb78f3",
"build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a5/a8/9e0b4aa407d210ac7452c23f972c",
"build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/8d/28/415334e71f7f2436e137a8565893",
"build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/e1/5b/162ceaf3624d4fba331ef3501250",
"build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f4/2f/dc4ca51233cacc5e6a8becad7dc2",
"build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/04/3d/7bb7aea8097a31b1746cbb883beb",
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a7/38/f5ebf21a44b3968a1623ae839721",
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b7/fa/1f32d0fedf5e54092d434bff20ed",
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d2/5a/08f06543729620d0d08b31b4c0a4",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/90/4a/e7373009c863cb50a741c89832a6",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/ba/d7/2e82016141f71fac12716b11c712",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/da/d9/0edd077345b39ce402d0a451ff87",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/f0/28/49238893669c104657695fd7ca4b",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/9f/ba/27e8f751e94b52b7ea181f2a7bd2",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/89/8a/4e92f77bb6a90b3b0b7f4f418c7a",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/be/61/253d4d74d66d4a6bf163a4e7cba8",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/60/28/09274265646c1080d10f2e854fe5",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/5d/c0/b0c3f97dc8be7a1ce7cefda5571d",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/85/df/ff042339b652dd67e113df0bf943",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/2e/d6/851e329bcc1a648dd0ee2688080b",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/76/6a/8f0b4eaa499f42463039eca0a2a7",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/9c/ea/e2f1683e1e043f3a47c39066b183",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/5a/62/988f1d63ed87e1beaea96ead800e",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/24/0e/f5291cfe96963aed5e047ca8dc3f",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/f9/65/ff80216ac4bcae2f8a8c4d484e2b",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/6c/bc/51f10c04edc010a6fccb1bea092c",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/70/4f/0726bcff9a37b6f167e7cacc0003",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/05/3a/8fef724c7c849945d9a2a003f3dd",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/f3/34/23ab44d7d443f2b49609b1b325b2",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/a7/28/05bbf013c1399fb85376a4913511",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/9c/d0/d1086359ab9e0b6c3e609fe67e20",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/8f/6f/e0e3c5ae85b61b37f7f437e0102b",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/20/3a/1e706ba99c9e663864b13ba9440d",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/0a/59/18879e3ee43cb81e63c1e01e2390",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/4b/c5/b5ee2c4b820387d2f6654231c5fb",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/94/2d/012b5cc35c20f0e92036724bd302",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/f6/c1/b309507f58e6d5325e52b441310b",
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/86/b8/5aaa1f826bdb5abe5ad57b0fc0c9",
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d4/8e/70f425b0259655a3efe710846cce",
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f5/71/9c18e9e43026aa763c5ac6e5b445",
"build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4b/07/1423312234a932b7c5ea637db9a5",
"build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/e1/27/653dda9fd039b94b94e814ba100b",
"build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ff/5a/bd40d47925bd6e048a0eafa2e27a",
"build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a9/4c/feef3299178c7c2a32d2e9401927",
"build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/22/73/bb4da5b9d266d9995423ff5cee71",
"build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/3f/f8/4e2c65178d7f781c6b388a2d07e9",
"build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/13/7f/e28a0fe031d9806013aaf92c6b4f",
"build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/37/38/0224b9c169e4cfab7f0eae074409",
"build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/e5/1b/cbeefe9866cc5b2c26bf42b23a27",
"build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/17/de/f5a9ac5976208e0312b4d3a6455e",
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/9b/30/f27a1766b6ce7c5dc63c0c5a1f65",
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/8e/97/dc049e4ff4ad2c808a6f5c685dc7",
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/c1/83/aacd3c0321301d6eaf81eb656456",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/61/06/efe333f8f4d86881ec8f06f3aea9",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/c1/2e/9f8a5af787b03bc2d17ac75c5fd1",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/7c/55/99886cad6f0aefe8f39f1a298e25",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/15/af/3a577c40161caaf4285398eb2fe1",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/67/d3/ad793ef717d79872d7c6614b444e",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/d5/0f/b88cf9b5fed9dcb11ab24377ccd8",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/1b/90/013c8c3f3491bd79b61760b78ceb",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/81/ce/37e84fdddf7ed8c494c7a1a73cd3",
"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/75/9f/bcf597b362c9f2480cb348188bdd",

View File

@ -1,4 +1,4 @@
### 1.7.20 (build 21063, api 8, 2023-06-07)
### 1.7.20 (build 21064, api 8, 2023-06-07)
- This seems like a good time for a `refactoring` release in anticipation of
changes coming in 1.8. Basically this means that a lot of things will be
@ -286,6 +286,12 @@
it is making some early UI sounds (such as the 'power-down' sound if a plugin
disappears) sound cut-off and broken. Please holler if you notice any sounds
that get 'stuck' playing after games/etc.
- (build 21063) Improved error handling when loading plugins. If plugin code
encountered a ModuleNotFound error while executing, it was being incorrectly
reported that the plugin itself had disappeared, when actually it was just a
problem within the plugin's code. This is now correctly handled and reported.
Which is good because this situation will come up a lot for people upgrading
old plugins which reference 'ba' and other modules that no longer exist.
### 1.7.19 (build 20997, api 7, 2023-01-19)

View File

@ -23,6 +23,7 @@ from _babase import (
DisplayTimer,
Vec3,
do_once,
screenmessage,
pushcall,
quit,
safecolor,
@ -165,6 +166,7 @@ __all__ = [
'AppIntentExec',
'AppMode',
'AppSubsystem',
'screenmessage',
]
# We want stuff to show up as babase.Foo instead of babase._sub.Foo.

View File

@ -472,10 +472,6 @@ class App:
self._app_bootstrapping_complete = True
self._update_state()
assert not self._meta_scan_completed
self._meta_scan_completed = True
self._update_state()
def on_app_launching(self) -> None:
"""Called when the app enters the launching state.
@ -529,6 +525,10 @@ class App:
# Now that we know what's out there, build our final plugin set.
self.plugins.on_meta_scan_complete()
assert not self._meta_scan_completed
self._meta_scan_completed = True
self._update_state()
def on_app_loading(self) -> None:
"""Called when the app enters the loading state.

View File

@ -5,6 +5,7 @@
from __future__ import annotations
import logging
import importlib.util
from typing import TYPE_CHECKING
from dataclasses import dataclass
@ -138,11 +139,29 @@ class PluginSubsystem(AppSubsystem):
)
disappeared_plugs: set[str] = set()
for plugkey in plugkeys:
# Originally I was just catching ModuleNotFoundError on the
# getclass() call to detect plugins disappearing. However
# this breaks if the module *does* exist but itself imports
# something that does not exist; in that case we would
# incorrectly show that the plugin had disappeared.
#
# So now we're first explicitly asking Python if it can
# locate the module, and if it can then we treat any further
# errors including ModuleNotFound as problems with the
# module's code; not ours.
try:
cls = getclass(plugkey, Plugin)
except ModuleNotFoundError:
spec = importlib.util.find_spec(plugkey.split('.')[0])
except Exception:
spec = None
if spec is None:
disappeared_plugs.add(plugkey)
continue
# Ok; it seems that there's *something* there. Now try to load
# it and treat any further errors as the module's fault.
try:
cls = getclass(plugkey, Plugin)
except Exception as exc:
_babase.getsimplesound('error').play()
_babase.screenmessage(
@ -155,7 +174,7 @@ class PluginSubsystem(AppSubsystem):
),
color=(1, 0, 0),
)
logging.exception("Error loading plugin class '%s'", plugkey)
logging.exception("Error loading plugin class '%s'.", plugkey)
continue
try:
plugin = cls()

View File

@ -28,7 +28,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21063
TARGET_BALLISTICA_BUILD = 21064
TARGET_BALLISTICA_VERSION = '1.7.20'
_g_env_config: EnvConfig | None = None

View File

@ -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 = 21063;
const int kEngineBuildNumber = 21064;
const char* kEngineVersion = "1.7.20";
auto MonolithicMain(const core::CoreConfig& core_config) -> int {

View File

@ -621,12 +621,14 @@ def _apply_pylint_run_to_cache(
'binascii',
}
# Special case:
# Ignore generated dummy-modules (we don't directly check those anymore
# so they'll be listed as external).
assert os.path.isdir('build/dummymodules')
for fname in os.listdir('build/dummymodules'):
if fname.endswith('.py'):
ignored_untracked_deps.add(fname.removesuffix('.py'))
if os.path.exists('build/dummymodules'):
assert os.path.isdir('build/dummymodules')
for fname in os.listdir('build/dummymodules'):
if fname.endswith('.py'):
ignored_untracked_deps.add(fname.removesuffix('.py'))
# Ignore some specific untracked deps; complain about any others.
untracked_deps = set(