Fix stale Cpp2IL output cleanup - #1193
Merged
HerpDerpinstine merged 1 commit intoAug 13, 2026
Merged
Conversation
13 tasks
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.
Summary
Cpp2ILinherit the standard executable-package cleanupcpp2il_outassemblies before each generation and after completionRoot cause
Cpp2IL.Cleanup()was overridden with an empty implementation. Cpp2IL writes into an existing directory without removing assemblies that disappeared between game versions, and Il2CppInterop reads every DLL in that directory.The inherited
ExecutablePackage.Cleanup()is already scoped toOutputFolder, so it removescpp2il_outwithout removing the downloaded Cpp2IL executable.Closes #1192.
Cross-project source trace
2022.1.0-pre-release.21creates the output directory if needed and writes current assemblies, but does not remove assemblies it no longer emits.Cinemachine.dllfrom0.4.5f2referencesUnityEngine.Camera.GateFitMode; the current0.4.6f11CoreModule no longer defines that enum, and a clean current Cpp2IL run does not emitCinemachine.dll.Cinemachine.LensSettings.GateFit -> UnityEngine.Camera.GateFitModereference. Its defensive downstream handling is complementary; this PR prevents MelonLoader from constructing the invalid mixed input set.The full type-level evidence and controls are recorded in #1192.
Verification
dotnet build MelonLoader.sln --no-restore -c Release -p:Platform=x64 -p:Version=0.7.3-stale-output-fixdotnet build MelonLoader.sln --no-restore -c Release -p:Platform=x86 -p:Version=0.7.3-stale-output-fix0.4.5f2, then updating the same disposable install to0.4.6f11Pass11ComputeTypeSpecificsto throwIl2CppAssemblyGenerator.dllwith the source-built version while preserving all 123 stale inputs0.4.6f11regenerated successfully, removedcpp2il_out, retained none of the 12 old-only assemblies, and reachedLoading Modswith zero generation errors