Skip to content

[ASIM-6857] Further improve error message when failing to load plugins - #189

Merged
esss-jenkins merged 1 commit into
masterfrom
fb-ASIM-6857-improve-dll-error-message
Aug 28, 2026
Merged

[ASIM-6857] Further improve error message when failing to load plugins#189
esss-jenkins merged 1 commit into
masterfrom
fb-ASIM-6857-improve-dll-error-message

Conversation

@nicoddemus

@nicoddemus nicoddemus commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to ASIM-6677 (#185): a plugin DLL load failure now carries a structured
diagnostic, which is used by the GUI to display it alongside the plugin panel.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

@nicoddemus
nicoddemus force-pushed the fb-ASIM-6857-improve-dll-error-message branch from e619d3c to fee3702 Compare August 25, 2026 14:40
@nicoddemus
nicoddemus marked this pull request as ready for review August 25, 2026 14:55
@nicoddemus
nicoddemus requested a review from BeneBr August 25, 2026 14:56
When a plugin shared library fails to load, hookman now captures a
diagnostic explaining the DLL search environment at load time: the
effective PATH/LD_LIBRARY_PATH entries, the directories registered via
os.add_dll_directory, and any library bundled with the plugin that is
shadowed by a same-named file earlier in the search path. This is
exactly the information that took manual investigation to find in
ASIM-6769 ("Error 127 loading scaling.dll"): an anaconda3 directory
earlier on PATH shadowed the plugin's own bundled splog.dll.

- hookman.dll_diagnostics.LoadDiagnostics (frozen dataclass):
  shadowed_libraries, registered_dll_directories, path_entries,
  collection_error. str(diagnostics) renders a human-readable block;
  callers that want to act on the diagnosis can inspect the fields
  directly instead of parsing text back apart.
- LoadDiagnostics.collect(shared_lib_path) is a classmethod that
  gathers this, never raising (any internal failure is captured in
  collection_error so it can never mask the original load error).
- SharedLibraryLoadError.diagnostics / PluginLoadFailure.diagnostics
  are LoadDiagnostics | None (None when no load was attempted).
- The generated C++ HookCaller::load_impls_from_library raises the same
  information on Windows, and reports dlerror() plus LD_LIBRARY_PATH on
  Linux; the diagnostics search itself reads LD_LIBRARY_PATH on POSIX
  and PATH on Windows.
- New tests/test_dll_diagnostics.py covers the diagnostics module in
  isolation; existing hookman_utils/hooks tests extended for the new
  field.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@nicoddemus
nicoddemus force-pushed the fb-ASIM-6857-improve-dll-error-message branch from 213aa57 to 5e2171c Compare August 27, 2026 12:43
@esss-jenkins
esss-jenkins merged commit 0af7efd into master Aug 28, 2026
7 checks passed
@esss-jenkins
esss-jenkins deleted the fb-ASIM-6857-improve-dll-error-message branch August 28, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants