Skip to content

Fail on startup with the names of the missing native dependencies - #39

Merged
OwendB1 merged 1 commit into
mainfrom
fail-early
Sep 6, 2026
Merged

OwendB1 merged 1 commit into
mainfrom
fail-early

Conversation

@viktor-ferenczi

Copy link
Copy Markdown
Contributor

Summary

When a native library the plugin needs is missing, the game used to die much later with a bare DllNotFoundException from some P/Invoke, or DXVK failed to find Vulkan, and users had no way to tell what to install.

A new DependencyCheck runs first in Preloader.Initialize, the earliest hook Pulsar and Magnetar call, and throws one DllNotFoundException listing every missing library with its purpose and the Debian/Ubuntu, Fedora and Arch package names. Pulsar's preloader wrapper logs the exception and shows it in a message box.

  • Bundled libraries (linux-dependencies and linux-native-wrappers releases) are checked by file existence in the plugin directory and reported as "reinstall the plugin".
  • System libraries are probed by dlopen: libopus.so.0, and when rendering is on, libvulkan.so.1 plus one complete SDL3 video driver set, either X11 or Wayland. SDL_VIDEODRIVER narrows the check to that driver and skips it for offscreen; PULSAR_NO_RENDER skips the rendering group.
  • A missing audio backend only logs a warning since the game runs without sound.
  • The dedicated server checks only the three PE-loader wrappers. It relays voice without decoding, so Opus is not required there.
  • The README gained a "System packages" table so people can install ahead of time.

Testing

  • Both projects build clean.
  • Reflection harness against the built assemblies: everything present passes for client and server; a missing plugin directory lists all 14 client or 3 server bundled names; SDL_VIDEODRIVER=offscreen/wayland and PULSAR_NO_RENDER=1 pass.
  • Missing system libraries exercised by temporarily renaming the expected sonames: default mode reports Opus, Vulkan and the combined X11-or-Wayland block; forced drivers report only their set; no-render reports only Opus; the audio warning prints without failing.
  • Live smoke test through Pulsar Interim (-sources -noprompt --headless): console logs [LinuxCompat] all native dependencies found, main menu reached, no exceptions.

Follow-up outside this repo: Pulsar keeps starting the game after a preloader hook throws (SafeInvoke returns false and the caller ignores it).

DependencyCheck runs first in Preloader.Initialize and throws one
DllNotFoundException listing every missing library with the Debian,
Fedora and Arch package names, so users learn what to install instead
of hitting a bare DllNotFoundException deep in a P/Invoke. Bundled
libraries are checked in the plugin directory, system ones by dlopen.
One complete SDL3 video driver set (X11 or Wayland) is enough, and a
missing audio backend only warns. The server needs only the three
PE-loader wrappers. The README lists the packages.
@OwendB1
OwendB1 merged commit 76eccdb into main Sep 6, 2026
@OwendB1
OwendB1 deleted the fail-early branch September 6, 2026 13:47
OwendB1 added a commit that referenced this pull request Sep 6, 2026
Bump LinuxCompat’s client assembly and file versions from 1.0.17.0 to
1.0.18.0 in both the source-compiled plugin attributes and MSBuild
metadata. This identifies the release containing the merged Wayland
Steam overlay input bridge (#40) and missing-native-dependency
diagnostics (#39).

PluginHub must update `Plugins/LinuxCompat.xml` to a commit containing
this bump before Pulsar users receive it. A plugin update does not
require a new Pulsar release or native dependency archives.

Validation: Release builds passed for ClientPlugin and ServerPlugin.
Both emitted only the expected warning that local deployment was
skipped. CSharpier and `git diff --check` passed.
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.

2 participants