You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ilc fails with "An item with the same key has already been added. Key: [S.P.CoreLib]System.AppContext.OnFirstChanceException(object)" #110608
Error: An item with the same key has already been added. Key: [S.P.CoreLib]System.AppContext.OnFirstChanceException(object)
System.ArgumentException: An item with the same key has already been added. Key: [S.P.CoreLib]System.AppContext.OnFirstChanceException(object)
at System.Collections.Generic.Dictionary`2.TryInsert(TKey, TValue, InsertionBehavior) + 0x310
at ILCompiler.UnmanagedEntryPointsRootProvider.AddCompilationRoots(IRootingServiceProvider) + 0x1a0
at ILCompiler.Compilation..ctor(DependencyAnalyzerBase`1, NodeFactory, IEnumerable`1, ILProvider, DebugInformationProvider, IInliningPolicy, Logger) + 0x138
at ILCompiler.RyuJitCompilationBuilder.ToCompilation() + 0x4a4
at ILCompiler.Program.Run() + 0x2638
at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass249_0.<.ctor>b__0(ParseResult) + 0x308
Reproduction Steps
Repro created by passing --make-repro-path ... to ilc:
(Also please re-add it with ,HIDDEN, I don't know where the re-adding happens, but it's clearly re-added somewhere because the crash is due to this being present as both HIDDEN and not.)
We don't document this switch, this was added so that Xamarin targets can add stuff to it - I wasn't aware they remove stuff from it.
The standards for error reporting of incorrect use of undocumented options are pretty low, so I'm going to close this.
(Also please re-add it with ,HIDDEN, I don't know where the re-adding happens, but it's clearly re-added somewhere because the crash is due to this being present as both HIDDEN and not.)
The code tries to make sure to not have duplicates by removing System.Private.CoreLib first, then adding back all the assemblies in the next line:
Activity
dotnet-policy-service commentedon Dec 11, 2024
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.
MichalStrehovsky commentedon Dec 11, 2024
The targets are hardcoding an implementation detail of the runtime and the implementation detail changed.
This:
https://github.com/xamarin/xamarin-macios/blob/3ec925245f5f7f02cf2e465ca9951caf3975f93d/dotnet/targets/Xamarin.Shared.Sdk.targets#L1342
is now:
(Also please re-add it with ,HIDDEN, I don't know where the re-adding happens, but it's clearly re-added somewhere because the crash is due to this being present as both HIDDEN and not.)
We don't document this switch, this was added so that Xamarin targets can add stuff to it - I wasn't aware they remove stuff from it.
The standards for error reporting of incorrect use of undocumented options are pretty low, so I'm going to close this.
rolfbjarne commentedon Dec 12, 2024
The code tries to make sure to not have duplicates by removing System.Private.CoreLib first, then adding back all the assemblies in the next line:
https://github.com/xamarin/xamarin-macios/blob/3ec925245f5f7f02cf2e465ca9951caf3975f93d/dotnet/targets/Xamarin.Shared.Sdk.targets#L1342-L1343
I fixed it by instead removing "System.Private.CoreLib" from the list of assemblies to add: dotnet/macios@0f1ef6e
In any case, thanks for the help.