1.0.16 - #18
Merged
Merged
Conversation
… regardless of it was built from downloaded sources or from a local dev folder
A silently skipped rewriter is not a graceful degradation: mods compile
fine but then get Windows path semantics applied to native paths and
fail much later, with nothing pointing back at this registration. Refuse
to start instead.
- Every log-and-return in RewriterRegistration.Register now throws
InvalidOperationException, and the outer catch logs and rethrows
instead of swallowing (mirroring Preloader's PatchCategory handler).
Logging before rethrow is deliberate: the host does not reliably
surface plugin-init/preloader exceptions, so that line is the only
clue the user gets.
- Dropped the DotNetCompat assembly-name filter. Enumerating Pulsar's
naming schemes ("DotNetCompat", "DotNetCompat_<random>",
"dotnet_compat_<random>") needs a new prefix every time Pulsar grows
an install path, which matters more now that a miss is fatal. Match on
the CompilerHookExtensions type instead — the only identity we care
about, stable across every install path — excluding our own assembly
since LinuxCompat shares DotNetCompat's root namespace per side.
- Removed dead code: the old "incompatible version?" branch was
unreachable (asm != null implied extType != null), so a version
mismatch was reported as "assembly not loaded". The not-found message
now lists every loaded assembly name, and the success line names the
matched assembly.
- PlumbRewriterShimReferences also hard-fails. Swallowing there left the
rewriter registered but non-functional, so every rewritten mod failed
to compile with a "namespace could not be found" error pointing
nowhere near the cause.
Both claims were wrong, and both were harmless only by accident. - "DotNetCompat is always loaded earlier than LinuxCompat (Pulsar loads it first)" conflated assembly loading with Init. Assembly loading is guaranteed — the Loader constructor Assembly.Loads every enabled plugin before the Preloader exists or any Init runs, and se-dotnet-compat is a force-enabled core plugin the launcher Environment.Exit(1)s without. Init order is the opposite of the claim: PluginLoader.Init iterates the plugin list in reverse and the core plugins sit at its head, so LinuxCompat.Init runs first. - The server preloader claimed DotNetCompat's Finish "runs before ours (Pulsar profile order)". postHooks is a HashSet<MethodInfo> iterated with foreach, so that order is unspecified. Neither matters: RewriterFactories is a static field initializer, so reading the field constructs the list, and DotNetCompat's patched CreateCompilation re-reads it per call. Documented that reasoning explicitly, with a note not to invert the dependency.
SpaceGT
approved these changes
Jul 31, 2026
SpaceGT
left a comment
Member
There was a problem hiding this comment.
If registration fails, Pulsar will Dispose the plugin and this will cause a hang when it tries to focus the (compat-managed) SDL window.
This is technically a regression since the previous version would allow launching but without mod support.
This seems like a niche case, however, and I plan to move the rewriter into Pulsar at some point so it's fine for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DotNetCompat/DotNetCompat_*), which missed GitHub-sourced installs where Pulsar names the assemblydotnet_compat_<random>. The scan now identifies DotNetCompat by the presence of theCompilerHookExtensionsextension type (excluding our own assembly, which shares the root namespace), making it independent of the install path and of Pulsar's naming scheme.MyLogon the server) before rethrowing, since the host does not reliably surface init/preloader exceptions.