arcade: New versions of GenAPI consistently crashes with InvalidCastException

GenAPI started breaking for aspnet in what appears to be the result of https://github.com/dotnet/arcade/pull/2517. This is blocking aspnetcore’s ability to consume an update to Arcade.

  Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'WhereEnumerableIterator`1[Microsoft.Cci.ITypeDefinitionMember]' to type 'System.Linq.IOrderedEnumerable`1[Microsoft.Cci.ITypeDefinitionMember]'.
     at Microsoft.Cci.Traversers.SimpleTypeMemberTraverser.Visit(IEnumerable`1 members) in /_/src/Microsoft.Cci.Extensions/Traversers/SimpleTypeMemberTraverser.cs:line 91
     at Microsoft.Cci.Writers.CSharpWriter.Visit(IEnumerable`1 members) in /_/src/Microsoft.Cci.Extensions/Writers/CSharp/CSharpWriter.cs:line 141
     at Microsoft.Cci.Writers.CSharpWriter.Visit(ITypeDefinition parentType, IEnumerable`1 fields) in /_/src/Microsoft.Cci.Extensions/Writers/CSharp/CSharpWriter.cs:line 205
     at Microsoft.Cci.Traversers.SimpleTypeMemberTraverser.Visit(ITypeDefinition type) in /_/src/Microsoft.Cci.Extensions/Traversers/SimpleTypeMemberTraverser.cs:line 74
     at Microsoft.Cci.Writers.CSharpWriter.Visit(ITypeDefinition type) in /_/src/Microsoft.Cci.Extensions/Writers/CSharp/CSharpWriter.cs:line 131
     at Microsoft.Cci.Traversers.SimpleTypeMemberTraverser.Visit(IEnumerable`1 types) in /_/src/Microsoft.Cci.Extensions/Traversers/SimpleTypeMemberTraverser.cs:line 62
     at Microsoft.Cci.Writers.CSharpWriter.Visit(IEnumerable`1 types) in /_/src/Microsoft.Cci.Extensions/Writers/CSharp/CSharpWriter.cs:line 110
     at Microsoft.Cci.Writers.CSharpWriter.Visit(INamespaceDefinition ns) in /_/src/Microsoft.Cci.Extensions/Writers/CSharp/CSharpWriter.cs:line 99
     at Microsoft.Cci.Traversers.SimpleTypeMemberTraverser.Visit(IEnumerable`1 namespaces) in /_/src/Microsoft.Cci.Extensions/Traversers/SimpleTypeMemberTraverser.cs:line 43
     at Microsoft.Cci.Writers.CSharpWriter.WriteAssemblies(IEnumerable`1 assemblies) in /_/src/Microsoft.Cci.Extensions/Writers/CSharp/CSharpWriter.cs:line 73
     at Microsoft.DotNet.GenAPI.Program.<>c__DisplayClass0_0.<Main>b__0() in /_/src/Microsoft.DotNet.GenAPI/Program.cs:line 95
     at Microsoft.DotNet.GenAPI.Program.Main(String[] args) in /_/src/Microsoft.DotNet.GenAPI/Program.cs:line 52
D:\a\1\s\eng\targets\ReferenceAssembly.targets(67,5): error MSB3073: The command "dotnet --roll-forward-on-no-candidate-fx 2 "D:\a\1\s\.packages\microsoft.dotnet.genapi\1.0.0-beta.19218.1\build\\..\tools\netcoreapp2.1\Microsoft.DotNet.GenAPI.dll" "D:\a\1\s\artifacts\bin\Microsoft.Extensions.Caching.Abstractions\Debug\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll" --lib-path "D:\a\1\s\artifacts\bin\Microsoft.Extensions.Primitives\Debug\netstandard2.0;D:\a\1\s\.packages\netstandard.library\2.0.3\build\netstandard2.0\ref;D:\a\1\s\.packages\system.buffers\4.4.0\ref\netstandard2.0;D:\a\1\s\.packages\system.memory\4.5.2\lib\netstandard2.0;D:\a\1\s\.packages\system.numerics.vectors\4.4.0\ref\netstandard2.0;D:\a\1\s\.packages\system.runtime.compilerservices.unsafe\4.6.0-preview5.19217.11\ref\netstandard2.0" --out "D:\a\1\s\src\Caching\Abstractions/ref/Microsoft.Extensions.Caching.Abstractions.netstandard2.0.cs" --header-file "D:\a\1\s\/eng/LicenseHeader.txt"" exited with code -532462766. [D:\a\1\s\src\Caching\Abstractions\src\Microsoft.Extensions.Caching.Abstractions.csproj]

See https://dev.azure.com/dnceng/public/_build/results?buildId=160140&view=logs&jobId=2fe95fc5-ae3d-58fd-c2b8-46bb81541875

cc @ViktorHofer @safern

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

+1 to tests. Just having something set up so you can excercise the code goes a long way for making folks more productive. It wouldn’t need to be exhaustive, just a start. Something like run GenAPI against some of the dependencies and then make sure they can be recompiled.

You can validate by updating the version of GenAPI referenced in aspnet/Extensions and run ./eng/scripts/CodeCheck.ps1. Here is the PR that caught this problem https://github.com/aspnet/Extensions/pull/1458 and the steps that failed: https://github.com/aspnet/Extensions/blob/master/azure-pipelines.yml#L26-L34