Scope precompiled DLLs to LiveKit asmdef to avoid clashes#270
Merged
Conversation
Mark Google.Protobuf and System.Runtime.CompilerServices.Unsafe as isExplicitlyReferenced and switch the LiveKit asmdef to overrideReferences with explicit precompiledReferences. This isolates our DLL versions to the LiveKit assembly so other packages bundling their own copies (e.g. com.unity.ai.assistant) no longer clash via Unity's duplicate-assembly detection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Google.Protobuf.dllandSystem.Runtime.CompilerServices.Unsafe.dllasisExplicitlyReferenced: 1livekit.unity.Runtime.asmdeftooverrideReferences: trueand explicitly list our precompiled deps (Google.Protobuf.dll,System.Runtime.CompilerServices.Unsafe.dll,Newtonsoft.Json.dll)com.unity.ai.assistant) no longer trigger Unity's "Duplicate assembly with different versions detected" CS0246/CS0538 cascadeBackground
With
com.unity.ai.assistant(which shipsGoogle.Protobuf 3.33.2andSystem.Runtime.CompilerServices.Unsafe 6.0.3) installed in a project, Unity's duplicate-assembly detection picked the AI Assistant's newer DLLs over ours, but their copies areisExplicitlyReferenced: 1and editor-only — so they didn't auto-reference into the LiveKit assembly either. Result: LiveKit ended up with no Google.Protobuf reference at all, breakingRuntime/Scripts/Proto/*.cs.Marking our DLLs as explicitly-referenced and binding them to the LiveKit asmdef via
overrideReferences+precompiledReferenceskeeps our copies scoped to LiveKit's compilation unit and out of the project-wide auto-reference pool, so the duplicate detection no longer affects us.🤖 Generated with Claude Code