chore: merge upstream - #41
Merged
Merged
Conversation
chore(deps): update Cpp2IL and Il2CppInterop
When the Unity base-libraries download fails (commonly a 404 for a Unity version not yet hosted on unity.bepinex.dev), the uncaught HttpRequestException surfaced only as a cryptic "Failed to generate Il2Cpp interop assemblies" and the game would not launch -- even though a local fallback (the unity-libs directory) already exists. Catch the download failure and throw a clear message naming the Unity version, the URL and the two workarounds: place a matching base-libraries .zip in the unity-libs directory, or point the [IL2CPP] UnityBaseLibrariesSource config at a valid URL. Refs BepInEx#1295, BepInEx#1084, BepInEx#986, BepInEx#941, BepInEx#515
The chainloader collected both not-installed dependencies and installed-but-incompatible-version dependencies into one list and reported them all as "missing dependencies", which is confusing when the plugin is present but on a version outside the requested range. Separate the two cases and log distinct, actionable messages: one for dependencies that are not installed, and one for dependencies present with an incompatible version (showing the found version and the required range). Also expand the BepInDependency(string, string) xmldoc: the version is a SemVer range, link the range syntax, and warn about the BepInEx 5 -> 6 behaviour change (a bare version was a minimum, now it is exact). Fixes BepInEx#779
BaseChainloader.Execute invoked the Finished event inside the same try/catch that reports plugin-loading failures, so an exception thrown by a Finished event listener was logged as "Error occurred loading plugins:" even though it was unrelated to plugin loading. Move Finished?.Invoke() into its own try/catch with an accurate message. Control flow is otherwise unchanged: Finished still runs only after LoadPlugins succeeds, a throwing listener is still caught, and "Chainloader startup complete" is still logged afterwards. Fixes BepInEx#842
…ssing (BepInEx#1338) * Degrade instead of crashing when the interop assemblies are missing OnInvokeMethod references interop types (UnityEngine.Application/LogType) in its body. The CLR JIT-compiles the whole method before running any of it, so when the interop assemblies cannot be resolved the method throws FileNotFoundException at JIT time -- before its own try is entered -- and the exception escapes into the native runtime-invoke detour and crashes the process with nothing logged. Move the interop-referencing call into its own SetupUnityLogging method called inside the try. OnInvokeMethod then JITs without the interop assemblies present, the missing-interop failure is caught, and the loader degrades (logs and continues) so the game runs unmodded. Set unhook at the top of the try so the detour fires exactly once even on failure. * Condense the interop-degrade comments and reword the fatal log Per review: trim the JIT-bypass comments to one line each and change the fatal message to "Unable to execute IL2CPP chainloader, no plugins will be loaded".
…1340) * Don't abort startup when the config file can't be written ConfigFile.Save opens the file for writing with no exception handling and is invoked automatically via SaveOnConfigSet while settings are bound during startup, before logging is initialized. A read-only or otherwise unwritable config file (a read-only install directory, a file locked by another process or antivirus) therefore throws UnauthorizedAccessException out of the early startup path and shows the Failed to start BepInEx dialog.
…1343) Patch-method discovery already reads both with the plural MetadataHelper.GetAttributes<T>(), and the docs say additional target attributes can be specified, but the attributes lacked AllowMultiple = true, so the compiler rejected a second one (CS0579). Set AllowMultiple = true on both.
typeof(byte) was registered twice in the TypeConverters initializer; the second entry silently overwrote the first. Keep the one grouped with the other integral types.
ConfigFile documents its public methods as thread-safe, but GetEnumerator returned the live Dictionary enumerator with no lock, so a concurrent Bind/Reload could invalidate it mid-foreach. Snapshot under _ioLock instead.
HashStrings passed str.Length (a char count) as the byte count to MD5.TransformBlock, so for any non-ASCII string only a truncated prefix of the UTF-8 bytes was hashed. Capture the byte array and use its Length.
Version 21 includes a reference to Disarm version 99 which results in builds to fail unless author's custom nuget feed is referenced. Details: SamboyCoding/Disarm#45
|
Download the artifacts for this pull request: |
Signed-off-by: hazre <mail@haz.re>
hazre
force-pushed
the
hazre/chore/merge-upstream
branch
from
August 10, 2026 13:24
3d9d23b to
09ca8a9
Compare
Signed-off-by: hazre <mail@haz.re>
hazre
force-pushed
the
hazre/chore/merge-upstream
branch
from
August 10, 2026 13:42
09ca8a9 to
4edda32
Compare
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.
No description provided.