Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenAPI fails to generate source for latest Corelib #40090

Open
ericstj opened this issue Apr 10, 2024 · 3 comments
Open

GenAPI fails to generate source for latest Corelib #40090

ericstj opened this issue Apr 10, 2024 · 3 comments
Milestone

Comments

@ericstj
Copy link
Member

ericstj commented Apr 10, 2024

Describe the bug

GenAPI fails when generating source for the latest CoreLib:

Unhandled exception: System.ArgumentException: Unknown operator kind. (Parameter 'System.Half.explicit operator checked byte(System.Half)')
   at Microsoft.DotNet.GenAPI.SyntaxGeneratorExtensions.DeclarationExt(SyntaxGenerator syntaxGenerator, ISymbol symbol, ISymbolFilter symbolFilter) in /_/src/Compatibility/GenAPI/Microsoft.DotNet.GenAPI/SyntaxGeneratorExtensions.cs:line 107
   at Microsoft.DotNet.GenAPI.CSharpFileBuilder.Visit(SyntaxNode namedTypeNode, INamedTypeSymbol namedType) in /_/src/Compatibility/GenAPI/Microsoft.DotNet.GenAPI/CSharpFileBuilder.cs:line 211
   at Microsoft.DotNet.GenAPI.CSharpFileBuilder.Visit(INamespaceSymbol namespaceSymbol) in /_/src/Compatibility/GenAPI/Microsoft.DotNet.GenAPI/CSharpFileBuilder.cs:line 118
   at Microsoft.DotNet.GenAPI.CSharpFileBuilder.WriteAssembly(IAssemblySymbol assemblySymbol) in /_/src/Compatibility/GenAPI/Microsoft.DotNet.GenAPI/CSharpFileBuilder.cs:line 72
   at Microsoft.DotNet.GenAPI.GenAPIApp.Run(ILog logger, String[] assemblies, String[] assemblyReferences, String outputPath, String headerFile, String exceptionMessage, String[] excludeApiFiles, String[] excludeAttributesFiles, Boolean respectInternals, Boolean includeAssemblyAttributes) in /_/src/Compatibility/GenAPI/Microsoft.DotNet.GenAPI/GenAPIApp.cs:line 86
   at Microsoft.DotNet.GenAPI.Tool.Program.<>c__DisplayClass0_0.<Main>b__0(ParseResult parseResult) in /_/src/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tool/Program.cs:line 100
   at System.CommandLine.CliCommand.<>c__DisplayClass30_0.<SetAction>b__0(ParseResult context)
   at System.CommandLine.Invocation.AnonymousSynchronousCliAction.Invoke(ParseResult parseResult)
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)

To Reproduce

dotnet tool install -g microsoft.dotnet.genapi.tool --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9-transport/nuget/v3/index.json --prerelease
genapi --assembly C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Private.CoreLib.dll --output-path c:\scratch\spc\spc.cs

Exceptions (if any)

System.ArgumentException: Unknown operator kind
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-GenAPI untriaged Request triage from a team member labels Apr 10, 2024
@ericstj
Copy link
Member Author

ericstj commented Apr 10, 2024

Same thing repros for System.Runtime.

Appears to be this bug: dotnet/roslyn#63410

@ViktorHofer
Copy link
Member

Given that this got fixed recently in roslyn, we should rerun the above repro steps with the latest available GenAPI tooling.

@ViktorHofer
Copy link
Member

ViktorHofer commented Apr 15, 2024

Interestingly this still repros with the latest GenAPI that bundles roslyn assemblies from this SHA: dotnet/roslyn@84c5476

Same stack trace

@ViktorHofer ViktorHofer removed the untriaged Request triage from a team member label Mar 10, 2025
@ViktorHofer ViktorHofer added this to the Backlog milestone Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants